controlling voltage higher than 5V

apburner

New Member
I am strong in digital but somewhat lacking in analog. So I have been trying to figure out how to control higher voltages such as when one needs to control a DC motor with PWM but it requires a drive voltage of 12 or 18 volts. I understand the design of H-bridges but can't figure how to run them at 12 volts and not blow the picaxe.
Thanks
Steve
 

womai

Senior Member
It's actually quite easy to do what you want.

You only need a 12V source (providing the motor supply) and a 5V source (providing the supply for Picaxe & other logic). The 5V can simply be derived from 12V with a linear regulator (e.g. 7805 type), so you really only have a single supply to hook up. The ground (gnd) is the same for both supply voltages (necessary so the current can return to the respective source).

The simplest way to switch 12V from a Picaxe is to use an NPN transistor. Connect the emitter (E) to ground, and the base (B) to the Picaxe output. Then hook up your load (e.g. the motor) between +12V supply and the collector (C) of the transistor. The transistor will turn on whenever the voltage at the base exceeds approx. 0.7V, so the Picaxe can easily achieve this. On the other hand, the Picaxe will never see the full 12V of the load side.

More sophisticated hookups would be through an H-bridge (google that word), but its the same principle (Picaxe controls a transistor that acts as a switch and isolates the Picaxe from the 12V). Second, for cleaner switching usually a Darlington transistor (i.e. two transistors cascaded together) is better than a simple single transistor. Finally, for larger load (more than maybe 100-200mA of current) usually field effect transistors (FETs) are used instead of bipolar NPN or PNP transistors, but from a high-level point of view it's still the same principle.

Also, for inductive loads (like a motor) you need to bridge the load with a reversely biased diode to protect your circuitry from the inductive spikes when the current gets turned off.

Have a look at the "interfacing" document of the Rev-Ed website, it shows those circuits with diagrams.

Wolfgang
 

apburner

New Member
Thank you Wolfgang. I didn't realize that it was as simple as separating the supplies while keeping the commons "well" common. I have several power darlingtons that will drive the motors I want to drive very nicely.
Steve
 

boriz

Senior Member
“connect…..the base (B) to the Picaxe output.”

Caution. I hope you realise that a base resistor is required. Otherwise you might let the smoke out.
 

apburner

New Member
Yes I understand that a resister must be used. I don't want to let out all the factory installed smoke. Thats a bad thing.
Steve
 
Top