Ancestors

Toot

Written by Electronic Eel on 2024-04-20 at 22:39

Common problem: the microcontroller I selected has just one GPIO less than I would normally need.

I want to use a nice RGB side LED and drive at least the red and green part (and full off), but I've just got one pin on the MCU for this. I know Charlieplexing, but it is just something for two or more pins.

Here is what I've come up with: Use a TL431 as comparator to differentiate between low/HiZ and high.

[#]electronics #protoboard #analog

=> View attached media | View attached media | View attached media

=> More informations about this toot | More toots from electronic_eel@treehouse.systems

Descendants

Written by Electronic Eel on 2024-04-20 at 22:39

The way it works is like this:

To light up green the input on the left is pulled low. The reference input of the TL431 is below 2.5V, so it doesn't conduct.

When the input is in HiZ, the 3.3V supply voltage passes through the green LED. This reduces the voltage to about 1.5V. This is still below the threshold of the TL431, so both LEDs are off.

When the input is at 3.3V, the ref of the TL431 is above the threshold, so it pulls it's cathode input down to about 2V. It needs at least 1 mA supply through the cathode to work, so I supply it through R37. It can't be supplied just through Q7 because it begins to pull a bit current before the threshold is reached and we don't want Q7 to be turned on just yet. R36 is needed because the ref input will sink current once you crossed the threshold and that needs to be limited.

When the TL431 is turned on and pulls low it's cathode, it pulls current through Q7 which then switches on the gate of Q8, switching on the red LED.

The LED I'm using is in a common-anode configuration, so I need the extra stage with Q8. This wouldn't be necessary for LEDs that have both pins individually pinned out.

=> More informations about this toot | More toots from electronic_eel@treehouse.systems

Written by Mike P on 2024-04-20 at 23:00

@electronic_eel What kind of proto board is that?

If that's a 0.1 inch grid then the holes must be pretty small...

=> More informations about this toot | More toots from FenTiger@mastodon.social

Written by Electronic Eel on 2024-04-20 at 23:07

@FenTiger the protoboard is my own design: https://github.com/electroniceel/protoboard

the holes are 2.54mm grid and still fit regular pin headers (I think 0.8 or 0.9mm holes). In between the holes I got additional pads to allow fitting 1.27mm pitch parts directly onto the protoboard. Though I didn't need that here.

I used a protoboard with ground option on the bottom side for convenience here.

=> More informations about this toot | More toots from electronic_eel@treehouse.systems

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/112305947447195265
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
277.914153 milliseconds
Gemini-to-HTML Time
1.28089 milliseconds

This content has been proxied by September (ba2dc).