Tuesday, 24 August 2021

AVR with 7-segment display

Experience connecting a 7-segment display with ATMega16


Two 7-segments are to be connected to display the two digits of temperature.

No multiplexing is needed. Simple one GPIO pin driving one segment.

Common cathode i.e., all LED segments have a common ground. Only one resistor before GND should be OK instead of putting one for each LED. As long as it can handle the 'total current/power' generated when all LEDs are on.

There are two grounds on the 7-segment. As per this link, only one GND needs to be connected to ground. Both grounds are shorted internally. Actual test supports this.

Which resistor and where

5V--->LED-->Resistor-->GND

  • Observation after playing with 300-600 ohm resistors. LED lights good even when current is ~3mA.
  • 5V from AVR GPIO, LED eats ~2v, 1K resistor eats ~3v. Actual measured were close to this.
  • Current ~3mA for 1 LED.
  • We have a requirement for only 7 segments. The 8th dot is not needed.
  • Total current (when all 7 LEDs are on) = 21 mA.
  • Total power = I^2*R = 21*21*1*10^(-3-3+3) = 0.441 W.
  • Final: One resistor (1K ohm, 0.5W power rating) at GND.
  • If 8th dot is needed, minimum power rating required would be 0.576W.
  • In production, even higher power rating should be chosen (at least 2* minimum required).










No comments:

Post a Comment