Home Price List Order Info P955H Course PIR & RF Data Mini Course

Radio Controlled House Lights
PIC Training Course

For electronic enthusiasts with some PIC experience

Learn to use radio frequency data
Learn to programme a PIC to send data
Learn to programme a PIC to receive data
Learn about switching mains powered lights


In this short PIC training course you will learn how to programme a PIC microcontroller to use a low power radio transmitter to control three house lights. The idea is that by synchronising the switching of several lights it is possible to give a realistic appearance of the house being occupied when no one is at home.

The hardware required to remotely switch house lights is shown in the picture. At the top left is the radio frequency data transmitter. At the bottom right is one of the three radio frequency data receiver circuits. We have designed the receiver circuit so it fits into the readily available remote control circular lamp base which is in the picture.

The transmitter circuit uses a PIC to generate a sequence of serial data which carries instructions to the receivers using the radio frequency transmitter. The three receivers all receive the data and each uses its PIC to extract the header and the data. If the header is correct all three PICs take appropriate action.

This course is usually supplied as a kit of 4 PCB with the PICs already fitted, 4 sets of components, a cut and drilled transmitter box, a CD of software and a 100 page manual. You will need to order 3 circular lamp bases to hold the receiver circuits. Instructions for doing this are in chapter 1.

You will also need a PIC programmer. A Brunning Software P205, P206, P931, P942 or P955 is ideal. A PICkit3 or 4 can be used with an adaptor if you know how to use MPLAB-X.

This picture shows the data transmitter circuit. This can be programmed by plugging it onto a P205 or P955 programmer. It has sockets to fit a simple 433Mhz transmitter and a 2.4Ghz transceiver. Both rf circuits can be fitted at the same time and the PIC is wired so it can control them both.

It is intended for the light switching to be controlled by sending data via the 433Mhz transmitter. The 2.4Ghz transceiver has been included to allow for possible future improvements.
The 433Mhz transmitter plugs into the 3 pin horizontal socket in the middle of the PCB. The LCD plugs into the 6 way and 4 way sockets at the back of the PCB.

The transmitter will usually be powered by plugging a 4 cell battery pack or a 5 volt power supply into the DC input socket on the side of the module.
This shows the back view of the finished transmitter module. The push buttons are on the left of the picture and the ON/OFF switches on the right. The power ON/OFF is nearest the corner. The backup battery switch is nearest the middle. The onboard PIC can be programmed without taking the lid off by plugging a P205 or P955 into the 7 pin socket.
When both slide switches are ON the onboard battery is trickle charged by the input voltage. The backup battery voltage is high enough for the PIC to operate normally but too low for the LCD. So with this setting if the input voltage fails or is not connected the operation of the PIC will continue without interruption but the display will not be visible.

When both slide switches are OFF the onboard battery is fast charged if the input voltage is connected. This arrangement is so that the onboard battery can be charged without needing the light switching system to be turned on. Then when the system is needed the backup battery will be ready to do its job.
The receiver circuit (in this picture) has provision to fit a simple 433Mhz receiver and a 2.4Ghz transceiver which can be fitted at the same time. The 433Mhz receiver passes all received data directly to the serial input of the PIC which continually tests the data. When the sequence of bytes forms the correct header address the PIC writes the next received byte to port B. The lowest 4 bits of port B connect to one side of a 4x4 socket. The 4 sockets on the other side are all connected to the gate pin of an opto isolated triac. Each receiver has one wire link fitted in the 4x4 socket so that each receiver connects a different pin of port B to the opto triac gate. The opto triac drives a high current triac which switches the house light.

This system allows the 3 receivers to be built and programmed exactly the same. The position of the wire link determines whether the receiver switches the lounge, hall or bathroom light.
The high current triac is rated to switch 12 amps but when mounted in the circular box it has no heat sink, is in a small space, and heat is generated by the light bulb. LED lights are very efficient but all the generated heat goes into the base of the bulb. We recommend using an LED bulb no more than 12 watts. VTAC have ideal high efficiency bulbs of 6.5, 8.5 and 12 watts. (Equivalent to 60, 75 and 100 watt tungsten bulbs).

The 12 amp triac has an insulated tab. If the receiver is mounted in a different box with a heat sink for the triac the circuit can be used to radio control a higher powered device such as a television set.

The receiver circuit can be plugged directly onto a P205 or P955 for programming when it is out of the box. When it is fitted in the circular box the circular box must be unscrewed from the celling fitting. Then remove the lid and connect the programmer using a short 7 pin lead. The circuit is powered by the programmer during the write sequence.
Warning..... The receiver circuit takes its low voltage power directly from the mains supply using a high voltage capacitor, rectifying diodes and a zener diode to drop the voltage from 220v ac to 10 volts dc. The low voltage supply is not isolated from the mains. If you do not have experience working with live mains you MUST NOT install the receiver circuit in the circular lamp base, you must get help from someone who does have the experience. If you think you will not be able to get the help you need you can purchase the receivers built, tested, programmed and assembled in the circular lamp bases.

