Wednesday 4 September 2013

Arduino BLUETOOTH Communication with PC

In this post ill show you how to connect arduino to your laptop via bluetooth connectivity. 
Bluetooth is a wireless device which helps in sending and receiving data wirelessly. It is good for short range communication, range within 10mts. There are many bluetooth module out there in the market, but i am goin to use AUBTM-20 its a cheap bluetooth module. 

Parts you will need

A bluetooth module 
An arduino
A laptop with bluetooth
Jumper wires
A led

Connection

The fig. shows the connection between the bluetooth module and arduino. 
RX pin from bluetooth module goes to the TX pin on arduino and vice versa. Since the data that is being transmitted from bluetooth module is being received by arduino, and vice versa. Therefore we always connect RX pin to TX pin. connect a led to pin 13 on arduino.


Level shifting
In some bluetooth module the data voltage is 3.3v and the data voltage on arduino is 5v, the 3.3v form TX pin of bluetooth to RX pin on arduino will not create any problem, but the 5v from TX pin of arduino to RX pin on bluetooth will burn the bluetooth chip. In order to protect this we need to shift the level of TX arduino pin to 3.3v. make this connection for TX arduino pin to make it work with the bluetooth.



Putty

PuTTY is a free and open-source terminal emulator, we will use it to connect to the serial port.Download putty on your laptop. AFTER  making all the connections and uploading the code to arduino, turn on the arduino and your laptop, from your laptop search for the bluetooth module and make the connection and note down the serial port for connetion.
open the putty software 


  • click on the serial button
  • change the port to the bluetooth connection port
  • click on open
now when to press "1" you can see the led glow and when you press "0" the led will turn off.

Make use of this tutorial to make a HOME AUTOMATION system.


CODE




Sunday 1 September 2013

Arduino Ping Sensor

The PING)))™ Ultrasonic Distance Sensor is an all-in-one module for accurately measuring distances between itself and objects nearby. The effective range is from about 1 inch to 10 feet (2 centimeters to 3 meters). The PING))) sensor consumes only modest power, and is ideal for use in mobile robots, security systems, and any other application for detecting nearby objects, or measuring their distance from the sensor.
In operation, object detection or distance measurement is initiated by sending a short high frequency (40 kHz) tone from the PING))) module. The time it takes to detect the return echo represents the distance between the PING))) module and any objects in front of it. Using basic arithmetic, you can convert the amount of delay of the echo to inches or centimeters. The sound frequencies used in the sensor are in the ultrasonic range, and are beyond human hearing.
PING))) Sensor diagram, emitting and listening for ultrasonic echo

Code & Schematic 



Upload this code to arduino and open the serial monitor.
kindly change the "pingpin" to pin no. 7