Making a LED series resistor value calculator

Hey everyone! I've done some googling but "arduino LED calculator" hasn't returned anything really helpful.

I'm looking to setup an UNO with a 12 digit keypad and a 16x2 display. The unit will be a simple calculator that will inject the user's answers to a few questions into my formula and output the correct resistor value to use in series with a LED.

I'm hoping someone can point me to some code for a similar project(s) so i can learn by modifying and adapting it to my needs!

please let me know if i should be more specific!

Thanks! :)

I suspect it hasn’t been put on a website because it is such a simple task.

There are probably some similar projects out there. I don’t know what words I’d use to look for them, either.

How much experience do you have with Arduino programming? You pretty much just need:

Text to LCD to ask for input
Wait for input from the keypad
Calculate the answer
Display on the LCD

So, start working on those tasks.

polymorph: I suspect it hasn't been put on a website because it is such a simple task.

LED calculator for single and parallel.

yeah, such a simp task... but this is one of many!

Thanks for the replies guys!

Yeah, I know it's a pretty simple task which is why I think it'll make a great uhh... reintroduction project! lol. it's been about a year and a half since the last time i experimented with arduino but look at my previous posts, they can give you an idea of where i was as far as experience.

And I know they exist online, but this device will be mounted in our LED isle to help customers select the correct resistor based on the supply voltage and the current requirements of the led they choose.

i understand the "mechanics" of the program. for the most part i understand what, where, and when things need to happen, im just a little rusty on the language and format required to translate the concept in my head ya know what I mean? thanks for listing the main functions out though! as obvious as they may seem, i probably would not have done that and i think recognizing the main parts in that way will help me stay a little more (mentally at least!) organized and efficient as i develop those parts.

there may not be one good answer to this post but i can probably assemble something from the various insights you guys might provide! anything helps and is much appreciated.

Resistor = (Vsource - Vf(led) - Vdrive transistor)/desired current Example: Vsource = 5V Vf = 2.2V typical for Red LED Vdrive = Vce of NPN transistor, or Vds of N-channel MOSFET, used as low-side switch Vdrive could be the VOL of the Arduino chip for example.

ah! that is how you calculate the value for use with a transistor+arduino output?

Sweet, I'll try to incorporate that into the calculator as that is also a pretty useful bit of info!

(5V - VOH) and (VOL - 0V) of Arduino are a little different, so you need slightly different calculations for Sourcing current into Anodes vs Sinking current from cathodes.