PC digital I/O without MCU
PC Analog Input without MCU
Arduino Oscilloscope for PC
Arduino OLED Oscilloscope
Arduino Picture Frame
OLED Bitmap Arduino / PIC
OLED Arduino Counter
OLED Timer Thermometer
OLED Frequency Counter
Android Oscilloscope
OBD2 Engine Rev Counter
OBD2 Diagnostic app
TFT Clock and Thermometer
WiFi, Ethernet
WiFi Thermometer
WiFi ESP8266
Doorbell with SD / EEPROM
SD FAT16/32 for .bmp
PETIT FAT bmp Display
TFT Timer, Thermometer
TFT Oscilloscope
SD Talking Clock
Android Talking Clock
SD Sound Recorder
SD FAT32 wav Player
SD Arduino Recorder
LED Thermometer
LED Timer
LCD Timer
TFT 10MHz Counter
100KHz Counter For PC
1MHz Counter For PC
8 Digits LED Counter
Scope Screen Counter
LCD 16 x 2 Counter
LCD Arduino Counter
6MHz Android Counter
NIXIE Android Counter
Bluetooth Counters
USB Counter
USB TFT display BMP
USB DS18B20 Sensor
USB Thermometer
USB Meter
USB Oscilloscope
USB Input-Output
USB Input-Output Android
USB 16x2 LCD
Serial TFT Text
Serial Inputs Outputs
Serial Port LCD
MCP3201 on Serial Port
Serial Thermometer
Analogue Signal to Serial
Serial Thermostat
MCP3201 on LPT
Analogue Signal to LPT
LCD Display on LPT
Water Softener
HP Stream 7 docking
3.7V to 5V
Solar Charger
Infrared Decoder
PIC Music
Code Lock
Code Lock with LCD
HOME   Technical Tips


Updated on 17/01/2016 (a and b segments were swapped on drawing)
Counter based on PIC16F628A . Included C code and circuit diagram. Displays -55 to 125 centigrade.
The temperature is read every 15 seconds, can be changed in the code. The math is using integers to calculate the degrees and the tenths of degrees are calculated separately.
The 7 segment LED is common cathode, 4 separate digits can be used with segments a to g linked.

You are free to use the circuit diagram and the software with no limitations.


Thermometer based on PIC16F628A and DS18B20 digital sensor. Included C code and circuit diagram. Displays -55 to 125 centigrade. The temperature is read every 1 second. The math is using integers to calculate the degrees and the tenths of degrees are calculated separately.
Output at pin 3 can be used for driving a relay that is on when temperature is higher than alarm setting. It can be used as a thermostat or an alarm for over temperature. To set the alarm press SET for 2 seconds, then press DEGREE to set the alarm, then press SET again. 
The OLED module is a 0.96" 128 X 64 pixel driven by I2C interface and using SSD1306 driver IC. The OLED display uses low power LEDs and suitable for battery operated. Power can be reduced farther by reducing contrast.

You are free to use the circuit diagram and the software with no limitations.


Circuit Description
See also Technical Tips

LED Thermometer
All transistors are BC337 or equivalent.
Total 5V supply current is 90mA.
The 4 digits display is common cathode, the 7 resistors of 220 ohms enable current of 15 mA for each segment which is on for 25% of the time. The seven segments, a to g, of one digit are linked to the corresponding seven segments in the other digits.
Segment e is connected differently because RA4 is an open drain output.
The 4 digits are multiplexed by pins 6-9 that drive the common cathodes cc1-cc4.
DP is the decimal point.
DS18B20 can be any type.

OLED Thermometer
Pushbuttons are NO
DS18B20 can be any type.
OLED module can be bought from ebay: https://www.ebay.co.uk/itm/0-96-I2C-IIC-Serial-128X64-White-OLED-LCD-LED-Display-Module-for-Arduino-UK/192294699203?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649


Comments and questions

Copy the number from the picture It stops net-robots from adding comments.

02.04.2020 - 10:13
Name: mkirat
Comment: evet

23.12.2019 - 00:28
Name: Moty
Comment: Hi Manoochehr, The sensor (ds18b20) has typical error of +/-0.5 , max +/-3 . If the error is the same for the whole range then you can add a line to the code to subtract 1.5 , or you can try to change the sensor, most sensors are within +/-0.5

