Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Want to increase or decrease current via Arduino's PWM. What kind of circuit can do that?

Status
Not open for further replies.

LegoTekFan486

New Member
I want to charge a NiMH battery pack, using a temperature sensor, and once I'm done fast charging it, wait until it cools down, then top it off with trickle charge for a limited amount of time.

What kind of circuit can regulate current based on PWM? Not constant current by itself: the Arduino would do that via feedback from a current-sense circuit I will have.

For safety, I will have a watchdog that cuts off charging if the Arduino fails for some reason, two temperature sensors where charging will only be done if they "agree" i.e. if one sensor fails, they wouldn't match anymore and the Arduino would see that and refuse to charge. I'll program it to also shut down the load if the battery gets overly hot while powering the load. Finally, I'll have a thermal fuse in series with the battery pack itself, mounted against it on top. (Crimped onto the wires, not soldered)
That way, even if all else fails and the battery does get dangerously hot, the thermal fuse breaks.
 
Buck or boost converters can - if you google there are numerous suitable charging circuits using Arduinos out there. You should also monitor the battery voltage, which again is easy using a micro-controller like an Arduino.
 
If you have a current-sense circuit, then you don't need a constant-current circuit, you just need a voltage regulator, such as an LM317, whose voltage is controlled by the P;WM signal.
You then control the current by adjusting its output voltage.

Below is the LTspice simulation of an example circuit:
The maximum output is 1.25V above the peak PWM signal voltage (for a PWM duty cycle of 100%).
You can amplify the PWM signal from the Arduino with a transistor amp if needed.
But note that will invert the phase of the PWM signal.

1616780555022.png
 
If you have a current-sense circuit, then you don't need a constant-current circuit, you just need a voltage regulator, such as an LM317, whose voltage is controlled by the P;WM signal.
You then control the current by adjusting its output voltage.

Below is the LTspice simulation of an example circuit:
The maximum output is 1.25V above the peak PWM signal voltage (for a PWM duty cycle of 100%).
You can amplify the PWM signal from the Arduino with a transistor amp if needed.
But note that will invert the phase of the PWM signal.

View attachment 130571

Interesting.....can you show current through R_Load please?
 
Interesting.....can you show current through R_Load please?
Here it is (purple trace):
The current is proportional to the voltage, of course.

1616799953026.png
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top