Need minimal circuit to drive signal LEDs from I/O pin - Page 1
Forum section: electronics / projects

author: MarkF
author_rank: Super Contributor
timestamp: August 10, 2025, 02:19:46 pm
content: I'm trying to drive a model railroad signal containing two LEDs from one I/O pin.The I/O pin comes from a ULN2003 array (which drives all the relays and LEDs on the layout).The default (I/O pin is high) will display red and when low will display green.The two LED signal head is aJTD873GR HO Scale Train Signalfrom Evemodel.The description is as follows:Specification:Reference Scale: 1:87, suitable for HO scale.Operating Voltage: 12V, AC or DC Compatible.Operating Current: 20mA.Color: Red and Green.Package included:3 complete lamps, including 3 Resistors pre-wired for 9~18V operation.Each signal comes with a 1K resistor installed.However when powered from 12V, the LEDs are insanely too bright.Something closer to 1mA or less gives the proper brightness (not 20mA).I have placed a 10K ohm resistor in series with the power to obtain are reasonable brightness.Here are the parts you have to work with (add resistors to suit):Note: I don't have any small MOSFETs in stock.For the moment, I'm going to withhold my solution which works but isn't as flexible as Iwould like to adjust the brightness. And it's a little confusing to me even though I did it.The main reason for wanting a different solution is that a different manufacture might requirea different current setting.

author: Ian.M
author_rank: Super Contributor
timestamp: August 10, 2025, 02:43:04 pm
content: You didn't clearly state the LED assembly is common anode.Also the open collector Darlington output of a ULN2003 is not similar to most MCU I/O pins.With that out the way, yes, the easy option would be a N-MOSFET with Vgs threshold >> the 1.1V max Vce_sat of the ULN2003. Drive one LED + the MOSFET gate direct from the ULN2003, and the other from the MOSFET drain.Another similar approach is to drive the second LED from another Darlington (to minimise base current), maybe even a spare ULN2003 channel, with a potential divider feeding the base so you can guarantee its off at 1.1V, and put a pullup resistor on the original output so the LED its driving doesn't glow with the base current of the second Darlington.

author: mtwieg
author_rank: Frequent Contributor
timestamp: August 10, 2025, 03:46:29 pm
content: Do you want the LEDs to be complementary (i.e. one is always on)? Or do you want to set the GPIO in hi-z to create a third state (maybe to disable both LEDs)?The product page says "12V, AC or DC Compatible" which is odd... might mean there are additional diodes inside the assembly to protect the LEDs from reverse bias...

author: Ian.M
author_rank: Super Contributor
timestamp: August 10, 2025, 04:13:35 pm
content: I'm assuming complimentary as his "I/O pin" is actually an open collector output, and that's what he explictly requested: "The default (I/O pin is high) will display red and when low will display green."If he was using a MCU pin, he'd have more options. e.g. see this Covid lockdown design challenge:https://www.eevblog.com/forum/projects/one-mcu-pin-3-leds-design-challenge/

author: magic
author_rank: Super Contributor
timestamp: August 10, 2025, 04:29:23 pm
content: Won't get simpler than here.

author: macboy
author_rank: Super Contributor
timestamp: August 10, 2025, 04:48:27 pm
content: My idea was to use one output of the Darlington array for the red, and drive a second Darlington input from that output for the green. This works since the '2003 outputs are effectively inverted. Each led can have its own additional series resistor for brightness control. An additional pull-up may be needed for the second input if not enough current is allowed through the red LED and its resistors to drive the second input, or if the red LED glows due to the input current. I would draw up a schematic but I'm on my mobile.

