Bookmark and Share

Friday, 20 February 2009

MCU controlled Bluetooth automation with infrared senso

The microcontroller used is 0822 zilog encore! 8k series (soic,28pin) as shown on the figure. Is a programmable microcontroller, the functions used are the GPIO and the UART of the chip. GPIO is used on led indicators, and the UART is used for giving and reading AT COMMANDS to control the Bluetooth device.

The whole process of the circuit, is to control the remote device using the 1st board (controller board), to switch a certain load on/off vice versa. Figure 1 explains how to use the controller and figure 2 explains how it functions according to the user. The user will enable the switches for the loads, then the mcu will give commands to the Bluetooth serial, then the remote device will receive the data, to enable the load.

figure 1

figure 2

Controller board

The controller board consists of the Bluetooth device, 0822 zilog encore, the max232 IC for programming, DB9 connector and some components, this board has a built in programmer, so it can be re-programmed any time the user wants to.

click for high resolution image

D9 and D10 is used to indicate connectivity from the other Bluetooth module(the remote device), it should be in the on condition. If it is not, the reset button can be pressed to make a new connection to the remote device. The max232 IC from maxim, is connected to a switch(DPDT, to make it much more cheaper), for either programming or serial communications in the hyperterminal of the PC. D1-D4 is used to indicate the switch status. D5-D9 is optional, it can be used to indicate the status of the load in the remote device, so the programming will be that easy. The power supply of the controller board consists of 3.1265 volts(LM317) and the LM7805 ic. Vout of the LM317 IC can be achieved by the formula:

Controller board (1st board)

Remote device board

The main function of the remote device is to accept commands from the BTSerial1, or the controller board, via Bluetooth communications. This will turn ON/OFF the loads that is connected to the relays.

Schematic of the remote device board

The whole schematic is included in the rar file, so it will be easy for the others to see the whole schematics.

A shot of the whole circuitry of the remote device which includes buzzer, the power supply, the remote device board and the relay drivers for high voltage loads.

Relay board

The function of this relay board is to switch the high voltage loads(220volts), from low voltage signals.. this is connected to the remote device board

click for high resolution image

The front panel, with 12volts relay to switch high voltage loads.

Infrared sensor

The infrared switch can be used as an alarm to intruders at home. The circuit and the pictures of the sensors, with buzzer are shown below

Infrared casing

Infrared is on, not visible to the human eye

With the buzzer

The circuit of the op-amp, using a simple comparator. To drive a relay, which will also drive the 12volts buzzer. buzzer The infrared switch can be used as an alarm to intruders at home. The process of the whole circuit is like a simple switch, but uses infrared, that, If the signal from the infrared transmitter is blocked, the buzzer will turn on, this will serve as a simple alarm that can have many useful applications. The whole circuit components are soldered directly, without PCB.


Screen shot of the controller board, includes the power supply, max232 (for programming the zilog chip) the socket for 0822 zilog chip, 4 tact switch and some components. The controller board consists of the Bluetooth device, which can be directly controlled via hyperterminal from the pc, or by the zilog mcu chip. It also include the debugger circuit that can be re-programmed via Zilog ZDS-IDE II compiler.

Screen shot of the remote device. Consists of the 3 power supply: 3volts, 5volts and 12volts, which is supplied to the BTSerial2 (Bluetooth device on the remote device), the 5volts relays, and the 12volts relays, ULN2803 are also used as a buffer to amplify low signal to trigger to a high level, it also consists of LED indicators, to indicate status.


This is the Bluetooth pair device that is used, it has 10 GPIO, which can be configured as input or output, it can be configured at the hyperterminal, in pass thru and command mode. Supply voltage is from 3.0-3.3 volts. It accepts AT COMANDS, and can be controlled also by any microcontroller which has the function UART.


Author: mArKhAo
Email: markjosephhao @
marksurel @


Download PCB files
Download Schematic files
Download Source code files
Download project in DOC file


Post a Comment

There was an error in this gadget