Want a cool project for your PIC microcontroller? Read on!




In this article, I'll show you one way to make a wireless thermometer using two PIC microcontrollers. One microcontroller, the PIC16F688, will measure voltage from an LM34, convert it to an ADC value, and transmit some data. The receiver will receive the data, and display a message on an LCD.

Sending data with the 433MHz transmitter is easy: in my case, I connect the PIC TX pin to the 433MHz data pin, then the transmitter sends whatever comes out the UART pin.

But receiving the data is the far more difficult part. The receiver will receive everything in its range. To sort out the data we want, we need some sort of protocol or error correction. In previous articles, I have used an Arduino with the VirtualWire library, and I have used a "synchronizing" string in another. In this article, I'm using another technique (this site inspired me). Now, I'm adding parity check to the transmitted data. The parity is being checked at the receiver end. While doing research for this article, I found a site with a VirtualWire library for PIC's. One drawback I found, however, was that this library filled almost all my PICs memory.



We need 2 block diagrams, one for each circuit.

The transmitter:

I want:

  • A way to program the microcontroller -> ICSP
  • A sensor to measure temperature -> LM34
  • A microcontroller to process the data -> PIC16F688
  • A way to transmit the data -> 433MHz RF TX module

The receiver:

I want:

  • A way to program the PIC16F877A
  • A way to receive the RF signal -> 433MHz RF RX module
  • A way to process the received data -> PIC16f877A
  • A way to display a message -> 2x16 LCD


Schematic diagrams:






In the pictures below, you will see a MAX232 IC. This is added for debugging.

Unused pins are not tied to GND or to a testpad. None of the schematics are for production, they are for breadboard only.


Parts list




When the program runs, it reads the voltage from the LM34. This voltage is converted into an ADC value. This value is then calculated to temperatures in both Fahrenheit and Celsius. According to a few if-sentences, a value is transferred to the uart_write-function. This function checks if the value is valid, and transfers it to the uarttransmit- function. This function adds parity to the data, and sends it out to the TXREG.

This type of transmitters send all the time when power is applied, which results in interference with other wireless appliances working in the same  frequency range. Garage door openers and remote controlled ceiling fans might not respond correctly when the transmitter is on. To deal with that, I turn the transmitter on when it is transmitting and off when it is not transmitting. 


The receiver picks up all kinds of signals and noise. The software has some debugging code and a MAX232 to see what's happening in a terminal window. When a signal is picked up, the value is checked for Framing Error bit. If the value has a framing error, the received data is set to NULL. Then the value is checked for the Overrun Error bit. If the Overrun Error bit check fails, the RCSTAbits.CREN is reset. If the received value passes those two tests, the received data is not garbage and parity is calculated. If the calculated parity is equal to the received parity, the value is valid and actions according to some if-sentences are taken.

When the received data is checked and OK, the PIC displays a message on the LCD-display. To make the LCD work with the microcontroller, I used the library files that are installed with the XC8 compiler. All the source files are added to one lcd_lib.c file. The LCD library files are included in the ZIP file below.

During development, I added a MAX232 IC to my breadboards. This was connected to my computer. That way it was easy for me to actually see what was sent out the EUSART-port on both the PICs.




  PIC16F688 Code     PIC16F877A Code  


In this article I have shown you how to make a wireless thermometer with 2 PIC microcontrollers, an LM34 and an LCD. The temperature is measured with one PIC, and an ADC value is calculated. According to the calculations, the data is formatted and sent out the EUSART port. The receiver checks for errors and when all is ok, a message is displayed on the LCD.