author: MarkF
author_rank: Super Contributor
timestamp: August 10, 2025, 08:01:26 pm
content: A little further explanation is needed here.The I/O pin is a ULN2003 output. It is part of the custom train controller.There are 30 outputs on a PCB to drive relays and lamps.I have 5 pins that are not being used that I want to leverage to drive 5 signals.It is possible to add two more PCBs which would provide 90 total pins.I would prefer not to add additional boards, nor the extra software work load to drive two pins.Although having two pins and a third state where neither LEDs On would be ideal.More details of my HO Model Railroad can be foundhere.As for the signal assembly itself, I provided a link to the units I bought.That's all the info I have on them. Go read it for yourself.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 10, 2025, 08:09:44 pm
content: Quote from: MarkF on August 10, 2025, 02:19:46 pmDo you mean by a trim pot, or component change ?#4 gives good starting point.12V has a good voltage margin.You can change common current with a resistor in the high side, and you can skew the R:G currents by resistor(s) in the low sides.The diode dropper could then change to a zener, so the skew resistor drop could be tolerated.

author: MarkF
author_rank: Super Contributor
timestamp: August 10, 2025, 08:25:47 pm
content: Quote from: magic on August 10, 2025, 04:29:23 pmI like your idea and just gave it a try.One flaw though. The green LED is noticeably brighter andtrying to add a resistor to dim it prevents operation.The green LED will always be brighter because of the neededtwo diode voltage drop in the red path for switching.

author: Benta
author_rank: Super Contributor
timestamp: August 10, 2025, 08:55:51 pm
content: The obvious solution for me would be to use two MC14053/CD4053 triple 2:1 analog multiplexers.They are 12 V compatible, both power- and logicwise, and cost a few cents.This presumes that your signals are always either red or green, but I'd think that a signal that's off would be catastrophic in a railway system.Two SO-16 packages in size.

author: Zero999
author_rank: Super Contributor
timestamp: August 10, 2025, 09:56:00 pm
content: Just use a MOSFET with a minimum threshold voltage of at lest 0.8V. The 2N7002 will do.

author: MarkF
author_rank: Super Contributor
timestamp: August 10, 2025, 10:37:12 pm
content: Quote from: Benta on August 10, 2025, 08:55:51 pmThere are many types of signals. I choose ones with only red and green aspect.Signals are easily the most complex part of railroads and each railroad has its own set of rules.For the sake of my layout, I'm over simplifying them to the point of being unrealistic.Most modern signals have three heads with each head containing red, yellow, and green lights.And 'no', railroad signals are not typically lite all the time.This saves power and extends the life of the bulbs/LEDs.There are signals that are lit all the time and some that only are lit when a train enters the block it controls.It all depends on what type of signal it is. Different railroads have different rules.Quote from: Zero999 on August 10, 2025, 09:56:00 pmThe premise of this challenge is to NOT use a MOSFET!!!I would prefer not to place a special order for just a handful of MOSFETs wherethe shipping would cost more than the parts.Your MOSFET design is similar to my initial thoughts and I will expand on the issues I ran into laterafter members have had time to provide their input.

author: MarkF
author_rank: Super Contributor
timestamp: August 10, 2025, 10:42:34 pm
content: Let me emphasize how the signal is wired.You can see in my initial circuit starting point that the signal is common anode.And from the sellers website:

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 10, 2025, 11:03:20 pm
content: Quote from: MarkF on August 10, 2025, 08:25:47 pmNot if you change to a zener as per my post above.Quote from: MarkF on August 10, 2025, 08:25:47 pmThere is also a 1 Darlington drop across the ULN2003, and the VF of LEDs also differ, as well as optical efficiency.The 12V drop means you would struggle to even see the path differences.You should start by determiningwhat actual current you would like to seethru each LED, picking an average of your samples there.Addit: and measure the VF of each LED - if there is a fixed 1k internally in series, feed it from say 100k so you measure mostly VF.It's the R:G difference you are looking for here.

author: Benta
author_rank: Super Contributor
timestamp: August 10, 2025, 11:11:19 pm
content: Quote from: MarkF on August 10, 2025, 10:37:12 pmI stand corrected. I'm admittedly no expert on railway signals.But getting a three-way output (red/green/off) from a ULN2003 doesn't really seem feasable.

