Here we have declared a variable in void main function for storing incoming character from Bluetooth module.
Ĭomplete AVR code with Demonstration Video is given at the end of the article. Pin 8Ĭonnect the remaining components on the breadboard as per circuit diagram. Pin 8 connected to GND of atmega8 i.e.Pin 9 connected to MISO of atmega8 i.e.Pin 7 connected to SCK of atmega8 i.e.Pin 5 connected to Reset of atmega8 i.e.Pin 2 connected to Vcc of atmega8 i.e.Pin1 of FRC female connector -> Pin 17 ,MOSI of Atmega8.Hookup the one side of FRC cable to USBASP programmer and other side will connect to SPI pins of microcontroller as described below: Now, we have to write only few lines of code to interface the bluetooth module and control the LED.Ĭircuit diagram for interfacing Bluetooth HC-05 with AVR is given below. Our most of the work is completed with the help of the Wizard. We will be having three dialogues box one after other to save files.ĭo the same with other two dialogue boxes which will appear after you save the first. Name your folder as you want and I suggest use the same name to save program files. Make a New folder on desktop so, that our files remains in folder otherwise it we will be scattered on whole desktop window. Now, more than half of our work is completed Click on Program -> Generate, Save and Exit. So, click on USART option and click on Receiver option and leave rest as it is. So, make Bit 4 and bit 5 as output by clicking on it. In our project, we will be using Port C4 and C5 for led interfacing. Choose your microcontroller chip, here we will take Atmega8 as shown. Open CodeVision Click on File -> New -> Project. Mobile Phone Controlled Robot Car using G-Sensor and ArduinoĬreating the Project for Atmega 8 using CodeVision:Īfter installing these softwares follow the below steps to create project and writing code:.Smart Phone Controlled FM Radio using Arduino and Processing.
Controlling Raspberry Pi GPIO using Android App over Bluetooth.Bluetooth Controlled Home Automation System using 8051.Bluetooth Controlled Toy Car using Arduino.The pin connection table is shown belowĬheck our other projects to learn more about Bluetooth module HC-05 with other microcontrollers: Out of the six pins only four will be used in the Operating mode. The module works on 5V supply and the signal pins operate on 3.3V, hence a 3.3V regulator is present in the module itself. The Device name will be HC-05 (I am using HC-06) and the password will be 0000 or 1234 and most importantly the default baud rate for all Bluetooth modules will be 9600. The Command mode will be left to the default settings. Hence in this tutorial we will be toying only with the Operating Mode. The Operating Mode is the one in which we will be able to send and receive data between the PIC Microcontroller and the Bluetooth module. In Command Mode we will be able to configure the Bluetooth properties like the name of the Bluetooth signal, its password, the operating baud rate etc. You can download these softwares from the given links:īluetooth can operate in the following two modes:
We will use CodeVisionAVR software for writing our code and SinaProg software for uploading our code to Atmega8 using USBASP programmer.