Pictures and Video




  • ViktorRRS 2015-12-06

    Hello Jens,
      very neat and simple to understand and article. I just can’t understand the Transmitter Block in the Transmitter Schematic Diagram. According to the text the ‘TX-MODULE’ PIN should shut-down the RF transmitter supply power. But in this schematic it looks for me that the PIN just blinks a LED…

    • Jens Christoffersen 2015-12-22

      Hi, thanks. Above R2, there’s a wire going to JP4. The transmitter is placed in JP4. When the LED is on, the transmitter is on.

  • Rohit khamdekar 2016-01-01

    Plz can you provide me actual circuit diagram of this…..plz it will be very helpful to me for my college level project

  • munyap 2016-02-12

    can you please provide a schematic diagram of this wireless thermometer because I am failing to understand the provided diagrams since they are broken into blocks

  • mogbolahan 2016-02-17

    Can I use pickit 3 to transfer the code to the PIC? Also, I realised that the zip file for the receiver station has two programs—one for the lcd and one for the PIC. How doe that work? I mean, how do I transfer the code to the lcd?

    • munyap 2016-02-18

      how can I exclude the ICSP connections because I want to burn the program to the PICs whilst outside the circuit. can it be possible, thanks in advance

      • Jens Christoffersen 2016-02-18

        If you don’t want the ICSP header, you can skip it. The only thing that is important, is that you have a 10K resistor from MCLR to +5v.

    • Jens Christoffersen 2016-02-18

      Hi. Yes, the PICKit 3 would work great. The ZIP file on the receiver, is the MPLAB X project folder. You don’t transfer the files to the LCD, but to the PIC16F877A. It should work if you open the project in MPLAB X, and compiled the C file.

      • mogbolahan 2016-04-01

        Thanks so much for the tutorial. I have tried almost everything I know of. However, the LCD only displays black square blocks. I really know what I am doing wrong. I need your help please. I really want to get this to work

  • munyap 2016-02-19

    thanks, is it possible to use the same source cord as yours even if I am going to programme the PICs out of circuit? is there something that need to be changed on Configurations of the source cord

  • life 2016-06-15

    Pls I wish to attache a second temperature sensor, to be covered with a wet cloth so as to read wet bulb temperature such that both dry bulb and wet bulb temperature are shown on the display,can you help me on that?

  • Carlo Ferraresi 2016-12-04

    Did you measure the Power consumption? It would be great to run the thermostat by battery. I think that 433Hz transmitter is most demanding module, the micro can wait in low-power mode for next acquisition

  • Joseph_Cseh 2016-12-20


    Hello Jens,

    I want to make a PC Board to this projec but I’m affraid,
    the connection of transmitter block is not riight. I want to use another RF pair of moduls (433Mhz)  from HOPERF because   it is easier to get them for me.  I checked the pin configuration of your transmitter modul from the picture pin1=DATA, This is OK, pin2=GND, (not VCC), pin3=VCC , (not GND) Beside of this there is a fourth pin next to pin1. This is the Antenna. So pin2 of JP4 should be connetected to the collector of T1 transistor,  pin3 of JP4 sould be connected to R2 and these should be connected to +5V not to +12V. Although this is not an error. How to connect the pin ANTENNA of the transmitter? That’s all.  Is the firmware written in microC?  I used microC PRO but the compiler did not compile the include instructionS and return (EXIT_SUCCESS) instruction. Why is it so?
    I’m waiting for your answer.

    • Jens Christoffersen 2017-01-09

      Hi. I’m using MPLABX and the XC8 compiler. You can download it for free from the Microchip web site. Please check the first line in the requirements list. With 12v I get a longer transmitting range for my type of transmitter. Please check the datasheet for your transmitter. It would be easy to add an extra pin for the antenna.

  • Joseph_Cseh 2017-01-08


    Hello Jens

    I want to tell you that the connection of oscillator blocks is not good.  It is not good in either the transmitter
    or the receiver, You short the crystal to the ground if you connect it this way.  You have to connect the crystal
    above the two capacitors C6 and C7 between to them. Sorry , but I cann’t draw here.  I want to ask you
    Are your hex files good?  Because the C complier can not open your include instructions, so I cann’t create
    the hex files by myself,  I would appriciate your answer.

    • Jens Christoffersen 2017-01-09

      Oh my gosh, this is wild! You’re right! I’ll make the changes as soon as I can. Thanks.
      I’ve compiled both files with MPLAX and the XC8 compiler. Both are working.

  • Joseph_Cseh 2017-01-11


    Hello Jens,

    I see   You’ve correcteed the oscillator blocks. It’s right now. You didn’t corrected your transmitter block.
    You directly connected the GND and the VCC pins to the power supply.  So the transmitter remains on
    all the time. There’s nothing to swich the transmitter on and off.
    REMIDY:  Connect the GND pin of the transmitter and the pin of the Cap. C8 to the collector of the
    transistor T1. The transitor T1 will switch on and off the transmitter, You just made the LED1 blink
    I designed PCB to the transmitter and the receiver by ORCAD.  I can send them to you if you want to.
    So you can upload them .  But I don’t your email address. I can send in the PCB files.
    I’m waiting for your answer.