author: MarkF
author_rank: Super Contributor
timestamp: August 11, 2025, 02:39:39 am
content: QuoteFrom my very first post:"Each signal comes with a 1K resistor installed.However when powered from 12V, the LEDs are insanely too bright.Something closer to 1mA or less gives the proper brightness(not 20mA).I have placed a 10K ohm resistor in series with the power to obtain are reasonable brightness."QuoteQuoting Reply #6:"Although havingtwo pinsand a third state where neither LEDs On would be ideal."I'm not expecting to obtain a 'Off' state with only one pin. It's something I'm willing to live without.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 11, 2025, 02:51:39 am
content: Quote from: MarkF on August 11, 2025, 02:39:39 amOK, if you are happy with simply equal currents, then just use your 10k.For low voltage drops, but more than two diodes, you can also use another LED as a LV Zener.

author: MarkF
author_rank: Super Contributor
timestamp: August 11, 2025, 02:56:13 am
content: Let's just cut to the chase. This is what I built:In order to get this to work with the ULN2003, I needed to run the emitter through a diode to GND.What I don't like here is the interaction between turning On the green LED and the base current to turn On the red LED. In choosing resistors to get the proper LED current and logic switching, the issue is that the green LED will not go Off staying On all the time unless the circuit is tuned just right. I wish the switching of the green LED was more independent.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 11, 2025, 03:50:06 am
content: Quote from: MarkF on August 10, 2025, 02:19:46 pmMy hobby budget is only about a cup of coffee per week, but I like to keep a strip of 100Nexperia NX138AKRN-channel enhancement mode MOSFETs in SOT23-3 in stock. They're small enough, but not too small to hand-solder directly to wires if need be (with heat shrink around to keep everything in place and intact), and Nexperia has aSPICE modelfor it too. A set of 100 costs under 4€ right nowat MouserandDigikey; a set of 200 costs 4€ atLCSC(buttariffs). NX138AK is very similar to the jellybean BSS138 MOSFET available from many manufacturers, but is a bit faster to switch due to lower total gate charge. I particularly like the fact that it is pretty high-Z at Vgs ≤ 0V, conducts quite well at Vgs ≥ 2.5V, and so will switch well at 3.3V CMOS/LVC logic levels and 5V TTL logic levels; but can handle Vgs up to ±20V.

author: MarkF
author_rank: Super Contributor
timestamp: August 11, 2025, 04:28:01 am
content: I DO NOT MAINTAIN A LAB OR STOCK PER SAY! RARELY DO I HAVE ANY NEED FOR PARTS.I have a table with a scope, DMM, soldering iron, and several power supplies.When I buy components for a project, I will order a few extras.I do not build projects on a regular basis.My list of active components is very very small.Before this, my last hardware project was severalyearsago.I'm NOT going to buy a bunch of parts that most likely I will never use.Although I have a EE degree, my 35 year career was software development.After the model railroad, my interests tend to software. Especially graphics.When I was working, I did modelling and simulation specializing in sonar & underwater sound propagation,aircraft cockpit instrument simulation, and situational awareness/tactical displays with a map background.My hobby budget goes toward trains.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 11, 2025, 04:34:31 am
content: Quote from: MarkF on August 11, 2025, 04:28:01 amYOU DO NEED SOMENOW. AND IF YOU BUILD MODEL TRAINS WITH ELECTRONICS IN THEM, EVEN A TINY SELECTION OF JELLYBEAN PARTS WILL HELP YOU EXPLORE BETTER SOLUTIONS THAN STARTING WITH A DARLINGTON ARRAY AND START SHOUTING AT OTHERS WHEN THEY JUST WANT TO HELP BECAUSE YOU DON'T HAVE THE PARTS THAT WOULD SOLVE THE PROBLEM!I don't like shouting, so I'm out.

author: Someone
author_rank: Super Contributor
timestamp: August 11, 2025, 04:54:13 am
content: Quote from: MarkF on August 11, 2025, 04:28:01 amBut you will ask others to lend their time to you for free? and spend hours trying to work out a solution that could be solved by $10 of parts?Bad economincs.

