I'm doing this conversion and I have a problem. I must convert from 0°C to 30°C, and I know that the LM35 bring me 10mv/°C. Therefore, if the temp=30°C, the Vout=0,3V=Vmax. I amplify this output with the LM741 with a gain G=16,7, because like this my Vmax=5V. The output of the OPAMP goes directly to the ADC0804.

My question is: How do I do to show the temperature value in two display BCD 7-seg? What's the combinatorial circuit that I need to build? I don't know how to pass from binary to BCD and also use only 5 bits to goes from 0 to 32.

• Why not use a ADC that has direct segment output instead? – Ignacio Vazquez-Abrams Jul 22 '17 at 21:37
• Perhaps this old-school-painful exercise provides incentive for a more modern microcontroller solution. – glen_geek Jul 22 '17 at 21:38
• The LM741 requires relatively high voltages to work. It also can't move its output to within several volts of V+ or V-. You need a better opamp. – Transistor Jul 22 '17 at 21:41
• @glen_geek i need to work like this. its for a university work. i know is much easier with PIC or other stuff. – sarquis88 Jul 22 '17 at 21:49
• @Transistor the OPAMP works fine, that's not the problem – sarquis88 Jul 22 '17 at 21:49

My first response is that you should probably move up to a more modern approach to this project. Using LM35's and LM741's is technology that is about 35 years old. You can do a lot better and much more simply that messing around with the likes if these ancient analogue parts.

Research digital temperature sensors that have an I2C interface using just two digital signals. There are a plethora of candidate chips to use for this and they will provide you a wide range measurement capability often with resolution down to 0.125 degrees.

The temperature sensor with the I2C interface is then connected to an MCU of your choice. The display is in turn connected to the MCU and software takes care of reading temp values from the sensor and sending the values formatted to the display. Again there are scads of MCU choices and display choices can range from LED segment, LCD character or OLED graphic.

How do I do to show the temperature value in two display BCD 7-seg? What's the combinatorial circuit that I need to build? I don't know how to pass from binary to BCD and also use only 5 bits to goes from 0 to 32.

I had a rummage around the various image searches and drew a blank. All the BCD to seven-segment display drivers are 4-bit input devices. You could use combinational logic (NANDs or NORs) but it would get ridiculous.

Since you have the first bit working and are happy with it and maybe want to use this as a learning exercise, a simple solution would be to use a micro with 16 or 18 GPIO pins. You could use eight to read the AD0804, seven more to drive the segments of the seven-segment displays and two more to drive the common cathodes or anodes.

For even more fun you could reduce the I/O count to nine or ten, depending on whether you want decimal point display too. (You don't in your case.) This comes at the cost of seven or eight resistors.

(Your requirement is for 5-bit to dual seven-segment display without decimal point so modify accordingly.)

simulate this circuit – Schematic created using CircuitLab

Figure 1. The micro is configured to read the AD804 outputs in between strobing the seven-segment displays.

With the addition of R1 to R8 you may be able to economise on GPIO pins on the micro - to keep the size down and learn some more.

Pseudo code:

disable(GPIO8);                 // Tristate the seven segment common driver pin.
disable(GPIO9);                 // As above.
input(portA);                   // Configure port A as inputs.
delay(1);                       // Stabilise.
msd = t \ 10;                   // Most significant digit. (Integer division.)
lsd = t % 10;                   // Least significant digit. (Modulo arithmatic.)
output(portA, sevenseg(msd));   // Configure port A as outputs and setup
the seven-segment display pattern.
output(GPIO8, 1);               // Strobe the first digit.
delay(x);                       // Give it some time to excite the retina.
output(GPIO8, 0);               // Turn off 10s display.

output(portA, sevenseg(lsd));   // Repeat for units display.
output(GPIO9, 1);
delay(x);
output(GPIO9, 0);
loop;


It does what you want with only one chip and some code.

• A downvote without a comment? – Transistor Jul 23 '17 at 2:02

One approach might be to scale the input with a bit less gain so you get 0-150 for 0-30C. You can then convert the binary number (with an added LSB of 0) to BCD (using something like the add-3 algorithm), and convert each digit to 7-segment (the most significant digit can have simplified logic if it only needs to display blank or 0, 1 and 2- and maybe 3 depending on whether you consider the spec to be inclusive of the end point.)

Consider how to deal with over range and consider implementing ripple blanking, so you display 0.0 for 0C, 10.0 for 10C, rather than 00.00 and 010.0 respectively.

If the logic eludes you for 7-segment look at the gates inside, say, an SN7447 (old TTL part).