one pin: +/- current and off
Bobb Fwed
Posts: 1,119
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
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
One of the two transistors has to be "on" for the LED to light. With the input floating, there will be no base current in either one, hence no collector current, so the LED will be off. (You may need to add another diode or two.)
-Phil
Addendum: The inverter needs to be CMOS, and it will probably oscillate when its input is floating. You can reduce the frequency of oscillation by adding capacitance between the LED/resistor common node and ground. Don't add any to the inverter's input, though, because the LEDs will glow as the cap is being alternately charged and discharged by the oscillation.
Post Edited (Phil Pilgrim (PhiPi)) : 7/13/2010 11:07:30 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
You've made an interesting connection there! I think that circuit could be adapted to drive a two-pin LED. Although the OP expressed an aversion to voltage dividers, the resistance values in that circuit could well be made high enough to obviate any concerns over current consumption. It would certainly be better than my madly oscillating NOT gate!
-Phil
With a 12V input, it takes about 20ms for the charge pump voltage to get to 14V (2V above input -- a minimal threshold) and 45ms to get to 16V (4V above input -- a standard threshold). It maxes out at about 17V (after about 125ms), but this can be changed fairly easily (to go higher, or stay lower). The values in the schematic were chosen to achieve 20V if the input voltage rose to 13.9V.
Maximum input voltage is now determined by the 555 timer's Vdd limit which I think is typically 15V. Another possible limit is the Vgs on the N-channel FETs, typically they are 20V (this voltage is powered by the charge pump). A simple 18V zener would suffice, or a couple diodes in series: anode to the FET gate and cathode to incoming voltage would keep the voltage in acceptable ranges.
I might put this onto a PCB and try it out. I might be able to fit it (with SMT parts) on a $50 (or so) board from Sunstone.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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/18/2010 3:28:08 AM GMT