Multiple current inputs, or alternative way to control resistance to one output. - Page 1
Forum section: electronics / beginners

author: raybreezer
author_rank: Newbie
timestamp: June 15, 2020, 07:23:43 pm
content: Hello, first post here, hoping for some direction.I have a circuit I am building that will control multiple LEDs with a series of Shift Registers. I know what resistance values I will need (220 ohm or 470 ohm) for half of the LEDs, but the project I am working on may require different resistors for the second half.I am looking for a way to have two sources coming in from either resistor and have the microcontroller determine which it should use. I've been looking at different types of gates, but it seems to me that logic gates wont work for this as there doesn't seem to be a way to determine which source I want to use.I've also been looking at transistors which seem to be closer to what I am looking for, but I would like to default to the highest resistance I am anticipating needing.I'm sure I don't need to explain that I am fairly new to electronics, but please don't think that I would shy away from looking for the information myself. I just need to know what I'm looking for and which component would fit my needs.

author: Renate
author_rank: Super Contributor
timestamp: June 15, 2020, 09:59:01 pm
content: Let's step back a bit.Is what you want is a bunch of LEDs that you can have at two different brightness levels (and off, presumably)?There are some LEDs that can control brightness themselves under digital control, those RGB 5050'sYou can use duty cycle and multiplexing to dim LEDs too.Probably having two sources and two resistors per LED is not the most parts efficient way to do this.The other thing to bear in mind is that 1/2 the current is not "1/2 the brightness" to your eyeball.It's probably closer to 1/8 the current is "1/2 the brightness".

author: raybreezer
author_rank: Newbie
timestamp: June 16, 2020, 12:51:44 am
content: Quote from: Renate on June 15, 2020, 09:59:01 pmI apologize, I should have explained that better.The reason for the two resistor values is due to not knowing the voltage requirements of the LED being used. Some might be nano LEDs, others might be 5mm. I wanted to figure out a way to allow the resistance to be set programmatically while making the default state something that would be safe for either LED.

author: Renate
author_rank: Super Contributor
timestamp: June 16, 2020, 12:05:32 pm
content: Well, 20 questions. I still have 19 left.Is this device a test jig for LEDs?You could use a constant current source, even read out the voltage if you wanted that.

author: Ian.M
author_rank: Super Contributor
timestamp: June 16, 2020, 12:29:54 pm
content: There are dedicated ICs for that! Google:SPI constant current LED driverMost of them use a single resistor to set the max. LED current and can cope with any LED (or LED string) Vf up to their max output voltage rating.

author: raybreezer
author_rank: Newbie
timestamp: June 16, 2020, 07:55:59 pm
content: Quote from: Renate on June 16, 2020, 12:05:32 pmThis is (in its simplest form) a controller for a model. The reason for the multiple LEDs is because the model will have 40 LEDs, but, the model actually comes with 20 which is why I know what those values need to be, but the other 20 are added in by whoever will build the model.

author: raybreezer
author_rank: Newbie
timestamp: June 16, 2020, 08:07:29 pm
content: Quote from: Ian.M on June 16, 2020, 12:29:54 pmWOW! That looks perfect! Not only that, but it also looks like it gives me better control over the LEDs rather than using the shift registers! Thank you! I'm going to definitely look into this.

author: wizard69
author_rank: Super Contributor
timestamp: June 17, 2020, 05:19:45 pm
content: LED control is pretty common, thus there is a wide array of controllers available from various manufactures, so don't stop looking at the first controller you find. One or more is likely to be the perfect fit.