This project was a part of the Home Automation assignment in the Lane Tech PCL course.
SummaryI wanted to be able to toggle an electronic bike horn and bike light on/off with a distance sensor, and be able to detect when cars were approaching my bike from behind. I also wanted a notification to be sent to my phone to indicate when a car was approaching. This allows me to be a safer bicyclist, as I will hear the audio cue from my horn, the car will see and hear the light and horn, and I will see the notification on my phone.
ProcedureDistanceSensor
I started by figuring out how to work with the distance sensor. I did this by making a simple circuit that had an LED light up when there was an object within 10 centimeters of the sensor. After setting my only sensor up, I moved on to the physical components of my project.
BikeLight
I needed a way to control the bicycle light that I already owned. To do this, I decided to use a servo to physically push the button-- I didn't want to permanently modify the light, so a servo was the clear choice. I attached a servo to the light with hot glue, and removed the silicone end cap over the button on the light to make pressing it more consistent.
BikeHorn
With the light set up, I then started working on the horn. The horn had a detachable trigger, as shown in the image below.
As my bicycle horn was already broken, I was comfortable with trying to salvage it for the project. When I plugged in the trigger initially, the horn would turn on and the button would not have any functionality for toggling the horn on or off.
I observed that the problem was likely due to a kink in the cable. I removed the plastic around the button, and saw that the button was just connecting the two cables in the detachable trigger.
With this in mind, I cut the cable of the horn trigger before the kink, and stripped the wire. I then soldered two wires to each cable.
In order to control the horn with my photon, I decided to use a relay. This allowed me to flip a switch electronically to connect the wires and disconnect them, turning the horn on and off.
NotificationstoPhone
I utilized the pushover app as the particle community integration docs has instructions for integration with the photon.










Comments