This can be a complete project on its own - a simple DIY digital thermometer with 7-segment displays and only a handful of parts - the PIC16F88, LM35 and a small number of resistors and capacitors running off a regulated 5v supply.
Temperature range - 0 to 150'C
Display type - 3 digit multiplexed 7 segment or 3 individual 7 segments
Controller: PIC16F88
Programming Language: BASIC
Compiler: mikroBASIC PRO for PIC v3.20
Complete code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
program DigThermo
'Programmer: Syed Tahmid Mahbub
'Compiler: mikroBASIC PRO for PIC v3.20
'Target PIC: 16F88 - 18pin DIP
'Configuration: XT OSC, PWRTE OFF, WDT OFF, RA5 - MCLR OFF, BOR OFF, LVP OFF, CP OFF, CPD OFF, DEBUG OFF, CKMNE OFF, INTEXTSW OFF
dim data7, num7 as byte
dim temperature as longword
dim digit as byte[3]
sub procedure send7 (dim value, seven as byte) 'Common Anode Displays (2 7segments)
PORTA = 0
select case value
case 0 data7 = $C0
case 1 data7 = $F9
case 2 data7 = $A4
case 3 data7 = $B0
case 4 data7 = $99
case 5 data7 = $92
case 6 data7 = $82
case 7 data7 = $F8
case 8 data7 = $80
case 9 data7 = $90
end select
PORTB = data7 'send temperature
select case seven
case 1 num7 = 2
case 2 num7 = 4
case 3 num7 = 8
end select
PORTA = num7 'choose which 7segment
end sub
sub procedure GlobInit
TRISA = 1
TRISB = 0
PORTA = 0
PORTB = 0
ANSEL = 1 'AN0 analog
CCP1CON = 0 'PWM off
CMCON = 7 'Comparator off
end sub
sub procedure delay2ms
delay_ms(2)
end sub
main:
GlobInit
while true
temperature = (ADC_Read(0) * 500) >> 10
digit[0] = temperature div 100
digit[1] = (temperature div 10) mod 10
digit[2] = temperature mod 10
send7(digit[0],1)
delay2ms()
send7(digit[1],2)
delay2ms()
send7(digit[2],3)
delay2ms()
wend
end.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Schematic:
The code can be freely used and there is no copyright restrictions or anything as such. Only credit the author where necessary.
Hex file can be freely downloaded from:
http://www.4shared.com/file/o-OBjgGB/DigThermo.html
Tahmid,i am shrinidhi.ilike ur blog.
ReplyDeletei am working on a control sys, that senses temperature & humidity.
i plan to use 16f877 for this, is it okie??
it's an academic project..wish to complete within 2 months.
Will be of great help if you can guide on this.
Tahmid, i am using an LM34 instead of an LM35 for a project on my own. I was wondering how you would change the code in order to be able to use the LM34 instead of the LM35. Thanks alot.
ReplyDeleteHey tahmid, can u help me in making a project report on this project.. I used your code and it worked perfectly... Thanx a lottt... Hopin for a quik reply
ReplyDeleteI am so sorry for the late reply. Had my exams and so was very busy.
ReplyDeleteAnyways, if it isn't too late, Sabi, what kind of help do you want from me? I'll try to help if you can clarify your project.
Shrinidhi, if it isn't too late, I might try to help.
Tahmid,
ReplyDeleteLike Shrinidhi, I also plan to use pic 16f877 for the project ... will it work?
thanks,
You can use 16F877, but it has a different pin-out, so you cannot use it as is (obviously). Plus the code needs to be recompiled with changes for 16F877.
ReplyDeletehey guys, can you show me how the circuit looks like in reality because i'm having problems with my experimental part... or can someone tell me a site where i can find it.
ReplyDeleteThanks for sharing information about Digital Thermometer. Digital Thermometer
ReplyDeleteHallo!
ReplyDeleteI've build the temp meter circuit but can't figure out the connections correctly from the resistors,
I can see it starts to work but the 7 segments do not show up correctly.
Any advice?Chris email hollybrand@telkomsa.net
This comment has been removed by the author.
ReplyDeleteHi Tahmid!
ReplyDeleteThat's a great project. I'm newbie in PIC programming, but I would like to build this circuit with minor modifications such as using internal oscillator instead of XT and temperatur range -55 to 150 C. How can i modify the source code?
Anyway, is it possible to build this project using 16F886 instead of 16F88 with 2 LM 35 sensor and 2 x 3 digit 7 segment display?
Thanks for advising.
Zsolt
ReplyDeletehi dear its very nice and very helpful post for those who are new and thinking to start a blog site.Your posts are very helpful and creative clik here and see how to dc 24 volt to ac 220 volt instalation of inverter
Can we convert this temp indicator program in bad out put instead 7 segment . Please write
ReplyDeleteThanks
This design is spectacular! You most certainly know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Excellent job. I really loved what you had to say, and more than that, how you presented it. Too cool!
ReplyDeletepipe cladding
Gud Morning.... Your Blog is Awesome, An infrared thermometer is a thermometer which infers temperature from a portion of the thermal radiation sometimes called black-body radiation emitted by the object being measured. Thanks for sharing.....!!!
ReplyDelete........................................
Best Infrared Thermometer
I love this blog. Thanks for sharing...
ReplyDeleteDigital Thermometer Wholesale
nice
ReplyDeleteI appreciate you for giving such an informative portal on digital thermometer
ReplyDeleteNice Blog. I think Digital Thermometeris very useful now. It can be used for checking the body temperature. This blog gives an Idea about Thermometer
ReplyDeleteThanks admin for sharing such wonderful content on this topic. Now I have got everything I need to know. Here’s another informative content for those who want to buy Voltage Output Pressure Transducers, analog and digital transducer. I personally used there services and I really had a great experience with the kind of work they provided.
ReplyDeleteNice Blog. Thanks for sharing. Romsons is a one-stop destination for all your essential medical needs, we guarantee you must-haves you need to stock at home for general well-being and a healthy living. With Manufacturing Excellence of 70+ Years, Romsons is a name that Doctors trust. We provide Adult Diapers, underpads, baby wipes, mask 95, digital thermometer etc. if you need Digital Termometers visit us www.Romsons.in
ReplyDeleteThanks for sharing this informative blog, I was looking for such blog from a long time.
ReplyDeleteNoshok pressure transducer