Controlling a 12V device with a microcontroller

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Thanks for the advice. i tried reducing it to 10K and it worked! apparently I was not saturating the transistor!

Well it didnt go to 0 but anyway now I got 12V when base is 0 and 0.5V when base is 5V. I guess I am going to invert the base signal (cause I have no idea how PNP works and anyway I dont have one)

if you have any advice please tell me. I am worrying about the current... I suppose I ll have to measure it.

Kansai
I measured the current.
With RC being 300 Ω the current was 37.5mA
I changed RC to 520 Ω and the current got reduced to 22mA without affecting the voltage delivered.
with a 1K the current becomes 11.4 mA

I guess changing the RC resistor lets me control the output current.
 
Last edited:

JoeJester

Joined Apr 26, 2005
4,390
I have but cant understand it totally I am connecting Vs to 12V (the motor works from 6V to 12V) and Vcc to 5V and providing the PWM to Vref. But the output Voltage to the motors is reflection of Vref so if I give the PIC PWM to it, the motor only will get 5V max.
Vs - 12V
Vcc - 5V
Vref - 5V (Vref must be less then or equal to Vs)
IN1 - CW PWM
IN2 - CCW PWM

that is why I need the transistor

What is a "level translator"?
You don't need the transistor. A level translator would move your 5V PWM to another voltage. As you saw with your transistor, you created an inverter, tranlating a zero from the pwm to a 12V and the 5V from the pwm to a zero volt. It's all in how you designed the translator.
 
Top