My car has only parking sensor for the Reverse, so when I enter the Garage there is no way to know if I am close enough to the wall to allow the door to close or too close that I can hit the wall with the car. So, decided to build a parking sensor that will be fixed on the garage wall. One of the limitations that I got is that there is no power nearby, so the parking sensor had to be battery powered.
Started it as first project with Netduino, that was chewing power. Found out that the Netduino board does not support power saver mode of the ARM processor, moved to Fio based Arduino board, and optimized power consumption over time. Now, the device can remain about two months without recharging battery. Still, in the future I will move to a different, more power conservative processor (probably the MSP430 from TI or by its name LaunchPad).
- Battery powered
- Requires charging only once in 60 days or more
- Low cost
- Easy to assemble
- 4 LEDs indicating distance
- Support single or multiple LEDs lights together
Step 1: Components required
The following are the components you will need:
1. Arduino, better take the Fio based board or another one that does not have on-board FTDI
2. A 2,000 mAH LiPo battery that fits the Fio (the connector matches the Fio battery connector)
3. 4x Bright LEDs, 2xGreen, 1xYellow, 1xRed
4. 4x Resistors of 270 Ohm
5. small bread-board to solder the resistors and LEDs
6. LV-MaxSonar EZ1 MB1010 distance sensor
7, Some cables to connect LED board and the sensor
If you are using the Fio (recommended), you would also need a 3.3V FTDI board to program it.
If you do have power nearby the device, then you can buy any Arduino board instead of the battery and see some notes in next steps for power considerations.
Where to buy?
All goods can be purchased at your favorite electronics shop. None of those are very special components. One of the places is obviously Sparkfun (http://www,sparkfun.com)
Step 2: How it works
When you are far from hitting the wall, the first green LED will turn on, then when getting closer, the 2nd one, then the yellow LED and finally the red LED will light up. You should stop when the red LED is on.
When no change in distance for some time (5 seconds), the device will turn off all LEDs and go to sleep. This fits the scenario of car parking in the garage or no car at the garage (where did you go :-)?).
The program is fairly simple, read analog input from the sensor, test the value against some thresholds and based on the result, set the number of LEDs to light up. Testing amount of time with no change in status and if that is for 5 seconds, the processor is put to sleep to preserve power. The processor wakes up every second to see if anything changed. If not, back to sleep. When in sleep, the entire device will consume 0.4mA and when working (without LEDs) it consumes several mA. When only one LED is lightening at a time, consumption is about 15mA. I tried 2 seconds of sleep as well, but it gave an awkward feeling when driving in as sometimes it took 2 seconds really before you saw some light… obviously not a good thing for people on the rush.
If you operate the device in the mode of single LED lightening at a time, expect about 2 months between recharging. If all LEDs that fit the distance will light up simultaneously, expect about a month between recharging.
To shorten the time the processor is up, I used 115,200 baud rate for the serial (only used for debugging). This reduced the awake time substantially. Removing serial output can further reduce awake time, but not dramatically I think.
For more detail: Simple Parking Sensor using Arduino
This Post / Project can also be found using search terms:
- arduino parking sensor