22.12.2019 - 18:48
Name: manoochehr
Comment: hi/this thermometer shows 1.5 degree upper.please tell me what is wrong ?

28.02.2019 - 20:30
Name: Fabio Jesus
Comment: Thank you!!

09.01.2019 - 09:48
Name: heidari
Comment: Thank you very much

24.12.2017 - 13:59
Name: Moty
Comment: Yes, -55

23.12.2017 - 17:49
Name: Manoj Soorya
Comment: Is this unit shows the Minus (-) Degree ?

18.06.2016 - 12:25
Name: Moty
Comment: Try another LED display.

17.06.2016 - 22:15
Name: Adalto
Comment: Amigo simulando no proteus Isis ele não funciona! Fica aceso os 4 display e o seguimento "d" fica piscando e não muda de estado. Me ajuda , obrigado.

17.02.2016 - 11:21
Name: Moty
Comment: If you have basic knowledge of mikroC you'll be able to correct the errors. Most errors are the delay macro.

16.02.2016 - 16:17
Name: seed
Comment: I need code in micro c

30.01.2016 - 17:36
Comment: Hi again, I finished and run it. Nice work but values are higher 2-3 degrees. I changed 4 pieces of 18B20 all the same. Can I set it "c" program lines etc? Thanks and regards..

23.01.2016 - 18:34
Comment: Here's the results: 0 1 mikroCPIC1618.exe -MSF -DBG -pP16F628A -DL -O11111114 -fo4 - 6 304 error: Can't open include file "htc.h" #include 1 error in preprocessor. C:\Users\serkan\Desktop\led_thermo\led_thermo.c 0 122 Compilation Started led_thermo.c 26 300 Syntax Error: ')' expected, but '&' found led_thermo.c 113 424 '}' expected '}' found led_thermo.c 109 1163 Variable 'ret' has been declared, but not used led_thermo.c 114 1503 Result is not defined in function: 'reply' led_thermo.c 114 312 Internal error '' led_thermo.c 0 102 Finished (with errors): 23 Oca 2016, 19:29:21 MyProject ser.mcppi

23.01.2016 - 14:58
Comment: I'm going to try. Some beta ones doesn't to let compiled.

22.01.2016 - 21:00
Name: Moty
Comment: Why didn't you answer my question? You can edit the code with XC8 compiler, you can download it from Microchip. You can also use MPLABX or download old Hi Tech from the archive on their website. Google what you need and you will find it.

22.01.2016 - 17:24
Comment: I think you fed up me..But I cannot compile the files. I don't have hi tec c. I've only mplab and how to use it correctly. I could'nt add a,b,c,f to no. "7" and add to -a- digit for "6" and -d- digit to "9" for more readable. Need help.. Thanks a lot..

22.01.2016 - 17:09
Name: Moty
Comment: It took you less than 12 minutes to solve the problem, that's quite fast. By the way, is it a project for school or you have an interesting use for it?

22.01.2016 - 11:17
Comment: Terribly sorry. We've just find the problem. It was sourced pcb drawing. İt's working now. Thanks again..

22.01.2016 - 11:05
Comment: Your .hex files are faulty/broken. Not working. Tried for many times. Also other guys tried. But unfavorable..

17.01.2016 - 22:46
Comment: Ok. Thank you..

17.01.2016 - 21:11
Name: Moty
Comment: You will enjoy it more if you try it yourself. The answer is 0b1000111 I corrected the drawing today the a and b were swapped.

17.01.2016 - 17:49
Comment: Last question if possible. I'd like to add "f" digit to number "7". At present ...digit[7]=0b111; Must I write like this:...digit[7]=0b111001; or digit[7]=0b10100111.

17.01.2016 - 17:30
Comment: Thank you very much for soonest reply. I'm going to assemble it. Nice work..

17.01.2016 - 01:06
Name: Moty
Comment: Yes, reduce the 1200 to a smaller number to get shorter time.

16.01.2016 - 15:32
Name: serkan karaaslan
Comment: Hi, It'S a very nice circuit. Besides I'd like to shorten read time like 5-6 seconds. "display(1200); //display for 15 seconds" From here or etc? Thanks a lot..

03.01.2016 - 16:25
Name: sheco bab
Comment: very good

03.01.2016 - 16:24
Name: sheco
Comment: very good

moty22.co.uk  2008-2021