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.

Switching 7.2 – 12v PWM Lines Using 5V from USB

Status
Not open for further replies.

Technogumbo

New Member
Hi everyone. I am working on a small project for using USB to control an RC car. Basically what I am trying to do is allow uninterrupted PWM signals to pass through the device when USB is not hooked up, then prevent the PWM signals when USB is hooked up to the circuit. USB operates on 5V and I try and limit my devices to sourcing 400mA from the bus.

RC cars normally have a three pin PWM, V+, and GND line for each servo and electronic speed controller you want to control. The battery powering the circuit could be from 7.2 to 12v.

**broken link removed**

I am wondering if the attached schematic is even realistic? I was hoping to use a PNP transistor with base hooked to the 5v line of USB to essentially close the PWM line whenever I hook up the USB connector to the device, and supply my own PWM signal being generated from a microcontroller.

I am having doubts because the base of the PNP will be left unconnected when no USB cable is hooked to the device. Do I need to use a circuit like the following posted by user Hero999 in another thread?

**broken link removed**

Thanks for all the advice in the forum I have found it useful many times.
 
Let me simplify this a bit. I did some experiments and I don't think using a PNP with nothing connected to the base will work at all to allow voltage to pass through.

All I want to do is cut off a 7.2 - 12v line when a 5v line is hooked up. Then replace what was on the 7.2 - 12v line with whats on the 5v line.

I know you can do something like this with a relay, but I really want to use as small as possible solid state parts for the project.

Thanks to everyone that has looked at this.
 
As long as you have base resistors I don't see why it wouldn't work, though if there's a large chance for static discharge you may want to put protection diodes on the line.
 
Thanks for taking a look Sceadwian. I did some tests with this using some Radioshack grade PNP BJT transistors, specifically the PN2907.

When the 5v base is left unhooked/floating, which it will be when USB is not connected; the ransistor does not pass any voltage as far as I can tell.

If I tie the base to the 7.2 - 12v ground, then when I re-hookup the 5v line, the 5v+ will not be enough to overcome the ground potential of the 7.2 - 12v ground, so the transistor passes voltage no matter what.

I think im going to take a different approach to this. Thanks for taking a look.
 
Use a resistor to tie it to ground or VCC whichever you want the default state to be, just use a large value resistor then the 5V line won't have any trouble pulling it up.
 
Thanks Sceadwian. This seems very obvious; but it didn't occur to me. I have a lot to learn. I'll give it a shot and let you know if it works.
 
This works when you tie the PNP transistor with a high value resistor to the 7.2v ground! A revised diagram can be seen below.

**broken link removed**

The lines that D1 and D2 are on are coming from a microcontroller that supplies PWM when 5v is connected.

Thanks for the help.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top