# Help - Show ADC value on Three Seven Segment Display

#### pauzan

Joined Mar 11, 2019
9
Hi, i'm trying to build a digital voltmeter using ATmega8535.
But i have the problem of interfacing the ADC value on seven segment.
i use ATMEL STUDIO 6 for coding and PROTEUS for the circuit.
Here i'm attaching the file.

#### Attachments

• 61.8 KB Views: 7

#### pauzan

Joined Mar 11, 2019
9
Seven segment display like this

#### Attachments

• 103.7 KB Views: 18

#### DickCappels

Joined Aug 21, 2008
6,789
You need to convert the ADC output to BCD and then convert the BCD to 7 segment.

You can use Atmel Application note AN204 for BCD conversion routines.
ttps://docplayer.net/20779161-8-bit-microcontroller-application-note-avr204-bcd-arithmetics-features-introduction-16-bit-binary-to-5-digit-bcd-conversion-bin2bcd16.html

Below is a link to a project that is a digital voltmeter based on the ATMEGA8, perhaps you can use some of it.
http://cappels.org/dproj/10_Bit_LED...ng_LED_Digital_Panel_Meter_Using_ATMEGA8.html

#### shteii01

Joined Feb 19, 2010
4,644
What is the range of voltages you are measuring?
Do you need decimal point?
How many digits do you need?

#### shteii01

Joined Feb 19, 2010
4,644
Notice the 7 segment display that Dick is using with ATmega8. He is using 7 lines to light up digit, and 4 lines to select which digit to light up. You do this fast enough and the eye will not notice any flickering.

This is important because your Proteus picture shows that you are using SAME 7 lines on all 3 displays, which means that all three displays will show the same digit.

#### JohnInTX

Joined Jun 26, 2012
4,354
Notice the 7 segment display that Dick is using with ATmega8. He is using 7 lines to light up digit, and 4 lines to select which digit to light up. You do this fast enough and the eye will not notice any flickering.

This is important because your Proteus picture shows that you are using SAME 7 lines on all 3 displays, which means that all three displays will show the same digit.
It looks like TS has it hooked up with the digit select transistors Q1-Q3 and Q1 is showing that its being driven by PB0. But it also looks like Proteus thinks that the digit commons are not connected to the collectors of the transistors or are specified as GND because even the unselected collectors are showing '0' as are all of the common pins on the digits.

#### shteii01

Joined Feb 19, 2010
4,644
It looks like TS has it hooked up with the digit select transistors Q1-Q3 and Q1 is showing that its being driven by PB0. But it also looks like Proteus thinks that the digit commons are not connected to the collectors of the transistors or are specified as GND because even the unselected collectors are showing '0' as are all of the common pins on the digits.
Thank you.

#### pauzan

Joined Mar 11, 2019
9
You need to convert the ADC output to BCD and then convert the BCD to 7 segment.

You can use Atmel Application note AN204 for BCD conversion routines.
ttps://docplayer.net/20779161-8-bit-microcontroller-application-note-avr204-bcd-arithmetics-features-introduction-16-bit-binary-to-5-digit-bcd-conversion-bin2bcd16.html

Below is a link to a project that is a digital voltmeter based on the ATMEGA8, perhaps you can use some of it.
http://cappels.org/dproj/10_Bit_LED...ng_LED_Digital_Panel_Meter_Using_ATMEGA8.html
the atmel application note AN204 URL could not open

#### pauzan

Joined Mar 11, 2019
9
What is the range of voltages you are measuring?
Do you need decimal point?
How many digits do you need?
0 - 30 V.
Yes, exampe: 30V shown as 30.0.
3 digits