Академический Документы
Профессиональный Документы
Культура Документы
http://www.ablab.in/how-to-know-the-bluetooth-...
Careers
Contact Us
Summer Training Program 2016 on Robotics, Embedded System, Arduino and others starting are from 1st May.
Hurry Up !!!
Home
Electroshop
Knowledge Centre
Educational Workshops
Training Programs
More
ABLab Solutions > Knowledge Centre > Sample Codes > Microcontrollers > ATmega32 > Getting the Version of HC-05 Bluetooth Module with ATmega32
Knoweldge Centre
Sample Codes
In this project, we will learn How to know the Bluetooth version of a HC-05 Bluetooth Module with AVR ATmega32
Softwares
microcontroller. Here, we will read the Bluetooth version of the HC-05 Bluetooth Module and we will display the
Bluetooth version of the HC-05 Bluetooth Module in a 16X2 alphanumeric LCD.
The communication between HC-05 Bluetooth Module and ATmega32 microcontroller takes place through UART
serial communication protocol. To read the version of the HC-05 Bluetooth Module, the ATmega32 microcontroller
will send the AT command AT+VERSION? to the HC-05 Bluetooth Module. In return, the HC-05 Bluetooth module
will send a response to ATmega32 microcontroller. If the AT command is executed successfully, the HC-05
Bluetooth Module will send the Bluetooth version of the HC-05 Bluetooth Module to ATmega32 microcontroller. The
ATmega32 microcontroller will also display the Bluetooth version of the HC-05 Bluetooth Module in a 16X2
alphanumeric LCD.
Hardwares Required
AVR Trainer Board-100-1pc
AVR USB Programmer-1pc
12V, 1A DC Adapter-1pc
16X2 Alphanumeric LCD(JHD162A)-1pc
HC-05 Bluetooth Module-1pc
1 to 1 Connector-7pcs
10 to 10 FRC Female Connector-2pcs
USB AM-AF Cable(Optional)-1pc
Softwares Required
PC to ATmega16
Communication with LED
Display
6,242 views
Atmel Studio 6
5,552 views
USBasp Driver
Circuit Diagram
1 de 5
07-04-2016 12:09
http://www.ablab.in/how-to-know-the-bluetooth-...
C Program
//**************************************************************//
4,134 views
:8MHz
//Software
:Atmel Studio 6
:8-Bit
:9600
3,963 views
:8
:1
//USART Mode
:Asynchronous Mode
//USART Parity
:No Parity
3,701 views
//**************************************************************//
3,438 views
#include<avr/io.h>
/*Includes io.h header le where all the Input/Output Registers and its Bits are dened for all AVR
microcontrollers*/
#dene
F_CPU
3,214 views
8000000
/*Denes a macro for the delay.h header le. F_CPU is the microcontroller frequency value for the delay.h header
3,102 views
DTMF based
Mobile/Cellphone Controlled
Robot with ATmega16
#include<util/delay.h>
/*Includes delay.h header le which denes two functions, _delay_ms (millisecond delay) and _delay_us
2,975 views
(microsecond delay)*/
#dene
LCD_DATA_PORT
PORTB
/*Denes a macro for the lcd.h header File. LCD_DATA_PORT is the microcontroller PORT Register to which the data
2,898 views
pins of the LCD are connected. Default PORT Register for data pins in lcd.h header le is PORTA*/
#dene
LCD_CONT_PORT
PORTC
2,893 views
/*Denes a macro for the lcd.h header File. LCD_CONT_PORT is the microcontroller PORT Register to which the
PC to ATmega32
Communication with LCD
Display
control pins of the LCD are connected. Default PORT Register for control pins in lcd.h header le is PORTB*/
#dene
LCD_RS
2,690 views
PC0
/*Denes a macro for the lcd.h header le. LCD_RS is the microcontroller Port pin to which the RS pin of the LCD is
connected. Default Port pin for RS pin in lcd.h header le is PB0*/
#dene
LCD_RW
//System Clock
2,625 views
PC1
/*Denes a macro for the lcd.h header le. LCD_RW is the microcontroller Port pin to which the RW pin of the LCD is
connected. Default Port pin for RW pin in lcd.h header le is PB1*/
2,567 views
#dene
LCD_EN
PC2
/*Denes a macro for the lcd.h header le. LCD_EN is the microcontroller Port pin to which the EN pin of the LCD is
connected. Default Port pin for EN pin in lcd.h header le is PB2*/
#include<avr/lcd.h>
/*Includes lcd.h header le which denes dierent functions for all Alphanumeric LCD(8-Bit Interfacing Method).
LCD header le version is 1.1*/
#include<avr/hc05.h>
/*Includes hc05.h header le which denes dierent functions for HC-05 Bluetooth Module. HC-05 header le
version is 1.1*/
extern char hc_05_buer2[];
/*Variable is declared in hc05.h header le*/
2 de 5
07-04-2016 12:09
http://www.ablab.in/how-to-know-the-bluetooth-...
ATmega16
int main(void)
2,223 views
DDRB=0x;
2,178 views
/*All the 8 pins of PortB are declared output (data pins of LCD are connected)*/
DDRC=0x07;
2,122 views
/*PC0, PC1 and PC2 pins of PortC are declared output (control pins of LCD are connected)*/
1,987 views
/*Variable declaration*/
lcd_init();
1,971 views
/*LCD initialization*/
usart_init();
/*USART initialization*/
1,966 views
lcd_string_write(ABLab Solutions);
/*String is displayed in 1st row of LCD*/
1,942 views
00 to 99 Display in Quad
7-Segment Display with
ATmega32
lcd_command_write(0xc0);
/*Cursor moves to 2nd row 1st column*/
1,929 views
lcd_string_write(www.ablab.in);
00 to 99 Display in Quad
7-Segment Display with
ATmega16
1,864 views
_delay_ms(500);
_delay_ms(500);
_delay_ms(500);
1,830 views
do
1,829 views
{
received_data=hc_05_bluetooth_at_command_mode_test();
_delay_ms(100);
Products on Sale
Sale!
}while(!received_data);
/*Waiting for the Bluetooth Module to enter into Command Mode*/
lcd_command_write(0x01);
/*Clear Screen*/
lcd_string_write(Now in AT Mode);
/*String is displayed in 1st row of LCD*/
_delay_ms(500);
_delay_ms(500);
received_data=hc_05_bluetooth_get_version();
/*Sending AT Command to know the Bluetooth Modules version*/
/*Checking whether Bluetooth Modules version is read or not*/
if(received_data==1)
{
lcd_command_write(0x01);
/*Clear Screen*/
Add to cart
Sale!
lcd_string_write(BluetoothVersion);
3 de 5
07-04-2016 12:09
http://www.ablab.in/how-to-know-the-bluetooth-...
else
Rs.700.00
Add to cart
/*Null statement*/
}
Sale!
}
/*End of program*/
Connection Guide
The step-by-step connection guide for Getting the Version of HC-05 Bluetooth Module with ATmega32 project is as
follows:
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.
Connect RS, RW & EN pins of LCD control header with PC0, PC1 & PC2 pins of PortC header respectively in AVR
Trainer Board-100 with 1 to 1 Connectors.
Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.
Connect the VCC and GND pins of HC-05 Bluetooth Module with the 5V(VCC) and GND header pins of AVR Trainer
Board-100 respectively with 1 to 1 Connectors.
Connect the TXD and RXD pins of HC-05 Bluetooth Module with PD0 and PD1 pins of PortD header of AVR
Add to cart
Find us on Facebook
ABLab Solutions
5,049 likes
of AVR Trainer Board-100 and release the Push Button Switch of HC-05 Bluetooth Module after 2-3 seconds of
Like Page
power on.
See the output in the 16X2 Alphanumeric LCD.
Book Now
Download Materials
Getting the Version of HC-05 Bluetooth Module with ATmega32 Code V 1.1
13 downloads
38.70 KB
Download (http://www.ablab.in/?wpdmdl=16279)
506 downloads
2.34 KB
2381 downloads
1.91 KB
Share
Download (http://www.ablab.in/?wpdmdl=6660)
5865 downloads
1.14 KB
Download (http://www.ablab.in/?wpdmdl=6665)
4 de 5
07-04-2016 12:09
http://www.ablab.in/how-to-know-the-bluetooth-...
Related Posts
1. Getting the Version of HC-06 Bluetooth Module with ATmega32
2. Getting the Version of HC-05 Bluetooth Module with ATmega16
3. Getting the Version of HC-06 Bluetooth Module with ATmega16
4. HC-05 Bluetooth Module Interfacing with ATmega32
5. Changing Pin of HC-05 Bluetooth Module with ATmega32
6. Changing Pin of HC-06 Bluetooth Module with ATmega32
8. HC-05 Bluetooth Module Interfacing with Android Mobile using ATmega32
9. HC-05 Bluetooth Module AT Command Mode Testing with ATmega32
10. HC-06 Bluetooth Module AT Command Mode Testing with ATmega32
11. HC-06 Bluetooth Module Interfacing with Android Mobile using ATmega32
12. Changing Baud Rate of HC-05 Bluetooth Module with ATmega32
13. Changing Baud Rate of HC-06 Bluetooth Module with ATmega32
14. HC-06 Bluetooth Module to Android Mobile Wireless Data Communication with ATmega32 and LED Display
15. Android Mobile to HC-05 Bluetooth Module Wireless Data Communication with ATmega32 and LED Display
16. Android Mobile to HC-05 Bluetooth Module Wireless Data Communication with ATmega32 and LCD Display
17. Android Mobile to HC-06 Bluetooth Module Wireless Data Communication with ATmega32 and LCD Display
18. HC-06 Bluetooth Module to Android Mobile Wireless Data Communication with ATmega32 and LCD Display
19. HC-05 Bluetooth Module to Android Mobile Wireless Data Communication with ATmega32 and LED Display
20. HC-05 Bluetooth Module to Android Mobile Wireless Data Communication with ATmega32 and LCD Display
Leave a Reply
You must be logged in to post a comment.
5 de 5
Powered by SPIS
07-04-2016 12:09