author: MarkF
author_rank: Super Contributor
timestamp: August 11, 2025, 05:52:47 am
content: I've only proposed a challenge of a few minutes of someones time if they choose to accept it.No one is asking for hours of anyone's time. Just a few quick thoughts from their imagination.I had a working solution before even opening this topic and didn't want to skew anyones thoughts in the beginning.The train electronics were designed and built over 5 years ago and is 99% complete. It's not going to be changed!My challenge was very specific and limited in scope and must fit within the current system.It's frustrating repeating over and over what was contained in my first post:- my goal, all details and link to the signal being used, and the parts I would like to limit the design to.And after a while I'm going to get louder.I was looking to see if anyone would suggest a significant improvement over what I have.I want to thank those that proposed some interesting ideas.Apparently you will have those few rotten apples who just want to complain instead of contribute.It seems theyalwayshave time to complain.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 11, 2025, 06:24:32 am
content: Quote from: MarkF on August 11, 2025, 02:39:39 amBut you also confuse things by saying :I have 5 pins that are not being used that I want to leverage to drive 5 signals.Or did you mean 5 leds here, when you said 5 signals ?

author: magic
author_rank: Super Contributor
timestamp: August 11, 2025, 07:17:04 am
content: Quote from: MarkF on August 10, 2025, 08:25:47 pmWhat's the low output voltage from your ULN2003? If it's less than 0.7V it should be possible to remove one diode from the chain. I assumed it would be higher, but I may have been wrong. You could try with only one diode or replacing one or both diodes with schottkys (if you have those). That should make voltage across the 1kΩ resistor (and LED current) less dependent on enabled color.The difference in brightness may also be due to different efficiency, in which case there is no way around adding an external resistor (or other current limit) to the green LED.

author: magic
author_rank: Super Contributor
timestamp: August 11, 2025, 07:48:05 am
content: Quote from: MarkF on August 11, 2025, 02:56:13 amThis circuit looks like your problem with green LED is indeed about efficiency, not voltage drop.I wonder if it would help to add a large resistor (100k to 1M) between the green LED and NPN base. (That might also eliminate/reduce the need for an emitter diode).