If you do buy the receivers ready to use and assembled you will not need to open the lamp bases but you will need to read chapters 4, 6 and 7 without doing the experiments.

The Training Sequence

When you receive this course your first task is to order three round boxes from China and three LED light bulbs from a UK supplier. Details are in chapter 1. Your next task is to assemble and solder the four PCBs as instructed in appendix PCB. The order from China will take about 3 weeks to arrive but you do not need to wait for these to arrive. When you have carefully built and inspected the PCB you can start working though the training sequence.

Chapter 1 starts with a brief introduction to the ideas which inspired this short training course. Chapter 2 introduces the PIC we will be using as the intelligent controller for each circuit. We have chosen the best modern PIC for easy programming with assembler. We do not use one of the very latest PICs because these have been optimised for use with C and are unnecessarily complex when used with assembler.

In chapters 3 and 4 we start our learning curve by testing the transmitter and receiver circuits seperately with simple software. We write assembler code from the library into the transmitter first to run the RGB LED then to write text to the LCD. Then we plug 4 LEDs into the 4x4 pin socket of the receiver and use library assembler to run the LEDs.
In chapter 5 we learn about the fundamentals of radio frequency data transmission then in chapter 6 we put the learning to use. We programme the receiver PIC so it is able to syncronise and decode incoming RF data and compare it with our chosen header. Then we programme the transmitter circuit to send a stream of data to rotate the temporary LEDs which we plugged into the receiver.

In chapter 7 we remove the temporary LEDs from the receiver circuits and fit the receivers into the round boxes. We crew an LED light bulb into each round box and plug each assembly into a house ceiling socket. We turn on the light switches. We use the same software in the receiver and transmitter as we loaded in chapter 6. We have already arranged the receiver software so the PIC starts by turning the light on. We connect power to the transmitter and the system runs as when switching the LEDs but this time we switch the actual mains powered lights.

In chapter 8 we learn about the library code for the real time clock and in chapter 9 we switch the house lights using accurate real time. In chapter 10 we improve the transmitter software by splitting each day into three time zones: light awake, dark awake, and sleeping. The start time and switching sequence of each time zone can be adjusted to suit the actual requirement
Price list
Radio Controlled House Lights

Option 1 (kit):
Transmitter kit & 3 receiver kits

Book: Experimenting with RC House Lights.... £10

1 off transmitter PCB with PIC18F23K22 fitted
1 off set of components for transmitter PCB
1 off 2 line x 16 character LCD
1 off 4 cell battery holder
1 off plug in battery lead
1 off simple 433Mhz transmitter module... £24

1 off cut and drilled box for transmitter circuit... £6

3 off receiver PCB with PIC18F23K22 fitted
3 off set of components for receiver PCB
3 off simple 433Mhz receiver module............. £30

1 off BSPWA PIC assembler with RF library on CD.. £4.
1 off 1st class postage to UK....... £5

All the items listed above
Total price....... £69
Book + transmitter kit + 3 receiver kits + CD + postage
3 lamp bases, 3 B22 to E27 adaptors, and 3 mains bulbs
are not supplied. Instructions for buying these are in the book.

Option 2 (part built):
Transmitter kit & 3 built and tested receivers

Book: Experimenting with RC House Lights.... £10

1 off transmitter PCB with PIC18F23K22 fitted
1 off set of components for transmitter PCB
1 off 2 line x 16 character LCD
1 off 4 cell battery holder
1 off plug in battery lead
1 off simple 433Mhz transmitter module... £24

1 off cut and drilled box for transmitter circuit... £6

3 off built and tested receiver circuit
      each installed in a circular lamp base
      each with a 433Mhz RX module........... £69

1 off BSPWA PIC assembler with RF library on CD... £4
1 off 1st class postage to UK..... £5

Total price....... £110

Book + transmitter kit + CD + postage
+ 3 receivers built and tested.

3 lamp bases and 3 adaptors are supplied.

3 mains bulbs are not supplied.
Instructions for buying these are in the book.
Option 3 (fully built):
All circuits built, tested and ready to use

Book: Experimenting with RC House Lights.... £10

1 off built and tested transmitter circuit mounted in box
      with LCD and 433Mhz Tx module.
1 off 4 cell battery holder
1 off plug in battery lead.................. £40

3 off built and tested receiver circuit
      each installed in a circular lamp base
      each with a 433Mhz RX module........... £69

1 off BSPWA PIC assembler with RF library on CD... £4
1 off 1st class postage to UK.......... £5

Total price....... £120

Book + transmitter + 3 off receivers + CD + postage
Supplied built, tested and ready to use.

3 lamp bases and 3 adaptors are supplied.

3 mains bulbs are not supplied.
Instructions for buying these are in the book.

Home Price List Order Info P955H Course PIR & RF Data Mini Course