Watch Your Back With Rear-Sense: DIY Bike Blind Spot Sensor
by kylefern in Circuits > Arduino
419 Views, 2 Favorites, 0 Comments
Watch Your Back With Rear-Sense: DIY Bike Blind Spot Sensor
As a biker and a driver, a point of danger on the road that I consistently experience is simply checking one's shoulder. Drivers may cause irreparable damage to an individual if they are not cognizant of bike lanes, so they must constantly check their blind spots for pedestrians when making nearly any maneuver. Because of this, car manufacturers have developed technology to enhance this action, such as a system of sensors that alert the driver of any object within a given range of their car. While this is drastically helpful to drivers, bikers have been left behind in this sense. Bikers too must be constantly alert of their surroundings, yet have seen little to no high-tech advancement in regards to their safety, besides the latest developments in helmet design. While this may not be the most cutting-edge piece of technology, I do hope that it inspires at least a bit of advancement in the bicycling community.
Rear-Sense's creation comes from my experiences as both a biker and a driver. As a driver, it feels uncomfortable to drive near a biker, as I am afraid that they are unaware of my presence, susceptible to doing something that may cause an accident. As a biker, though it may be awkward, I find myself obsessively twisting my head over my shoulder, as I am in constant fear of a quiet car with a careless driver sneaking up on me and causing major harm. While blindspot mirrors may offer some aid to this issue, if you share a bike as I do with my siblings, all it takes is one simple readjustment to render the entire device useless. I created Rear-Sense to be a more present form of blind spot safety. By detecting objects within a few feet of a biker's rear and blindspot and alerting them of such, Rear-Sense offers bikers like me a bit of peace of mind on the road, giving bikers a better sense of their surroundings and the ability to make potentially life-saving decisions just a bit faster.
Supplies
General Tools and Equipment
- A 3d Printer (I used PLA)
- A Soldering Iron
- Female to Female Jumper Wires
- Thin Gauge Electrical Wire of Various Colors
- I/O Switch
- Electrical Tape
- Small Velcro Patches
Main Chassis
Alert Module
Print and Prepare the Body Components
Pictured above are the printed-out main body components of Rear-Sense and a render with the components installed to give you a sense of how the assembly will go. I am quite proud of them, as this is my first experience with creating complementary components in Fusion 360, so it took a bit of time to get the tolerances and snapping parts just right.
To get started with this project, you can just download and print the files I have attached below (I used Cura to slice the STL files, and scaled the prints to 1000%). Use whatever printer settings you please, but be sure to test to see if the components attach properly. The ultrasonic sensors should fit snugly into the front holes, the Arduino loosely into the top hole, and the battery pack should snap into the section of the backplate. The backplate should snap onto the main body and should take a bit of force to pry off.
Creating the Circuit, Part 1: the Main Body
Once you are sure that your 3d printed parts are of the proper size, it's now time to lay the electronics. If you wish to study how this circuit works more in-depth, please feel free to do a breadboard mockup to be able to get a better view of it and take a look at the explanation I have included as the last section of this step.
*** NOTE: The wiring diagram says it is using an Arduino Uno, but please still use a Nano. Tinkercad does not have Arduino Nanos, so I just used the pins on the Uno that the Nano also has.
Pictured above (and also attached below) is a wiring diagram of the whole device. The way I have been able to successfully wire this device is by placing the Arduino into its slot on the top level, then both trying to see which pin is which and counting the pins across to ensure that I am using the correct one. I suggest ordering the wiring as follows:
- Place the Arduino in the slot
- Attach each sensor's VCC and GND to the VCC and GND lever nuts respectively by cutting some red and black jumpers. Once wired, place into each respective slot.
***Be sure to make the red and black jumpers increase in length going from right to left.***
- Attach each sensor's ECHO and TRIG pins with a jumper to its pin in accordance with the diagram above. (Tinkercad doesn't have 4-pin ultrasonic sensors, so treat each connection as the ECHO pin and attach the TRIG pin to the pin before it. ex: Diagram says 'SIG -> D3, so attach ECHO to D3 and TRIG to D2)
- Solder the ground wire of the battery back to one lead of the power switch, then solder a second wire with a female jumper end to the opposite pin. Insert the switch into the housing once soldered.
- Wire the circuit as seen in the diagram above (be sure to attach the battery pack's power wire to VIN and connect the positive lever nut to 5v)
Once finished, flash the project code I have included below to ensure the circuit is working properly.
//////////////// Optional: How This Circuit Works //////////////////////
The entire circuit is powered by the AA battery pack. This pack wires directly to the Arduino, providing it 6v of electricity through the VIN pin. With the Arduino powered, we use the 5v pin to power all of our sensors and components, connecting the 5v pin to the lever nut, then attaching the rest of our components to the lever nut as well. We use the same concept for ground, creating a common ground by attaching all the sensors' grounds to one ground pin using the lever nut.
Creating the Circuit, Part 2: the Vibration Module
Now that the circuit has been laid in the main body of the device, it is now time to set up the vibration module. Print out the file attached below and be sure that it fits by inserting one of the vibration motors inside. It should be a relatively snug fit, requiring a bit of force to put in. You will also need three different color wire cuttings with jumper ends attached to one end (red, black, and green) to connect the Vibration motor to the main body once installed, so take a piece of string and run it from approximately where the main body will be installed to the rear left face of your bike seat to get the length required. Once you have your parts gathered, assemble them as follows:
- Solder the leftmost pin of the NPN transistor (with its flat side up) to the ground of a Vibration Motor
- Solder a 1k Ohm resistor to the middle pin of the NPN transistor, clipping the contact side to minimize the size of the object as a whole.
- Route your three wire cuttings through the hole on the side of the main body, with the jumper ends on the interior of the device.
- Solder your black wire cutting to the rightmost pin of the transistor, your red wire cutting to the red wire of the Vibration Motor, and your green wire cutting to the resistor.
- Insulate the transistor and the power wire separately (I wrapped each with electrical tape, but shrink tubing would be the most proper way to do this).
- Insert the assembled Vibration Module into the 3d printed body (file attached below, vibration motor should be held by a snug fit and the adhesive on the back of the motor itself)
- Attach a piece of velcro that is approximately the same size as the Vibration Module to the open face of the module
Check your work one more time, then once you are sure it is functioning properly, you may connect the front and back bodies.
//////////////// Optional: Why the Driver Circuit? //////////////////////
The ultrasonic sensors draw less than 2 Ma, so we can use the bare digital pin for a connection. The problem lies in the vibration motor; although small, it draws around 80 Ma. This is by no means a large amount but is still more than an Arduino can put out (around 40 Ma). To address this, we need to make a simple motor driver circuit. Using the NPN transistor, we are able to amplify the amperage output of the digital pin, having it act as something of a switch. Without this circuit, we run the risk of ruining our digital pin by drawing too much current.
Downloads
Attach the Device to Your Bike
Using the clip screwed onto the device earlier, place the clip onto the bike's body just above the wheel well. If you have a reflective light, you may want to move it up so that it will remain functional with Rear-Sense in place. Once it is positioned however you like, secure it in place using an M3 nut and bolt.
Next, take one side of a velcro patch and put it on the rear left face of your bike seat. Finally, take the complimentary piece of velcro, attach it to the Vibration Module, and stick that onto your bike seat as well.
Ride With a Little More Peace of Mind
And there it is! Your Rear-Sense has been fully installed! When used in conjunction with a rearview mirror, you will surely feel a greater sense of safety on the road. It's almost like having eyes on the back of your head! Before getting on the road, why don't you test it and see how well you've done in building it! To test it, stand around 10 feet behind your bike. Move slightly to your left until you are approximately in the bike's blindspot. If the device vibrates for the majority of the test, it should be good to go.
Thank you for reading this, and happy (and safe) travels! Please wear a helmet!!!