author: PGPG
author_rank: Frequent Contributor
timestamp: August 11, 2025, 10:19:15 am
content: Quote from: MarkF on August 10, 2025, 08:25:47 pmThe green LED will not be noticeably brighter because of voltage drop at diodes used with red LED.Assuming ULN output being about 0.7V and green LED voltage drop 2V you get green LED current = (12-2-0.7)/1k = 9.3/1kFor RED LED (typical voltage drop 1.8V) with 0.7V drop for each diode you get (12-1.8-0.7-0.7)/1k=8.8/1k. It is only 5% less current.If you want to reduce this current for both diodes you should add resistor in serie with 1k.If your green LED is brighter than red one and you want to give it smaller current than into red than reverse the circuit and drive RED from ULN and green from diodes connected to GND (in this solution you can add resistor in serie with these diodes to make green current being substantially smaller than red current.

author: themadhippy
author_rank: Super Contributor
timestamp: August 11, 2025, 10:24:52 am
content: Pah all that piddling about,just chuck a spdt relay in there ,its minimal,only 1 part and the added advantage you can easily add separate current resistors to each led.

author: Zero999
author_rank: Super Contributor
timestamp: August 11, 2025, 11:33:05 am
content: Quote from: themadhippy on August 11, 2025, 10:24:52 amDon't be silly. That's a sensible suggestion, but the OP is too niggardly to buy a MOSFET, let alone a relay, which is much more expensive.Quote from: MarkF on August 11, 2025, 02:56:13 amThe problem is the transistor will always draw a certain base current, which powers the LED. This is why I suggested using a MOSFET, which doesn't have any gate current.A potential divider is required to ensured the voltage across the LED is too low for it to turn on, when the Darlington transistor switches off.Here's a simulation. I've modeled the Darlington output as a time controlled resistor (SW1) in series with a diode (Do). After one second SW1's resistance changes from 1R (estimated to be similar to the on resistance of a small transistor), to 1G (near enough open circuit).EDIT: Corrected text on schematic and .asc file.

author: Terry Bites
author_rank: Super Contributor
timestamp: August 11, 2025, 11:44:11 am
content: Tosh make a handy 500mA MOSFET array TBD62084xxx

author: MarkF
author_rank: Super Contributor
timestamp: August 11, 2025, 12:04:19 pm
content: QuoteRefer to the building blocks circuit presented in the first post:- I have 5 unused ULN2003 outputs.- I can drive up to 5 Evemodel Signal units (each w. red and green LEDs) if I buy another package of 3 units.- One pin per Evemodel unit.When I say "Signal", I mean a railroad trackside signal. Not electronic signal.If I want more than 5, I need to install another PCB capable of 30 outputs. As shown in my railroad hardware overview, I have the capability to have 3 Relay Output driver PCBs for a total of 90 ULN2003 outputs.QuoteI wired up the circuit as shown. The green LED is more than twice as bright as the red one when switched.The ULN2003 low output voltage is 0.6V to 0.7V. I didn't measure it exactly.This circuit I will spend more time investigating its possibilities.QuoteMy circuit does not function as I envisioned. I should have foreseen the interaction at the transistor base. The voltage at the common anode (the 1K resistor) varies between 2.6V or 3.6V depending on which LED is lit. I will try your suggestion of a large resistor between the green LED and the base to try to reduce the interaction with driving the base. Good insight here.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 11, 2025, 12:47:48 pm
content: Do they work ok at 5V? Then you could use 74hc595 shift registers (Can be chained for unlimited outputs) and control all the leds you want with only 3 pins.A cmos 4094 will allow 12V operation, but you'll need a logic level translator.Or even better, to avoid running individual wires to every lamp, you can add a flipflop to each light and chain them together.All you need is a dual D-flipflop, for example the very common 74hc74 (TTL, 5V) or 4013 (CMOS, 5-20V).You will notice that the data will be shifted and applied to every light, but if done fast, it shouldn't be noticeable.However, if you want to update the lights very often (For example, you could apply a pwm value for smooth visuals), the disabled leds will glow slighly.To overcome this, use a 74x374 flop, which adds output control, so you can turn all the leds off while updating, avoiding ghosting.Plus, the extra elements in the 374 allow independent outputs for the data signal and the led outputs, buffering the data signal for the next stage, unaffected by the led current.In any case, you can take advantage of the green led higher Vf and reduce the required outputs (I wouldn't bother if using the flipflop, it just adds more parts)If the Vf difference is too low, just add a diode:

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 11, 2025, 09:46:31 pm
content: Quote from: MarkF on August 11, 2025, 02:56:13 amInteraction is to be expected from something so simple.It just takes a few more parts, ( but still from your stock) and you can get fully independent and current regulated setpoints.R7 can be a regulated point, if you want this to be 12V immune.Addit: You can regulate VB using a reverse biased BE junction as a ~7-9V Zener (depends on your NPN's )Or you can use a VBE multiplier with PSRR null as a 'poor mans' regulator, still using 'standard parts'In 2nd attach, R10 causes 2.347V VB to drop ~ 18mV as VCC increases 3V, which mostly nulls the Vcc-Current variations.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 12:56:02 am
content: Quote from: PCB.Wiz on August 11, 2025, 09:46:31 pmFirst, I want to thank you for your interest and the time you have spent on this.Question: Would you build multiple copies of your design for each Signal on the layout?Before building something that complex, I would build a 2nd copy of my RR Relay Driver PCB giving me 30 more ULN2003 outputs and then using two pins have a more prototypical railroad signal with three states (red, green, and off). Refer to thehardware overviewI posted earlier.Thetrivial circuit I postedwith its limitations is the quick-and-dirty option. Unless someone with a creative imagination can improve its adjustability with minor changes or component rearrangement. If it starts to get complex, my existing generic I/O is expandable, it would add more complex control (via software) of the Signal unit, and it would make long term hardware support easier. Although I have built five copies of the circuit last week on a small breadboard, I haven't committed to using it yet. Or do I go the more flexible route adding another Relay Driver PCB.I can appreciate what members have suggested so far.However, their solutions are a major deviation from my current hardware design and philosophy for the layout.I've been doing my best to limit component choices, component count, and overall design scope with little success.It appears that we have flushed out my options.DO NOT spend hours over thinking this.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 01:44:50 am
content: Quote from: DavidAlfa on August 11, 2025, 12:47:48 pmThe Evemodel Signals will work down to 3V.However, my layout choice is that all relays and lamps be driven from 12V.My existing custom hardware provides for up to 3 possible Relay/Lamp Output PCBs. Of which only one is currently installed and its usage is nearly full. It's consists of 30 outputs from ULN2003 transistor arrays.For the moment I've been resisting adding a 2nd PCB to the stack up.In reality, a 2nd PCB is what I should be implementing instead fooling around with the quick-fix.My custom hardware with its capabilities for providing track power, block detection, and digital switch control is able to control a layout twice the size of my current one. Fully populated, my I/O design can drive the speed & direction for 30 track blocks and can switch 90 relays/lamps. More details and photos can be found inthe Model Trains topic. A photo of the current PCB stackup installation.

author: antenna
author_rank: Frequent Contributor
timestamp: August 12, 2025, 03:15:27 am
content: Just messing around at work, so I can't test this, but I think I figured it out.Resistors A and B are chosen so that they form a voltage divider at the voltage which produces your desired brightness for the LED on the right side and resistor C is chosen to provide the required brightness on the left side LED. Once the 2003 goes low, there will no longer be enough voltage at the right LED to stay on, while at the same time turning on the other LED. And if you don't have a diode to keep the left LED off while the right one is on, I saved your transistor for that. Use one of its junctions.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 03:21:29 am
content: Quote from: antenna on August 12, 2025, 03:15:27 amThe Evemodel Signal is common anode wired.You can not separate the two LEDs like that.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 12, 2025, 06:22:24 am
content: Quote from: MarkF on August 12, 2025, 12:56:02 amIt's always a trade off of parts count and interactions.This circuit adds a couple more resistors, no diodes needed, R12,13,15 can all be equal, for BOM simplicity. Here they are ~ 7x R16, not critical.R14 sets the high-led current (here RED) and R16 then sets the reduction from that set point for GREEN.

author: antenna
author_rank: Frequent Contributor
timestamp: August 12, 2025, 06:51:36 am
content: That is a neat circuit, but I worry about the off current in the green one. I have green diodes that are very bright at a tenth of that current.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2025, 07:26:49 am
content: Quote from: MarkF on August 11, 2025, 12:04:19 pmDid you try the circuit I posted above? It's just a few resistors and a transistor. R2 & R3 prevent Q1 from turning on due to the 0.7V from the ULN2003, when its output is on. R4 drives Q1's base when the ULN2003's output goes high. When Q1 is on, the voltage across the green LED (D1) is too low because the red LED's (D2) cathode is near 0V and so its anode will be well below D1's on voltage.It will drive the green LED (D2) with slightly more current than the red LED (D2), but I believed that was desirable, because the green LED is much brighter.The components surrounding SW1 (inside the dashed box near R2 & R3) are purely a simulator model for the ULN2003's output. The diode mimics the on voltage of the Darlington and SW1 is just a switch with an off resistance of 1G and on resistance of 1R.In real life, connect D1's cathode to the ULN2003's output.

author: magic
author_rank: Super Contributor
timestamp: August 12, 2025, 08:22:18 am
content: Quote from: MarkF on August 11, 2025, 02:56:13 amIt has occurred to me that this circuit may work better if you connect the 4.3k resistor to 12V rather than the common anode. Then you could make it 10k like all others because the exact value shouldn't matter very much. And of course a diode is needed in the emitter of the transistor to cope with ULN2003 output levels.

author: antenna
author_rank: Frequent Contributor
timestamp: August 12, 2025, 08:25:49 am
content: I could save you the trouble and just put this in the mail if you are in the US. Could probably make the trip on a postage stamp. Tested with 12v source and 0-12v 1Hz from sig gen. LED's switched nicely. Minimum input voltage for proper switching is 3.5v.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 08:34:28 am
content: Quote from: Zero999 on August 12, 2025, 07:26:49 amI started to but realized that you don't have any additional current limiting for the LEDs and they are totally overdriven at 12V. And doing so would add more parts than my current design.Sorry, I thought I got back to you on this.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 08:37:09 am
content: Quote from: magic on August 12, 2025, 08:22:18 amI believe I did connect the 4.3K to 12V instead of the common.I don't think the circuit works in that configuration. I will have to try it again.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 12, 2025, 08:47:39 am
content: Already too many parts, a 4013 costs 8 cents...

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 08:49:39 am
content: Quote from: antenna on August 12, 2025, 08:25:49 amI will repeat this one more time.Yes. Using a MOSFET was my first thought.However, I currently don't have any small MOSFETs.So, I started looking at what it would take to use a NPN transistor.This whole topic is intended to explore using a NPN and how simple it can be!Go ahead and build 10 more of them before sending them.This is not a one-and-done circuit.

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 08:57:52 am
content: Quote from: DavidAlfa on August 12, 2025, 08:47:39 amREALLY!Why in the world would I build a second I/O system that did the exact function as what I already built?And then worry how to integrate the two systems together.You talk like I'm starting from a blank page.

author: magic
author_rank: Super Contributor
timestamp: August 12, 2025, 09:05:54 am
content: Maybe there is a way to get rid of the diode?When green is on, the low 10k should limit red current to less than 0.1mA. That might be enough? If not, add a diode in series with it.When red is on, the forward voltage applied to green will be red forward voltage minus NPN Vbe. I think it will stay dark.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2025, 09:06:37 am
content: Quote from: MarkF on August 12, 2025, 08:34:28 amWhat current do you require?Is a single extra 10k resistor really too many parts?

author: MarkF
author_rank: Super Contributor
timestamp: August 12, 2025, 09:22:14 am
content: Quote from: antenna on August 12, 2025, 08:59:24 amThe key word here is: Optimization.Since I have a working circuit using only one NPN, I would say yes.And stop thinking one-of. To exaggerate, would you build more than 25 copies?At some point, I would abandon the whole prospect and revert to populating the current I/O system with a second Relay Driver PCB.Quote from: Zero999 on August 12, 2025, 09:06:37 amTo repeat a third time, the LED brightness appears to be correct at 1mA.Same answer as above for @antenna.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 12, 2025, 09:37:21 am
content: Quote from: MarkF on August 12, 2025, 09:22:14 amYour example has ~1mA thru red, and much less thru green.So the circuit needs a predictable way to control the two currents, as my 1T above does, and ensures it is Darlington compatible.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2025, 10:46:45 am
content: Quote from: MarkF on August 12, 2025, 09:22:14 amThen go with MOSFETs, or a hex inverter gate such as the CD40106. If it's a one off then I suppose it makes sense to use existing stock, but if you want many channels, then bite the bullet and order parts. It will work out much simpler and cheaper.https://www.ti.com/lit/ds/symlink/cd40106b.pdfQuoteThe current though D1 and D2 in my circuit is 0.72mA and 0.9mA respectively. The current is slightly higher through D2 because it has a lower voltage drop and the saturation voltage of Q1 is much lower, than the Darlington output stage. If the difference between current is unacceptable, then reduce R5 to 7k5 and add a 2k2 resistor in series with D2's cathode.EDIT:Do you have a stock of ULN2003?If you want 25 channels then four of them will give you three spare channels.