Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need c code for displaying temperature in 7 seg led

Status
Not open for further replies.

smitgovani

Member level 2
Joined
Dec 25, 2011
Messages
50
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,641
i m using j thermocouple nd 8051 uc... i want to display temperature in 7 seg led...
 

You want then show.
72048d1333590172-thermocouple-interface.png


---------- Post added at 01:50 ---------- Previous post was at 01:45 ----------

See this for interfacing LCD with microcontroller attached to an ADC.(Assembly and C both) https://www.edaboard.com/threads/217541/
 

thanx a lot...
i m using adc0808..
and i have code which takes in digital data and send it to max 232...
but i dont no why they have done?
void main()
{

unsigned char sensor=0,reading;
P1=0;
initSerial();
usDelay(50);
while(1)
{
ADD_C=0;
ADD_B=0;
ADD_A=1;

latch();
startConv();
wait();
get();
reading=P2;
sendReading(reading);

}
}
void sendReading(unsigned char val)
{
unsigned char l,m;
l=val%10; // why this done??
m=(val/10)%10;
// why this done??
sendChar(aray[m]);
sendChar(aray[l]);
sendChar(',');
}
 

That was done to seperate digits of a number.
Suppose val contains 123.
now,
l=val%10; // l will contain 3
m=(val/10)%10; //m will contain 2

Generally this is the process to display digits of a number on lcd or seven segment display or to send data serially. In absence of whole code not possible to comment.

---------- Post added at 03:16 ---------- Previous post was at 03:09 ----------

publish the sendChar(unsigned char ) function.


I didnt forget the last digit. I just told him what his code is doing. He asked for it.
 
Last edited:

That was done to seperate digits of a number.
Suppose val contains 123.
now,
l=val%10; // l will contain 3
m=(val/10)%10; //m will contain 2
l=3
m=2
but which will display 1....
should i need to take 1 more variable
then what should b its formula??
 

Hello!

l=3
m=2
but which will display 1....
should i need to take 1 more variable
then what should b its formula??

I think papunblg wrote the general idea to extract each digit. Yes, he forgot the last one.
But can't you guess the next step by yourself?
In plain arithmetic, how would you extract the "1" from "123"?
Hint: % is the remain of the division by something. Therefore 123 % 10 is 3.
And the integer division yields : 123 / 10 = 12.

Dora.
 

ya right.....
is it
(123/100)%10
am i right???

and given above amplification ckt what will be o/p range of it??

and a last can 8bit adc transfrer 3 digit analog data??
 

and a last can 8bit adc transfrer 3 digit analog data??

ohh yes got it we r transmitting digits seperately.....

---------- Post added at 11:02 ---------- Previous post was at 10:50 ----------

i m using ad594 amplifier ic and which will give 0mv to 8181mv......can i use this?
and then to adc0808
then to AT89c51...
 

i think you can't use more then 5000mv as input to adc0808 you have to use voltage divider to make your max input to adc 0808 or you can use 5v zen er diode to clamp voltage to 5v.
 
i can't clamp...
then what should we do...i can't clamp so i have to use devider .....then circuit will b complicated ( thermocouple to amplifier ad594 to voltage devider then adc0808 then 8051)

---------- Post added at 11:32 ---------- Previous post was at 11:31 ----------

can i directly use thermocouple to adc0808
o/p range is 0 to 42.283mv......

---------- Post added at 11:33 ---------- Previous post was at 11:32 ----------

can i directly use thermocouple to adc0808
o/p range is 0 to 42.283mv......

---------- Post added at 11:34 ---------- Previous post was at 11:33 ----------

or any amplification ckt which gives o/p till 5000mv....???
 

i think as per ad594 datasheet you can set or mange your amplified output from 5v to 15v so you can set your IC in such way that your max will be +5v

if you want amplifier you can use circuit suggested by mr. papunblg in early post .
 

Hello!



