Garage Parking Sensor
![IMG_20141025_233704237.jpg](/proxy/?url=https://content.instructables.com/FJO/55OK/I1Q9EM32/FJO55OKI1Q9EM32.jpg&filename=IMG_20141025_233704237.jpg)
![_20141026_170401.JPG](/proxy/?url=https://content.instructables.com/FRU/O2LV/I1Q9ECE2/FRUO2LVI1Q9ECE2.jpg&filename=_20141026_170401.JPG)
![IMG_20141025_233636525.jpg](/proxy/?url=https://content.instructables.com/FE5/7MHB/I1Q9EM84/FE57MHBI1Q9EM84.jpg&filename=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](/proxy/?url=https://content.instructables.com/F8E/RYM0/I1Q9EJDX/F8ERYM0I1Q9EJDX.png&filename=HC-SR04 dimensiones.PNG)
![sensor-de-distancia-ultrasonico-hc-sr04-1363-MCO2913268742_072012-O.jpg](/proxy/?url=https://content.instructables.com/F8T/VZIG/I1Q9EJJG/F8TVZIGI1Q9EJJG.jpg&filename=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.
RF 315/433 MHz Transmitter and Receiver Module
![IMG_20141026_171758606.jpg](/proxy/?url=https://content.instructables.com/FAH/ALOF/I1Q9ECDD/FAHALOFI1Q9ECDD.jpg&filename=IMG_20141026_171758606.jpg)
![IMG_20141026_171804511.jpg](/proxy/?url=https://content.instructables.com/FWU/3HZX/I1Q9ECBG/FWU3HZXI1Q9ECBG.jpg&filename=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](/proxy/?url=https://content.instructables.com/FD3/HI1L/I1NULV51/FD3HI1LI1NULV51.bmp&filename=tx.bmp)
TX MODULE(Arduino Code)
![IMG_20141025_234107067.jpg](/proxy/?url=https://content.instructables.com/FPP/RKPU/I1NUM3N8/FPPRKPUI1NUM3N8.jpg&filename=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](/proxy/?url=https://content.instructables.com/FCP/CFBU/I1NULVD4/FCPCFBUI1NULVD4.bmp&filename=rx.bmp)
RX MODULE(CODE)
![IMG_20141025_233636525.jpg](/proxy/?url=https://content.instructables.com/FGW/8FVS/I1NUM3U2/FGW8FVSI1NUM3U2.jpg&filename=IMG_20141025_233636525.jpg)
![IMG_20141025_233704237.jpg](/proxy/?url=https://content.instructables.com/FJ9/0FHO/I1NUM3PY/FJ90FHOI1NUM3PY.jpg&filename=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
}
}