Arduino Nano and HP5082-7433 vintage 7-segment LED display

Arduino Nano and HP5082-7433 vintage 7-segment LED display

I have to admit, I created this 7-segment display project not because I needed a visual output for my next Arduino project but simply because I have a really soft spot for those whimsical big-eyed miniature LED displays. Some 20+ years ago I have hand-soldered hundreds of these little displays at one of my first jobs and seeing these displays come to life was always a big relief – it meant that the device was working. But I digress…

In any case, despite the fact that these HP5082-7433 LED displays are rather hard to come by these days, they are still available from online sources such as eBay and they are a great match for any MCU-based project that requires visual output, especially indoors. They pack 3 digits that are big enough to be seen from anywhere on the desk and yet fit inside a breadboard-friendly DIL-12 package (15.37mm x 6.35mm). They are very easy to drive due to the very small forward currents and the rest of this post is about how to do just that

You can see more data about the part in the HP5082-7432/7433 7-segment LED Display Datasheet but some of the most important data is the current needed to light a segment – given the right ambient light, you can see the output at 250μA . It’s therefore not a surprize that these little displays were used in watches and battery-powered calculators back in their heyday. It means that the highest load digit – “8” – will only draw 3.25mA and you can both source and sink enough current from Arduino Nano’s digital output without overloading the Arduino.

Arduino Nano + 7-segment HP5082 LED display - simplest circuit

Arduino Nano + 7-segment HP5082 LED display - simplest circuit

Arduino Nano + 7-segment HP5082 LED display - circuit that reads out Pot value

Arduino Nano + 7-segment HP5082 LED display - circuit that reads out Pot value

One of the important features of this circuit was going to be its simplicity and therefore some sacrifices were made. For example, you would normally have 8 current limiting resistors, one for each segment anode. That would make each segment’s current equal to that of the next which, in turn, will make all digits equally bright. In this case I only used 3 resistors – one for each common cathode. All anodes comprising one digit therefore share one limiting resistor and so the digit “8” that has 7 segments is less bright than digit “1” that has only two. Also, the 220Ω limiting resistor is only working properly with digits having 5,6 or 7 segments. The rest of the digits are having their segments lit with currents higher than needed. So, you’re welcome to improve this circuit by eliminating the 220Ω current limiting resistors in the common cathode lines and use 8 (7 if the digital point is not used) 510Ω + in the anode lines instead.

Breadboarded Arduino Nano and HP5082-7433 7-segment LED display

Breadboarded Arduino Nano and HP5082-7433 7-segment LED display

One other characteristic of this circuit is the large number of Arduio’s output lines used. Nano has 14 digital outputs. From those we are using 8 for the anodes (even though the digital point is not used in the software I include here – another improvement direction) and 3 for the cathodes. So, there are 3 digital outputs left for either activating other types of outputs or making a 6-digits display by adding the second HP5082-7433 if all the rest of Arduino connections in this project are inputs.

So, to finish with the hardware part of the project, here is how the breadboard looks like (left). It’s a pretty simple circuit that can be thrown together in 5 minutes or less.

Now to the software part. There are two different sketches attached here – one is for the simplest circuit that has no inputs whatsoever and only counts from 0 to 999 (in a loop). The other one is for the circuit with a 5KΩ linear potentiometer which has its wiper (middle contact) connected to Arduino’s Analog Input 0 and its other contacts to ground and +5V respectively.

Arduino sketch for counter using 3-digit 7-segment LED display with common cathode

Arduino sketch for outputting analog read value to a 3-digit 7-segment LED display

Basically, the heart of the code is the show(value) subroutine. You can copy it into your own program and call it every time you need to output a 3-digit decimal value. The code can be adapted to showing hexadecimal values by adding few more encoding values (for digits A-F) to the digits array. Decimals only are coded here:

