This project was created to help drivers everywhere park their car with ease. The simple ultrasonic sensor sends signals back and forth to the Particle Argon. As the car gets closer to the ultrasonic sensor, the sensor generates high frequency sounds waves and detects the time interval between sending and receiving signals. This allows it to determine the distance between the car and the sensor. Once the car is within the acceptable parking range, the LED light will turn red to notify the driver.
How does the parking sensor work?The parking sensor uses one microphone to receive signals, and one speaker to transmit signals. Then, the sample rate is doubled to create a more accurate representation. For this project, a 40 kHz ping is sent and the sensor listens for the echo. The pulse travels and hits a wall, then comes back. This reveals the time between pulses, and the distance is calculated. Once the car is within the allotted distance, the LED will light up. The picture below demonstrates the concepts of how an ultrasonic sensor works.
In this project, the main concern was constructive interference and destructive interference. Preventing interference was key to ensuring accurate measurements, so the driver does not accidentally pull forward too much. This was achieved by aligning the parking sensor directly in front of where the car would be. An even surface is critical to getting good data.
What does the circuit design look like for an Ultrasonic Sensor?
Simply connect the 3.3V input to the VCC connection on the ultrasonic sensor.
- Connect Trigger to D2 on your Particle Argon.
- Connect Echo to D6 on your Particle Argon. Place one 220 ohm resistor in front of the Echo connection as well. See the images below for reference.
- Connect GND with GND on the Particle Argon. See the image below for the ultrasonic sensor connections.
HC-SR04 Ultrasonic Sensor Connections
HC-SR04 Particle Argon Connections
- Power Supply − +5V DC
- Quiescent Current − <2mA
- Working Current − 15mA
- Effectual Angle − <15°
- Ranging Distance − 2cm – 400 cm/1″ – 13ft
- Resolution − 0.3 cm
- Measuring Angle − 30 degree
- Connect the 3.3V pin on the Particle Argon to the VCC connection on HC-SR04.
- Connect Trigger to digital pin 2 on your Particle Argon.
- Connect Echo to digital pin 6 on your Particle Argon.
- Connect GND with GND on Particle Argon.
- 1 × Breadboard
- 1 × Particle Argon
- 1 × LED
- 1 × 220Ω Resistor
- 1 × Jumper
- Connect the positive terminal of the red LED to D7 on the Particle Argon. This should be the longer leg of the red LED.
- Connect the negative terminal of the red LED to the Power Rail on the breadboard. This should be the shorter leg of the LED.
- Connect one end of the 220 ohm resistor to the Power Rail row directly above the red LED.
- Connect the other end of the 220 ohm resistor to the terminal strip on the breadboard.
- Connect one jumper wire from the terminal strip to the GND connection on the Particle Argon.
- See a detailed circuit in the schematics section below.
To demonstrate the communication between the two particle argon devices, a real time graph was created using IFTTT and Google Sheets. This was done by generating an IFTTT account and setting up an applet. The steps to do so are listed below.
1. Click create under applets.
2. Select Add under "If This", and choose Particle.
3. Choose "Monitor New Event Published", and enter your Event Name, Event Contents, and the Device Name or ID.
4. Create Trigger then Add to "Then That".
5. Select Google Sheets and specify the name, events, etc.
6. Select Finish and the applet should be ready to record live events and send the data to google sheets.
IFTTT and Google Sheets SetupThe live data for the parking sensor project is shown below in publishing events and the google sheets graph.
Particle Publish EventsBelow, the published events are shown for Particle Argon 1 with the ultrasonic sensor. As demonstrated, the device publishes "Clear" until the vehicle is < 60 cm away from the sensor. At this point, the device publishes "Breach" and Particle Argon 2 then sets off the LED to alert the driver.
Click on the link below to get a glimpse of the parking sensor in action!
Comments