Saturday, August 30, 2014

LM35 Simple Thermometer Circuit with LCD - 16F818


In modern world, analog equipment and device are converting in to digital format. To do this mostly used sensors. There are many cool sensors available now days, ranging from IR distance sensor modules, accelerometers, humidity sensors, temperature sensors etc. but many of these sensors are analog in nature. That means they give a voltage output that varies directly (and linearly) with the sensed quantity. For example in LM35 temperature sensor, the output voltage is 10mV per degree centigrade. That means if output is 300mV then the temperature is 30 degrees. Or else, if the temperature changed one degree then its output voltage varied by 10mv.

In this post, I show you how to build temperature sensor (Thermometer) circuit easily. It uses the PIC 16F818 micro-controller, LM35 temperature sensor and a 16x2 LCD.

LM35 Temperature Sensor Schematic Diagram
Schematic Diagram


The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ' Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of 1/4°C at room temperature and 3/4°C over a full -55 to +150°C temperature range. It can be used with single power supplies, or with plus and minus supplies.

  • Calibrated directly in Celsius (Centigrade)
  • Linear + 10.0 mV/°C scale factor
  • 0.5'C accuracy guarantee-able (at +25°C)
  • Rated for full -55° to +150°C range
  • Operates from 4 to 30 volts


The LM35 outputs an analog voltage proportional to the temperature. This analog voltage then read by the PIC and processed to display the corresponding temperature value on the LCD. The PIC ADC module does the analog to digital conversion. The PIC MCU’s ADC gives us the value between 0-1023 for input voltage of 0 to 5v. So if the reading is 0 then input is 0v, if reading is 1023 then input is 5v.In the code, I have used the mikroC library function for ADC.

The temperature range for this circuit is 0°C to 150°C.
You can download project files form below and it used MikroC


    LM35 Temperature Sensor
    Copyright (C) 2015 Scorpionz

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <>.

  >> Email:
    >> Web  :


char temp;

void main()
OSCCON= 0x70; // 8MHz internal osc
TRISA = 0x01; // AN0 input
TRISB = 0x00;
PORTA = 0;
PORTB = 0;



Lcd_Out(1, 3, ".:SCORPIONZ:.");
Lcd_Out(2, 2, "Temp is 000.0ßC");

while(1) {

temp = Adc_Read(0)/2.048;

Lcd_Chr(2, 10, ((temp/100)%10 +48));
Lcd_Chr(2, 11, ((temp/10)%10  +48));
Lcd_Chr(2, 12, ( temp%10      +48));

Friday, August 29, 2014

Simple LCD Spectrum Analizer Demo Circuit - 16F628

Spectrum analyzers are widely used within the electronics industry for analyzing the frequency spectrum of radio frequency, RF and audio signals. Looking at the spectrum of a signal, they are able to reveal elements of the signal, and the performance of the circuit producing them that would not be possible using other means.

Audio spectrum analyzer shows you a detailed picture of what you are hearing in real-time, that is, as it happens. You can easily built very cheap spectrum analyzer circuit using below diagram. However, this is not a real-time and it is just a visualizing model. But this work as real one and you can add this to your audio projects to get a nice appearance and add extra value for it.

You can able to download MikroC source and other files from the below link

Simple Spectrum Analizer circuit
Schematic Diagram of Analyzer

Thursday, August 28, 2014

Digital Combination Lock Circuit with Keypad and LCD - 16F628

Digital Lock
Digital Lock

Now day’s ordinary locks are replace with digital locks. Those have very advanced features such as digital display, keypad, fingerprint recognized etc. Therefore, I decided to build basic digital lock with LCD display and keypad.

This is a micro-controller based digital lock circuit and it used PIC16F628A. 16x2 LCD is used for the display information and keypad is used for enter the code. (#) will clear the code and (*) will enter the code to initialize process.

Default code for this lock is 2468 and this code was stored in device Eeprom memory. You can change the default code by changing value of device Eeprom memory. Address 1 for first number, Address 2 for 2nd number, so on. You can change Eeprom value from zero to nine.

Digital Lock circuit
Schematic Diagram of Digital Lock

Lock code = Eeprom Address 1 & …. & Eeprom Address 4

Eeprom Address 1=3,  Address 2=1,  Address 3=0,  Address 4=7 then,
Lock code  =>  3 & 1 & 0 & 7  => 3107

Eeprom Address and lock code
Eeprom Address and lock code

Wednesday, August 27, 2014

Scrolling Seven Segment Display Circuit - 16F628

Scrolling Seven Segment Display preview

Many electronic hobbyists are very much interested about build scrolling displays. Most of the time this circuits used matrix displays. However, its cost is high and almost complex to build. Therefore, I try to build a scrolling displays circuit using the seven segments displays because these are cheaper than matrix displays and we can be easily build circuit. This circuit is very simple.

To build this circuit I used PIC16F628A micro-controller and four common cathode seven segment displays. To save micro controller's pin and reduce the cost I used internal oscillator. Massage on ‘scrl_txt’ array will run continuously. You can change the length by changing the value of ‘scrl_len’ according to your text.

A seven-segment LED display is an special arrangement of 7 LED elements to form a rectangular shape using two vertical segments on each side with one horizontal segment on the top, middle, and bottom. By individually turning the segments on or off, numbers from zero to nine and some letters can be display, but we cannot display all characters. However, it is possible to display all the numbers and many characters. See below picture to recognized how seven segment displayed characters.

Seven Segment Characters
Seven Segment Characters

In this picture, you can see some characters like K, M, V, W, X and Z cannot displayed properly. If you need to display all the characters then you need to use 14 or 16 segment displays instead of seven segments. To use this type of display you need to modify the firmware and circuit.

Scrolling Seven Segment Display circuit
Schematic Diagram of Circuit

In Proteus diagram, I used NOT gates to connect the Seven Segment and micro controller. However, in practical you have to use NPN transistor such as 2SC1815 or transistor array IC such as ULN2003 instead of NOT gates. When you are using transistor do not forget to add resistor 1k-10k between micro-controller and base of transistor.


on line


Recent comment


Free counters!
Copyright © 2012 - Scorpionz™.,All rights reserved | Powered by Blogger