Temperature sensor

Thread Starter


Joined Dec 10, 2011

i am doing a lil project of my own, i would like to control the speed of the motor based on measured room temperature using PIC16F84A. so far i would like to use LM35 as the sensor, can someone help me with how to interface LM35 with PIC16F84A, the motor drive circuit using PWM, the clock speed for MCU. thanx


Joined Jan 16, 2008
Does it have to be a PIC16F84 microcontroller or conversely does it have to be a LM35 temperature sensor?
The two devices are not really compatible, the output of the LM35 is a varying DC voltage so you need a AtoD converter to convert it to a temperature reading and the PIC16F84 is one of the few PICs that does not have a AtoD converter built-in. No doubt you could use an external AtoD but it would be much easier and a lot cheaper to choose a more modern PIC that has an internal AtoD.
On the other hand you could still use the PIC16F84 and go for a temperature sensor that has the conversion function built-in such as DS18B20.


Joined Feb 19, 2009
I'd suggest a new uC as well.

A 16F88 has an ADC module, and 8Mhz internal Oscillator (freeing up 2 I/O pins)

Otherwise, it is pin compatible with the 16F84

Newer low pin count (<=28) PICs with more peripherals such as the 16F690 and 16F1827 have a lot of peripherals and memory, but to somebody new to PICs, you may have more problems disabling all of those features to use it as a basic uC.

If you don't have on already, I'd suggest a PICKit 2 from Microchip (not a clone) for programming. The PICKit 3 is also an option, but as of now, the PICKit 2 has more features, especially if working with mostly the mid-range PICs.


Joined Jan 16, 2008
If you do decide to go for a newer chip than the PIC16F84 you may as well get one that is specifically designed for driving motors and uses the "Advanced PWM" module. It incorporates motor drive features such as half-bridge/full-bridge drivers, programmable dead-band delay and auto shut-down.
For a low pin count chip take a look at the PIC16F684 or for something with a bit more I/O see the PIC16F1826 and the PIC16F1827 chips.