byte const digits[]={

Please note that the cathodes are hooked up to digital outputs D8,9 and 10 in the reverse order. D8 is cathode 3 and D10 is cathode 1. If you have different digital outputs used, don’t forget to change this line:

int digit_common_pins[]={8,9,10};

I’ve seen several implementations of seven segment output using Arduino and many are using delay() function to light the current digit long enough for the eye to register before moving to the next. I think it’s pretty unfortunate because during that time Arduino cannot do anything else – cannot scan buttons or read analog values because it’s essentially paused. In my code I made sure that the scanning functionality does not actually lock the processor up for the duration of the cycle. It’s then free to service all the other functional elements of your project.
Here is the full code of the program reading the analog value and outputting it in 3-digit decimal version:

Directly Driving a small 7-segment LED display with Arduino. Tested on vintage HP5082-7433 micro LED displays
A sample Arduino sketch by
 Pin assignments:
 D0 - a
 D1 - b
 D2 - c
 D3 - d
 D4 - e
 D5 - f
 D6 - g
 D7 - dp (digital point)
  *      *
f *      * b
  *  g   *
  *      *
e *      * c
  *  d   *
  ******** # dp
 D8 - cathode 3
 D9 - cathode 2
 D10 - cathode 1

byte const digits[] = {
int digit_common_pins[]={8,9,10};
int analogPin = 0;
int val=0;
int refresh_delay = 5;
int count_delay = 100; // COUNTING SECONDS IF count_delay = 1000
long actual_count_delay = 0;
long actual_refresh_delay = 0;
int increment = 0;
int max_digits =3;
int current_digit=max_digits-1;
int increment_max = pow(10,max_digits);

void setup(){

  DDRD = B11111111;
  for (int y=0;y<max_digits;y++)
    digitalWrite(digit_common_pins[y], HIGH);    


void loop() {

  if(millis() - actual_count_delay > count_delay)

    actual_count_delay = millis();
    val = analogRead(analogPin);    // read the input pin




void show(int value) {
  int digits_array[]={};  
  int y=0;
  boolean empty_most_significant = true; 

  if(millis() - actual_refresh_delay >= refresh_delay)

  for (int z=max_digits-1;z>=0;z--)

    digits_array[z] = value / pow(10,z); //rounding down by converting from float to int
    if(digits_array[z] != 0 ) empty_most_significant = false;  // DON'T SHOW LEADING ZEROS
    value = value - digits_array[z] * pow(10,z);

    if(!empty_most_significant || z==0){ // DON'T SHOW LEADING ZEROS EXCEPT FOR THE LEAST SIGNIFICANT
      PORTD = digits[digits_array[z]];
      PORTD = B00000000;  

     digitalWrite(digit_common_pins[z], LOW);
     digitalWrite(digit_common_pins[z], HIGH);


      if(current_digit < 0) 
        current_digit= max_digits; // NEED AN EXTRA REFRESH CYCLE TO CLEAR ALL DIGITS
 actual_refresh_delay =  millis();     


4 Responses to “Arduino Nano and HP5082-7433 vintage 7-segment LED display”

Leave a Reply

Or use the Forums ! If your comment is a question, please consider posting it to a matching section of our Electronics Forums. The forums allow for a more natural conversation flow, especially if multiple replies are required. Additionally, you'll be able to style your writing (bold font, italics etc.) and post images which can help with a good answer.

Notify me of followup comments via e-mail. You can also subscribe without commenting.


Coming soon ...

Recent Comments
  • Joshua Donar: Would you happen to know where the driver is for the CT10L drive is? Haven’t been able to locate...
  • Albert: Hello Thank you for sharing Tell me please meaning D4 zener. Meaning the role in this schematic. Looks like...
  • Will: I also aquired a scorbot 3 without a controller and in my spare time I have been developing a simple servo...
  • YamZYang: Hello, I learned alot from here. I have a question about the H-bridge motor driver, are there any special...
  • John: I’m trying to use this code to rotate a 14-pole, 12-slot BLDC motor. However, I’m getting some very...
  • admin: The signal is most definitely a square wave of varying width. Its resulting torque might look like a sine wave...
  • Andrei: Hi there, Great article. Really helps to explain the BLDC control. I was thinking of a way to control a BLDC...
  • Albert: Hi, because you switched with 120 ° phase shift, if the electric phase shift between phases of the animation...
  • Axel Vercauteren: I’m pretty sure this is an AF issue. In 1.01 Quick AF is enabled by default (See Set...
  • Ankit Lohani: I have to use DRV8332 to control my BLDC motor. Can you provide me a link where i can get the link...