Take an 8 bit binary code and show it on two 7 segments

Hello, I'm trying to make a thermometer and to show the temperature on two BDC 7 segments. I have an ADC0808 that can transform the temperature into a binary code on 8bits. I search for a circuit to transform this binary code so it could be shown on the BDC 7 segments, and arduino seems to be he best option, but I never use it. I don't know wich kind of arduino I should use for this project and how to code it. If someone can help me, it would be great.


Since it would take 8 pins to read the A/D converter the Arduino UNO would not have enough pins left over to directly drive 14 segments. You could use an Arduino MEGA 2560 or you could skip the Arduino completely and use two BCD-to-7-Segment Decoder/Driver chips.

You could format the 8 bit result as 2 to 3 decimal digits, and send that number to a serial seven segment display.

Thank you the two of you for taking time to look at my post. I already try the BCD-to-7-Segment Decoder/Driver chip, but because we have to show the temperature between 0 and 99 celcius, it's not really useful, we cannot seperate the binary code to show it on two BCD. And I look for codes, but the one that I found are counter and I don't know how to modify them so that they would just convert the binary and not count.

And for the 7-Segment Serial Display, how can I format the 8 bit code to show it on two digit :confused:

Thank you again

If you have to use the components you have listed, it looks like you need 8 digital inputs for the ADC0808 and 8 digital outputs to drive the two BCD 7 chips (4 each). Is this correct?

If that is the case, you should be able to put the ADC0808 on the 8 analog inputs on an UNO and define them as digital outputs, and use 8 of the regular digital I/O pins for the BCD 7s.

It's almost that, but I need to show the temperature on two digit, so it would take me 14 outputs, one for each of the segments of the two digits I think.

If I am reading this spec correctly then there are only four inputs on that chip - A, B, C and D. The table on page 3 translates what to set those inputs to to get a particular number on the outputs.

Sara: It's almost that, but I need to show the temperature on two digit, so it would take me 14 outputs, one for each of the segments of the two digits I think.

I think you have got off on the wrong foot here. Throw away the ADC0808 and use the internal A/D in the Arduino. Then multiplex the two displays to get your display. An Arduino Uno will do just fine.

Look at the countdown code and instead of the bit that counts down the number replace it with the reading you get from the internal A/D.

Perhaps list exactly what parts you have already with a link to their datasheets. Do you have to use these parts or are you open to substitution?

Unfortunatly, it's part of school project and the adc0808 is an obligation, the digit are an extra part. :confused:

Then it is a stupid assignment or one not designed to use an Arduino with. In either case I am not sure why you are posting here. Why did you not mention this in the very first post?

This is the datasheet for the adc0808. I made a circuit where I can read the temperature in binary with the code of the adc0808 that I display on 8 leds. The part that I have difficulties is to change that binary code to put it on two digit


I post here because I'm searching solutions and I will not neglect anything. I tought it was a good idea because I need something that take the inputs and transform it in the appropriate outputs. The chip that was doing this doesn't exist anymore, so prog seems to be a good option.

You are right I should have put this information at the beginning. :0 :(

The list of what you have?

Excuse me, yes the list, I have:

-Adc0808 -Lm555 ( and the other component for the clock of the Adc0808) -Thermistor -resistor (for the voltage divider with the thermistor) -BCD common anode or cathode -Leornado (It's the one that I can bought in the store)

With the school, I have access to a large inventory of pieces, but not to "exotic "

Have a look at the bitshift reference for how to turn your 8 bits from the ADC into a number that you can work with in each code. For each digital input from the ADC (starting with the Most Significant Bit), add it to a byte value (0 = LOW, 1 = HIGH) and then left shift it one position. Do the same with the next digital input and repeat until you have all 8 bits loaded. You will then have a byte value between 0 and 255 which corresponds to the reading from the ADC.

One you have that reading, you need to convert it to a temperature. The exact conversion formula will depend on your thermistor. There’s a tutorial here on using a thermistor which uses the Arduino’s 10 bit analog inputs which give you a reading between 0 and 1023.

As @Grumpy_Mike stated, you are using an external ADC that has less resolution than the one built into the Arduino.

what is the aim of your project? Do you want to display the temperature as a two digit number in degrees in decimal?

If so that chip would have been no good for you because it would only display an 8 bit binary number as two hex characters and it would only give an indication of the voltage from the thermistor not the temperature. The chip you would need between the A/D and the display is a 256 by 8 bit read only memory, you need to program it as a look up table that takes the output reading of the A/D is translated into the two seven segment patterns you need. In effect it is a lookup table.

I used to be a professors at a University ( in the UK this is known as a lecturer not a professor in the UK a professor means something different ) and I know students often misunderstand instructions given to them. I can't believe you have to use the ADC0808 chip if their is an alternative which will actually allow the job ( what ever it is ) to be done. So go back and ask your teacher if you can use an Arduino in place of your A/D chip, because not doing so is stupid.

Thank you to you, but I already see my Teacher and this is an oblogation, If it wasn't, I would have change for the arduino. Thank you for the bit shift, I will find something that will work, I started à code yesterday that I think could do the job. I can show it if someone want to see it.

but I already see my Teacher and this is an oblogation,

So you can tell your teacher from me that he is an idiot, and knows very little about what education means.

Maybe your teacher wants you to use two 256x8 ROM/PROM/EEPROM chips, each driving a 7-segment display. The A/D chip would provide an 8-bit address to the two ROMs and that would look up the right segments for any of the 256 possible bit combinations. That way you could provide any mapping between A/D output and two digit display. I guess a single 256x16 ROM would work, too.