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.

Controlling a 12V device with a microcontroller

Status
Not open for further replies.
Hello all

this must look like a really dumb question but please allow me.
say I have a 12V motor that I want to control with a micro (that is powered on 5V)

the normal thing I have done so far is to isolate the circuits with a photocoupler.

Instead of that I have been suggested to connect the output to a transistor and use that as a switch to the 12V circuit. now I dont know if that is stable or not but my question is even MORE BASIC than that.:(

1) If I connect the output of the micro to the transistor and the ground pin to ground, where do I connect the 5V pin to???

2) do I need a power source with two outputs (12V and 5v)?

3) What if I am using batteries? if I use 8 batteries(12V) where do I connect the micro 5V pin?

Thanks for the answers...

Kansai
 
Last edited:
I found one example.
take a look at the picture

**broken link removed**

notice the upper side. the 12V power source.
and in the lower side the 5v power source.

they are connected in the ground!!!!

can you do that? connect two different power sources on the ground???
 
You can connect the negative lead of the 5v and the negative lead of the 12v supplies together. This is called "Common earth" or "Common ground" or "Common Chassis."
Connect the output of the micro to the base of the transistor via a 470R resistor. Connect the emitter of the transistor to 0v (chassis - earth) and the collector of the transistor to one terminal of the motor. Connect the other terminal of the motor to 12v.
Connect the microcontroller to the 0v rail and the 5v rail.
 
Last edited:
thank you for your reply. In conclusion i will join both power sources grounds.

Now for controlling the motor I plan to use a H-bridge (either buy or build with transistors)

I was thinking of using 2N3904 transistors (cause I have a few) but turns out that the maximum Ic is 200 mA. now normally motors require like 1A I read in a tutorial. I called the provider of my motor (cause there is no datasheet) and he told me my motor uses around 250~270 mA.

so in anycase i believe 2N3904 are out.
I am checking and it seems 2N2222 are much better for this (can deal with 800mA) but the Hfe is 75 compared to 2N3904's 100. Still it seems like a good option to build a H-bridge.

Now, my question:

I have also with me one Toshiba TA7291S ( a bridge driver).


TA7291S datasheet (pdf)
Do you think this is a good option for my motor. I cant seem to understand the specs in the datasheet. Are the transistors of this bridge driver adequate for my motor?

Also i dont understand very well what VCC VS and Vref are. i am using a 12V motor and a normal PIC (5V)

thanks a lot

kansai
 
Last edited:
The starting current for your motor will be 2 amp and when a load is applied, the current will rise to 600mA.
You need 2A transistors PNP and NPN - unless you use all NPN.

I hve a very clever circuit that allows 12v H-bridge with 5v micro and all NPN transistors. .
 
I am so sorry for my ignorance but why the current will be 2 amp??

and later rise to 600 mA? wouldnt that be decrease? and why 600 mA??

with those numbers I suppose 2N2222 is out of the question... but why?


also is the TA7291 not adequate??

Sorry for all the confused questions....
 
The starting current will be 2 amp. As the motor increases in rpm the current will decrease to 200mA. Then when you put a slight load on the motor, the current will rise to 500 to 600 mA. This is what you have to take into account.
 
So the Darlington is the only option? Say the TIP120?

by the way, what kind of transistors does the bridge circuit I mentioned use? Is it possible to use that?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top