Arduino Bluetooth Serial Connections I Made It
Arduino Bluetooth Serial Connections I Made It
Arduino Bluetooth Serial Connections I Made It
Table of Contents
Step 1: Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
http://www.instructables.com/id/Arduino-Bluetooth-Serial-Connections-I-made-it-/
Intro: Arduino Bluetooth Serial Connections! - I made it at TechShop
This is an introduction on how to setup, make a basic connection, and send data to and from an Arduino using Bluetooth!
Bluetooth is great for transmitting data over medium distances and what's more, Arduino just treats it like a serial data connection. This means that we can use the Serial
Library. That's a nice thing to have.
But what to pair the bluetooth to? And how do we do that? This covers all that. What you use the new found connective abilities for is up to you.
Wireless programming.
Wireless switches.
Wireless custom remotes.
Pairing with Android for some real power behind it.
Simple alarm system (someone is at the door or in room X)
http://www.techshop.ws
Step 1: Materials
Since this is just connectivity, there are very few parts
http://www.instructables.com/id/Arduino-Bluetooth-Serial-Connections-I-made-it-/
Step 2: Arduino Side Setup
Setting up the hardware is really easy.
Hook everything up between the shield and the modem and the uno.
WHEN YOU LOAD THE PROGRAM DO NOT HAVE THE MODEM ATTACHED. You will not be able to communicate on the serial lines when the bluetooth is plugged in
which means that uploading won't work and neither will the serial monitor. If you want to upload and monitor while it is in use, leave RX and TX open and either use
SoftwareSerial with an Uno or another Serial Port with a Mega.
-------------------------------------------
/***********************
Bluetooth test program
***********************/
/*
Setup.
Upload this to board without the modem attached
-Make sure the baud rate is 115200 as that is what the bluetooth is (and serial port)
*/
int counter = 0;
int incomingByte;
void setup() {
Serial.begin(115200);
}
void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital R, reset the counter
if (incomingByte == 'R') {
Serial.println("RESET");
counter=0;
}
}
http://www.instructables.com/id/Arduino-Bluetooth-Serial-Connections-I-made-it-/
Step 3: Paired Device Setup - Using Mac
I'm going to be using a mac for pairing as that's what I do all my programming on and the Terminal has a nice program built in that will work for testing purposes. Setup is
similar across the board. If you are using Windows, I might recommend HyperTerminal.
2. Pair the device. It should be RN42-xx. Or RN41-xx if using the more powerful one. If you have trouble use the passkey "1234"
Now it is paired, but it is not connected yet.
The little LED flashes Red when it is attempting to pair or has no connection and it is Green when successfully paired and connected.
cd ~
(this goes to the root directory)
ls /dev/tty.*
(this should display a list of all the open COM ports)
For reference on how screen commands work, take a look at this great reference.
http://www.math.utah.edu/docs/info/screen_5.html
4. When you connect the light should change to green and communication should start. If it has turned green and you don't see anything well then try pressing "R".
Remember in the code that it only counts up to 100 and then stops. If it is not counting, it is not displaying.
AND DONE. You should be able to get the arduino to reset using R from your computer. Now you can do more things.
For more information on serial communication in arduino, take a look at the Serial Library commands.
http://arduino.cc/en/Reference/Serial
http://www.instructables.com/id/Arduino-Bluetooth-Serial-Connections-I-made-it-/
Related Instructables
Easy Bluetooth
Enabled Door Android talks to
Cheap 2-Way Arduino by
Bluetooth how to Control Lock With Androino! android
Connection arduino by Arduino + Control an bluetooth circuit_breaker
Between bluetooth from Android by Arduino from controlled outlet
Arduino and PC (PC, pocket PC Collin Amedee your Android (Photos) by
by techbitar PDA) by device using a smaw51
simon72post cheap bluetooth
module. by
metanurb
http://www.instructables.com/id/Arduino-Bluetooth-Serial-Connections-I-made-it-/