Microcontroller projects 2

13,684

Circuit Image

The HC-06 module is a slave mode serial Bluetooth data link manufactured by CSR. In this project, a mobile phone communicates with the AT89C2051 microcontroller via the HC-06 module. The complexity of the communication has been encapsulated within a Java library and the Bluetooth module, allowing the focus to be on developing a terminal program for the mobile phone using Java (J2ME), as well as another program to receive the unlock code for the AT89C2051. Although the project may appear somewhat unrefined, it is functional. The motor used is of the spring return type, which means that when the correct code is sent from the mobile phone, the motor is energized for 300 milliseconds before returning to its original position autonomously. The motor is designed to operate at 12V; however, it can also function effectively at 5V for softer operation. The HC-06 module can be configured using AT commands. The factory default settings are 9600 baud rate, no parity, 8 data bits, 1 stop bit, and a password of 1234. To configure the HC-06 module, it can be connected to a PC via USB/TTL and accessed through terminal software. The module's name can be changed using the command: AT+NAMEnewname (maximum 20 characters), with a response of OKname. Additionally, the baud rate can be modified using the command: AT+BAUD4, with a response of OK9600.

The HC-06 Bluetooth module operates as a serial communication interface, facilitating wireless data transmission between devices. In this application, the module connects to the AT89C2051 microcontroller, enabling it to receive commands from a mobile device. The microcontroller is programmed to interpret incoming data, specifically looking for a predefined unlock code. Upon receiving the correct code, the microcontroller activates a motor for a brief duration.

The motor is configured to operate in a spring return mechanism, which ensures that it automatically returns to its initial state after being activated. This feature is particularly useful in applications where a temporary action is required, such as unlocking a mechanism. The choice of operating voltage is critical; while the motor is rated for 12V, using 5V provides a gentler action, which may be desirable for specific applications to prevent mechanical stress or damage.

The HC-06 module's configuration via AT commands allows for flexibility in communication settings. The default baud rate of 9600 bps is standard for many applications, but adjustments can be made based on the specific requirements of the project. Changing the module name and baud rate through terminal commands makes it easier to manage multiple Bluetooth devices in a networked environment.

When designing the schematic for this project, it is essential to include the power supply connections, the microcontroller interfacing with the HC-06 module, and the motor control circuitry. Proper attention should be paid to the electrical characteristics of the components used, ensuring that the microcontroller operates within its specified voltage and current limits while providing adequate drive capability for the motor. Additionally, incorporating protective elements such as diodes for back EMF protection from the motor can enhance the reliability of the circuit.This module is HC-06 a slave mode serial bluetooth data link. The chips is made by CSR. In this project, my mobile phone will talk to AT89C2051 via HC-06. All the complication has been put in the cage (in the java library and bluetooth module), so what I need to do is just create terminal program for mobile phone written in java (J2ME), and create another program to receive the unlock code for AT89C2051. This is the result of the project, looks a little ugly but it works. The motor is spring return type therefore when the code sent by mobile phone is correct, the motor energized for 300msand return to original position by itself. The motor is designed to operatewith 12V power but in fact 5V is sufficientto operate itwithsofter action.

Here the schematic. HC-06 can be setup using AT command. From the factory the default parameters are 9600, N, 8, 1 and 1234 password. Connect the HC-06 module to a PC using USB/TTL then open a terminal software. First you can change the name of the module by command: AT + NAMEnewname (max 20 chars), the reply is OKname. Second you can change the speed by command: AT + BAUD4. The reply is OK9600. 🔗 External reference