Garage Parking Sensor

by checho0180 in Circuits > Wireless

7775 Views, 52 Favorites, 0 Comments

Garage Parking Sensor

IMG_20141025_233704237.jpg
_20141026_170401.JPG
IMG_20141025_233636525.jpg

Hi everybody, my Dad's car doesn't have parking sensor. So I decide to make it and stop hand signaling my father each time he was going to parking. The device has two parts:

-Tx Module: it's the sensor with a comunication module that send message to the other part inside the car where the variable distance is showing in a display.

-Rx Module: Receive data from the sensor in the garage and show it on a display. This module can be feed by a 9v Battery and keep in the glovebox.

Materials:

-2xArduino Board "I used Uno"
-RF 315MHz or 433MHz transmitter-receiver module .

-jumper wires

-HC – SR04

-2 BreadBoards

-2 batteries 9v

-lcd 16x2

Ultrasonic Sensor

HC-SR04 dimensiones.PNG
sensor-de-distancia-ultrasonico-hc-sr04-1363-MCO2913268742_072012-O.jpg

This is the sensor that I used in the device. It's easy to use with this simple library that you must add to your arduino IDE.

https://github.com/JRodrigoTech/Ultrasonic-HC-SR04

RF 315/433 MHz Transmitter and Receiver Module

IMG_20141026_171758606.jpg
IMG_20141026_171804511.jpg

This a cheap and easy module for arduino. To use with this simple library that you must add to your arduino IDE:

www.seeedstudio.com/depot/images/product/VirtualWi...

Transmitter :
Working voltage: 3V - 12V fo max. power use 12V

Working current: max Less than 40mA max , and min 9mA

Resonance mode: (SAW) Modulation mode: ASK

Working frequency: Eve 315MHz Or 433MHz

Transmission power: 25mW (315MHz at 12V)

Frequency error: +150kHz (max)

Velocity : less than 10Kbps So this module will transmit up to 90m in open area .

Receiver :

Working voltage: 5.0VDC +0.5V

Working current:≤5.5mA max

Working method: OOK/ASK

Working frequency: 315MHz-433.92MHz

Bandwidth: 2MHz Sensitivity: excel –100dBm (50Ω)

Transmitting velocity: <9.6Kbps (at 315MHz and -95dBm)

TX MODULE(Schematic)

tx.bmp

TX MODULE(Arduino Code)

IMG_20141025_234107067.jpg

//TX CODE

/*SimpleSend This sketch transmits a short text message using the VirtualWire library connect the Transmitter data pin to Arduino pin 12 */

#include

#include

Ultrasonic ultrasonic(9,8); // (Trig PIN,Echo PIN)

int d;// Initialize the variable distance

void setup()

{

// Initialize the IO and ISR

vw_setup(2000); // Bits per sec

}

void loop()

{

char b[3]; //declaring character array

String str; //declaring string

d=ultrasonic.Ranging(CM);/cm o inc

if(d<10){

send("STOP ");

}

str=String(d); //converting integer into a string

str.toCharArray(b,3); //passing the value of the string to the character array

send(b);

delay(100);

}

void send (char *message)

{

vw_send((uint8_t *)message, strlen(message));

vw_wait_tx(); // Wait until the whole message is gone

}

RX MODULE(Schematic)

rx.bmp

RX MODULE(CODE)

IMG_20141025_233636525.jpg
IMG_20141025_233704237.jpg

//RX CODE

/*

SimpleReceive

This sketch displays text strings received using VirtualWire

Connect the Receiver data pin to Arduino pin 11

*/

#include

#include

byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages

byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

// Variables globales:

char cad[100];

int pos = 0;

void setup()

{

lcd.begin(20, 4); // LCD Configuration, 4 línes 20 characters cada una.

lcd.setCursor(0, 0);

lcd.write("Booting");

delay(1000);

pos=0;

lcd.clear();

lcd.write("Loading code");

delay(1000);

pos=0;

lcd.clear();

lcd.write(".");

delay(900);

lcd.write(".");

delay(900);

lcd.write(".");

delay(900);

pos=0;

lcd.clear();

lcd.write("Instructables");

delay(900);

Serial.begin(9600);

Serial.println("Device is ready");

// Initialize the IO and ISR

vw_setup(2000); // Bits per sec

vw_rx_start(); // Start the receiver

}

void loop()

{

byte buf[VW_MAX_MESSAGE_LEN];

byte buflen = VW_MAX_MESSAGE_LEN;

int i;

int k= VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking

{

Serial.print("Received: ");

for (int i = 0; i < buflen; i++)

{

Serial.write(buf[i]);

}

Serial.println();

}

if( vw_get_message(buf, &buflen) )

{

if(pos < 4)

lcd.setCursor(0, pos);

else

{

pos=0;

lcd.clear();

}

lcd.write("Distance:");

for (i = 0; i < buflen; i++)

{

lcd.write(buf[i]);

pos++;

}

lcd.write("cm");// CM or INC

}

}