I think papunblg wrote the general idea to extract each digit. Yes, he forgot the last one.
But can't you guess the next step by yourself?
In plain arithmetic, how would you extract the "1" from "123"?
Hint: % is the remain of the division by something. Therefore 123 % 10 is 3.
And the integer division yields : 123 / 10 = 12.

Dora.
No , I didnt forget the last digit. I just told him what his code is doing. He asked that

---------- Post added at 12:01 ---------- Previous post was at 11:51 ----------

i can't clamp...
then what should we do...i can't clamp so i have to use devider .....then circuit will b complicated ( thermocouple to amplifier ad594 to voltage devider then adc0808 then 8051)

---------- Post added at 11:32 ---------- Previous post was at 11:31 ----------

can i directly use thermocouple to adc0808
o/p range is 0 to 42.283mv......

---------- Post added at 11:33 ---------- Previous post was at 11:32 ----------

can i directly use thermocouple to adc0808
o/p range is 0 to 42.283mv......

---------- Post added at 11:34 ---------- Previous post was at 11:33 ----------

or any amplification ckt which gives o/p till 5000mv....???

You can directly use the thermocouple! Considering the resolution I told you to use the Amplifier.
The most common thermocouple types are J, K, and T. At room temperature, their voltage varies at 52 µV/°C, 41 µV/°C, and 41 µV/°C, respectively. Other less-common types have an even smaller voltage change with temperature. This small signal requires a high gain stage before analog-to-digital conversion.

.


---------- Post added at 12:09 ---------- Previous post was at 12:01 ----------

Type J thermocouples produce 0 mv at 32 degrees F and approximately 42.9 mv at 1,400 degrees F.
See https://www.ehow.com/about_6631388_j_type-thermocouple-information.html

What do you think?

---------- Post added at 12:23 ---------- Previous post was at 12:09 ----------

Check this https://www.omega.com/temperature/Z/pdf/z203.pdf

Another solution:-

Use MAX31855

**broken link removed**

---------- Post added at 13:06 ---------- Previous post was at 12:23 ----------

i think as per ad594 datasheet you can set or mange your amplified output from 5v to 15v so you can set your IC in such way that your max will be +5v

if you want amplifier you can use circuit suggested by mr. papunblg in early post .

AD594 is a good choice. You can use this as ud23 suggested.
 
Last edited:

what will be o/p voltage range of that circuit shown by mr. papunblg ???
and is my answer was right?? (123/100)%10 from above shown

---------- Post added at 20:40 ---------- Previous post was at 19:57 ----------

https://www.5bears.com/circuits.htm#circuit 02
Circuit 02: A simple Thermocouple Amplifier
i think i can use also this...which gives o/p from 52.79mv to 2.209v
i have checked in proteus 7.6..
can i???????
 

As mentioned in the page it can be used as a simple Thermocouple Amplifier.

It has gain roughly 100. For 52.79mv input , the output will be nearly 5.279 Volt.

Keeping it simple, your 10 bit ADC will output maximum value at 5 volt. That means when the amplifier gets 50mV. So, using that gain of the amplifier your circuit will be able to show maximum temperature at which the Thermocouple gives 50mV. (Approx rage 0 deg C to 860 DegC)

For typical metals used in thermocouples, the output voltage increases almost linearly with the temperature difference (ΔT) over a bounded range of temperatures. For precise measurements or measurements outside of the linear temperature range, non-linearity must be corrected.

An ideal linear response and the response of a Type J thermocouple over the range of 0 to 150 °C.

---------- Post added at 21:55 ---------- Previous post was at 21:51 ----------

For Accurate & precise measurement outside linear range
see How do you convert J-type thermocouple voltage to temperature using NIST polynomials? http://www.home.agilent.com/upload/cmc_upload/All/5306OSKR-MXD-5501-040106_2.htm?&cc=IN&lc=eng

---------- Post added at 22:04 ---------- Previous post was at 21:55 ----------

http://srdata.nist.gov/its90/download/type_j.tab

---------- Post added at 22:08 ---------- Previous post was at 22:04 ----------

:lol: Hope these will help you
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top