Microprocessor with one 1 input 3 outputs

Thread Starter

Hugo100

Joined May 6, 2022
4
Hi Everyone!

I would like your advice on which microprocessor I should use to turn on an RGB LED (basically one color at a time) based on the input value (voltage)?
Note: input value range will change in decimals. Thank you.
 

SamR

Joined Mar 19, 2019
5,031
Welcome to AAC!

Sounds to me like a good job for an Arduino Nano. If you are familiar with uP programming, power, inputs and outputs then an ATtiny or ATmega depending on how much I/O is needed. At least 1 Vin and 3 Vout would work in the dip8 tiny.
 

dendad

Joined Feb 20, 2016
4,451
I agree with @SamR as to the Arduino.
While the PICs would be good (I use them too), the cheapest and easiest is the Arduino as it comes with the built in programmable ability while the PIC will need a programmer as it is a steeper learning curve. Also, the PIC will need a PCB.
Arduino Nanos are available fot around $5 or $6 and the programming environment is free. Another advantage is the huge community of example programs and help sites.
 

upand_at_them

Joined May 15, 2010
940
Would help to know what programmer Hugo has available. I would also agree with SamR, since it doesn't require programming hardware and the programming environment is free. Arduino also lends itself better to those new to programming micros.
 

Jon Chandler

Joined Jun 12, 2008
1,029
Opinions are like....well, you know the rest.

If you haven't coded using the Arduino IDE, the learning curve can be pretty steep (my opinion). As a possibly easier alternative, let me suggest Swordfish Basic and any of a number of PIC18F-series micros. The Swordfish "special edition" is a free version with generous limits, to the point where many users never upgrade to the paid edition.

If you've ever used Visual Basic, Swordfish is very easy to learn and use. As to the hardware, Microchip has some compatible boards that include a programmer, but for this application, not much circuitry beyond the PIC is needed. In this case, you would need a programmer – I recommend a PICkit 2 clone from ebay and the free updated version of the GUI programming software. I'll dig up a link if anybody is interested. The GUI is easy to use and there is no reason to use MPLAB-anything.
 

Ian0

Joined Aug 7, 2020
9,667
Hi Everyone!

I would like your advice on which microprocessor I should use to turn on an RGB LED (basically one color at a time) based on the input value (voltage)?
Note: input value range will change in decimals. Thank you.
LM339 comparator.
Why should it need a microprocessor?
 

Ya’akov

Joined Jan 27, 2019
9,069
Could you explain the problem you are trying to solve? What will the device be used for?

Application has a big impact on choosing a part.
 

dendad

Joined Feb 20, 2016
4,451
Why should it need a microprocessor?
Because it is easier and fully changeable.
I've used discrete logic for some projects but a micro like an Arduino is just so easy to uses and modify as needed.
There is really nothing wrong with a comparator setup but the micro will use less bits too I reckon.
 

Ian0

Joined Aug 7, 2020
9,667
Because it is easier and fully changeable.
I've used discrete logic for some projects but a micro like an Arduino is just so easy to uses and modify as needed.
There is really nothing wrong with a comparator setup but the micro will use less bits too I reckon.
That would depend on a lot of things we haven’t been told.
Is the power supply <5V? if not it needs a regulator plus 2 capacitors.
How much output current is required? A processor would Need output buffers for >5mA, an Lm339 can output 16mA.
Otherwise it’s LM339 plus 4 resistors vs. processor plus programming socket, about 35p for the LM339 and its resistors, and they are a lot easier to get than microprocessors at the moment!
 

dendad

Joined Feb 20, 2016
4,451
That would depend on a lot of things we haven’t been told.
Is the power supply <5V? if not it needs a regulator plus 2 capacitors.
How much output current is required? A processor would Need output buffers for >5mA, an Lm339 can output 16mA.
Otherwise it’s LM339 plus 4 resistors vs. processor plus programming socket, about 35p for the LM339 and its resistors, and they are a lot easier to get than microprocessors at the moment!
Yes for some of the above, particularity if you were to try to build it yourself.
To build something, a board of some sort is needed. Then probably a regulator and caps. A resistor for each LED and more for the voltage dividers for the inputs. A voltage reference, ...

But I regard the Arduino Nano as a component as I can buy one cheaper than the parts
It has on board regulator, and on a PCB already.
Arduino DC current per pin 20mA so can drive he LEDs via resistors ok.
Programmed via the USB connector from a free IDE.
So, all that is needed is the RGB LEDs, the pot and 3 resistors.
And as there would be a micro involved, the program could be easily made to mix the colors, flash them, timeout....
Then, if you want even cheaper, and complete overkill, use a Raspberry Pi Pico.
 
Top