Simple flip flop or not?

Ahh, good to know. Or at least, I did know but only from the cases is automatically loaded that draft again. But it did not today. It did indeed (partially) saved my previous post. Probably till the time my log on expired. Why they think Arduino.cc is sooooooo important it needs an expiring log on is beyond me...

@Smajdalf, I tend to do that quite often as well. Only not this time of course :confused:

aussiewill:
Septillion has come up with VERY useful suggestions, but Paul__B,s little circuit is ALMOST exactly what I have been playing with in my mind.
Quick question:why the 100Volt 14Amp Mosfet at M13???

Not of course, my diagram; the FET is random - and it does not need to be a logic-level device. The advantage of a FET is that it does not pull down on the first LED and keep it lit with the first transistor switched off.

aussiewill:
And back to my dilemma: what if I used exactly that schematic but with 2 x BC558.
Then, in the line from collector of Q15 to the base of M13 put a resistor of LOWER value than R42!

No, the base resistor must be at least ten times the value of the LED current control resistor.

aussiewill:
Am I correct in thinking that when the arduino pin goes HIGH, transistor 1 will suck number 2 low, and when the arduino goes LOW number 1 base goes back high and number 2 will promptly trigger again.

I just keep coming up with that and thinking it SHOULD work but that it seems too simple!!!!.

That is how it works, transistor 2 is an inverter.

aussiewill:
Transistor number 2 feed should come from BEFORE LED1, NOT after as in schematic.
Otherwise LED 1 will still be powered, however low the current.

That is the problem with using a transistor and why I used the FET circuit last night when I was getting too tired to figure out how to use a BJT in the second position. You cannot feed the base resistor from the anode side of the first LED (let alone two LEDs in series) because the first transistor will be unable to pull the voltage down far enough to turn off the second transistor.

The solution for that is to add two diodes with both anodes connected to the base resistor which is returned to 12 V, one cathode connects to the collector of the first transistor while the second connects to the base of the second. This prevents the first LED lighting from being pulled down by the second transistor base, while the first transistor and diode pulls down lower than the second diode combined with the emitter-base threshold of the second so that it turns off effectively.


Septillion has addressed these points, but I have taken about four hours to draft this - work does get in the way. :roll_eyes:

Paul__B:
Not of course, my diagram; the FET is random - and it does not need to be a logic-level device. The advantage of a FET is that it does not pull down on the first LED and keep it lit with the first transistor switched off.
No, the base resistor must be at least ten times the value of the LED current control resistor.
That is how it works, transistor 2 is an inverter.
That is the problem with using a transistor and why I used the FET circuit last night when I was getting too tired to figure out how to use a BJT in the second position. You cannot feed the base resistor from the anode side of the first LED (let alone two LEDs in series) because the first transistor will be unable to pull the voltage down far enough to turn off the second transistor.

The solution for that is to add two diodes with both anodes connected to the base resistor which is returned to 12 V, one cathode connects to the collector of the first transistor while the second connects to the base of the second. This prevents the first LED lighting from being pulled down by the second transistor base, while the first transistor and diode pulls down lower than the second diode combined with the emitter-base threshold of the second so that it turns off effectively.


Septillion has addressed these points, but I have taken about four hours to draft this - work does get in the way. :roll_eyes:

Good grief, all the man wants to do is turn a couple of LEDs on when another pair are tuned off!
I was thinking of dabbling in electronics but now I am wondering if I should stick with software :slight_smile:

septillion:
@Smajdalf, that schematic is a bit "weird". Normally you would use a NPN for low side switching and a PNP for high side. This way you always have a VCE of 0,6V - 0,7V. But, you can probably get away with not using base resistors. :smiley:

It may be "weird" but I prefer calling it "clever". Depending on power supply and type of LEDs you want to drop 2-3V to protect the LED from overcurrent. Using my schematic you get a lot of pros:

  1. You don't need base resistor
    1a) You don't need to calculate the base resistor
  2. All current goes through the LED - no base current wasted
  3. The series resistor doesn't have to dissipate all the power - some power is dissipated in the transistor
  4. Forward drop of both diodes and BE junctions add up when control pin is tri-stated - depending on LEDs and Vcc it is quite probable no current will flow.
    Ofc the are some cons:
  5. The voltage to drop on resistor is smaller and so current in the LED depends more on real power supply voltage, real Vf of the LED and all the other mysterious stuff.
  6. Possibly some extra sources of damage to the driving pin if something goes wrong - but this is dubious.

Hehe, true :smiley:

Hi,
It all seems to be getting WAY over my head so I think I'll try Paul_B's circuit with the 10x1 resistor value he's mentioned and just go from there.
If I can't make that work I'll just have to order a batch of NPN to match and I feel fairly confident it will then work.

Thanks for all the feedback to all of you.

Aussiewill

If it's getting way over your head, why are you still even messing with transistors? :roll_eyes:

Hi
Have now realised that I AM indeed in over my head and have decided that I'll just get the same servos that operate the points to operate micro switches to change the state of any or all LEDs.

So thanks again everyone for assistig.

Aussiewill

And in reply 1 I gave you a VERY VERY VERY easy solution for which you only need 1 Arduino pin, 2 resistors and 2 leds... It doesn't become more simple than that. Your solution now is even more complicated. It includes an extra micro switch and quite some extra wiring... :o

Alright, maybe the problem was text rather than a schematic:
simple dual-leds.jpg

aussiewill:
Have now realised that I AM indeed in over my head and have decided that I'll just get the same servos that operate the points to operate micro switches to change the state of any or all LEDs.

Oh, for goodness' sake! :astonished:

It just isn't that complicated!

Two red LEDs, two green LEDs, operating from 12 V but controlled by the 5 V output of an Arduino pin.

Alternate_LEDs.png
HIGH (5V) on the Arduino control switches on red LEDs, LOW switches on green. LED current limited to less than 20 mA (but feel free to alter the 470 Ω to suit).

Can I suggest something simpler, using far fewer components?

Use an led driver chip such as tlc5916/7. One resistor, one bypass cap, 3 Arduino pins to drive all your LEDs. No led series resistors needed. If you need to add more LEDs later, you can cascade more chips without needing more Arduino pins.

Well, the thing is, I was designing to the OP's actual specifications as in reply #14

aussiewill:
To recap, Arduino output pin voltage (5Volt??) supplies the trigger.

LED supply is 12Volt.

Only BC558 and BC448 available, plus a range of 1/4 watt resistors.

One pair of LEDs has to go on, another pair has to go off.

As far as practical. Unfortunately, BC558 and BC448 are PNP transistors, quite useless in this application. BC337s are however readily available at Jaycar which should even be open today (Sunday). The diodes are standard, either signal or power diodes will do but 1N4148/ 1N914 are smaller.