I want to merge two projects: a "Don't touch your face" hat for Nano and a 7-segment 4-digit display for Uno. I tested both independently and they work. I added an RGB LED to the first, so I use 6 digital pins: 2 for the ultrasonic sensor, 1 for the buzzer, and 3 the RGB LED.

The Nano project takes 6 digital pins and no analog pins, leaving 4 digital pins and 8 analog pins. The Arduino Uno takes 12 digital pins. So I suppose that it's possible to replace the digital pins of the Uno with analog ones at the right voltage.

Even without the Nano project claiming 6 digital pins, the Nano only has 11 digital pins (D2-D12), not enough for a 7-segment 4-digit display. But I couldn't find a tutorial online on how to do so.

Is it possible to use a 7-segment 4-digit display on Arduino Nano?

  • 1
    The "Don't Touch your face hat" uses only three I/O pins (D10-D12), and the 7-segment sketch appears to use 12 (D2-D13). A0-A7 are the same exact pins as D14-D21, so you have plenty of digital I/O. Change the hat sketch to use D14-D16 instead of D10-12, test again with the two separate sketches with all the hardware, then try to combine the code and post your code attempt.
    – Dave X
    Commented Nov 11, 2021 at 19:31
  • 2
    Uno and Nano have nearly the same pinout. Both have D0-D13 and A0-A5 (all can work as digital pins as the analog function of A0-A5 is just additional functionality). Excluding the Serial pins we have D2-D13 and A0-A5, so 12+6=18 pins. I cannot see the hat project (since I don't have an account there), but if we take the 3 pins that DaveX mentioned and the 12 for the 7 segment display we get 15 pins. You have enough pins.
    – chrisl
    Commented Nov 11, 2021 at 20:46
  • 1
    @chrisl I can't find D0, D1 and D13 on my nano, which are they? Yes, if A0-A5 can serve as digital pins, then it's simply a replacement of pin numbers. The Uno code compiles and uploads to Nano, so I'll try this simple replacement tomorrow.
    – emonigma
    Commented Nov 11, 2021 at 20:54
  • 1
    D0 and D1 are marked as TX and RX since this is connected to hardware serial. D13 is on the same side with A0, right at one end of the header next to the 3.3V pin.
    – chrisl
    Commented Nov 11, 2021 at 23:02
  • You can try to use a shift register.
    – xyz
    Commented Dec 22, 2021 at 13:34

1 Answer 1


There are chips such as the MAX7219 designed to control 7 segment displays from devices such as an Arduino, there are also some well-established libraries such as LEDCONTROL to drive them. In fact the MAX7219 doesn't have to drive 7 seg displays, you can use it to drive any collection of up to 64 LEDs, I use one for a simple illuminated Christmas tree. You'll need some basic soldering skills to connect the chip to an Arduino but it's very simple.

E.g. see: https://www.maximintegrated.com/en/products/power/display-power-control/MAX7219.html

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.