0

I want to show progress on a wall using LEDs from data added in an Excel speed sheet.

I want to have about 20 different LEDs maybe more. Can this be done with an Arduino Uno?

12
  • 1
    You need to find out, if you can send data via Serial COM port in Excel via its macro language. I don't know and it would be out of scope here (since we are experts in Arduino, not Excel). If Excel is capable of that, there is no reason why it shouldn't work.
    – chrisl
    Commented Jul 6 at 20:49
  • 1
    Just googled it, if you write code in Excel VBA you can absolutely use a serial com port. So yes, it can be done
    – chrisl
    Commented Jul 6 at 20:52
  • 1
    Also, to light 20 LEDs you might need a multiplexer or decoder, as there probably aren't enough pins on an Arduino Uno for a one-pin-per-LED solution. Although, you could use an Arduino Mega, which has loads of pins - so you could have more than 20 LEDs (54 in fact) and still use a one-pin-per-LED solution. Commented Jul 6 at 22:32
  • 2
    We get pestered by the Stack Exchange bot if questions go unanswered. So @chrisl and Greenonline, please help out by making actual answers.
    – Nick Gammon
    Commented Jul 8 at 8:05
  • 1
    @NickGammon - I understand what you mean, but: D0 and D1 would be used by the serial port that the user needs; Every time I (or anyone) posts an answer it gets down votes by the (not so) mystery voter (we all know who it is); The question was about to be closed; The close vote limit needs to be increased from 3 to 5; The question was vague and/or broad, so an answer would have had to be long and rambling, thus it seemed better to offer a little partial guidance in the comments rather than no answer at all. I like trying to help but this particular site seems to have some issues, sadly. Commented Jul 8 at 9:43

1 Answer 1

2

This really is a question of two parts:

  1. "Can I communicate to the Arduino using Excel?", and;
  2. "How can I light 20 LEDs using an Arduino Uno?"

Considering each aspect in turn...

Excel side

To add to chrisl's comment, which (partially) explained the Excel side:

... if you write code in Excel VBA you can absolutely use a serial com port. So yes, it can be done

Arduino side

Pin supply considerations

On the Arduino side you would need a sketch1 that then reads the serial port and receives the info sent from Excel, decodes that data and triggers the LEDs correspondingly.

Also, to light 20 LEDs you might need a multiplexer or decoder, as there probably aren't enough pins on an Arduino Uno for a one-pin-per-LED solution - there are twenty pins, but you will be using two of them (D0 and D1) for the serial communications via the serial port/monitor. Although, as Nick mentions in his comment, you could still use the Tx and Rx pins for the LEDs, but they would flicker during any serial communications.

With respect to using a multiplexer or decoder (there are a lot of different avenues that you could take2), as Nick also suggested, you might want to consider a shift register (such as a 74595).

Please refer to Serial to Parallel Shifting-Out with a 74HC595, from whence the schematic diagram below was sourced, for more information:

Using two 74595 shift registers to power LEDs

Current considerations

Using additional circuitry would also help alleviate another, as yet unconsidered, issue which is current draw. Unless you use low current LEDs, you might find the Arduino Uno struggling to supply sufficient current to power twenty LEDs.

Each pin on the Arduino Uno can supply 20 mA. However, the overall current draw should not exceed 200 mA..! Considering that one standard LED (whatever "standard" is or means) draws between 10 and 30 mA, so going for the low side, you could/might be able to light 20 LEDs. Nevertheless, you are nearing the limit and may be pushing it under certain scenarios. Using external "buffer" circuitry would prevent your Uno (and/or the regulator) from heating up and/or overheating.

Alternative Arduino solution

However, you could use an Arduino Mega, which has loads of pins - so you could have more than 20 LEDs (54 in fact) and still use a one-pin-per-LED solution.


Footnotes

1 If you can write that sketch and then have issues, then you can ask a more focused question regarding the Arduino code. However, as it stands, aside from just asking whether it can be done (to which the answer is "yes"), your question is otherwise too broad (if you also want to know how to do it).

2 Other methods of multiplexing include:

  • Charlieplexing, which allows you to control (n2 - n) LEDs with n pins, with little or no additional hardware/ICs. With 18 pins you could control 308 LEDs, although current supply issues would obviously arise, and need to be resolved.
  • Using a TLC 5940, 16-channel LED driver (which can be chained)

See also How can I effectively drive multiple LEDs with multiplexing?

2
  • 1
    LED matrix, I2C strips, Neopixels?
    – Juraj
    Commented Jul 10 at 4:49
  • 1
    Comments have been moved to chat
    – Juraj
    Commented Jul 14 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.