Shop OBEX P1 Docs P2 Docs Learn Events
one pin: +/- current and off — Parallax Forums

one pin: +/- current and off

Bobb FwedBobb Fwed Posts: 1,119
edited 2010-07-17 19:56 in Propeller 1
So I was originally looking for a circuit to control a bi-color LED (both colors and off) from a single IO pin (without using a voltage divider -- thus throwing away power). I didn't find one in the 10 minutes I was looking so I tried making my own. After a few tries, I came up with one similar to what is attached. Some tweaking later and you have a fairly robust, overly complicated circuit that can source and sink in two directions and turn the circuit off completely too. All from just one IO.

This seems like too much for just an LED, seeing as it wastes over half as much power as the LED would use, but I was thinking it could be quite useful for motor control. You could run a single motor forward and backward and PWM it at the same time.

The problem I am having is that I had P-channel MOSFETs on the output, but I ran into an issue with both the P- and N- FETs being active at the same time for a few nanoseconds, it burned up a lot of power for a short period of time. I altered the schematic so it uses N-channel FETs, but now you loose voltage over the MOSFET (the amount depends on the Vgs of the FET). This prevents both the source and sink FETs from being on at the same time, but now a large amount of power would be wasted and heat generated on the sourcing FET. As is, the circuit can handle about 50KHz (50% duty -- in any state +/-/off), which is more than enough for motors or LEDs. Because of the heat generated on the FET, the power is more limited than normal. With the FETs I chose (with lots of heatsinking) you may be able to get away with about 1A.

So the question is: is there a way to delay a P-channel FET from turning on, without delaying the turn off. Or I could add a charge pump. Only a couple volts are needed, and MOSFETs' gates aren't very hungry, so a couple pulses from PWM every second may be enough to fully tun on the N-channel FETs.

The circuit is pretty straight forward, but the R7 resistor needs to be changed based on the controlling voltage (3.3V in this example, seeing as we are using it with the Prop).
3.5V - 7.0V = 10K
2.4V - 4.2V = 5.6K (right in the sweet spot)
2.1V - 3.5V = 4.3K (would also work -- according to SPICE)

SPICE file is for LTSpice IV.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!

Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!

Post Edited (Bobb Fwed) : 7/16/2010 11:02:03 PM GMT

Comments

Sign In or Register to comment.