Let's be real, this campus is full of bikers, and it can be difficult to see them when they are zooming down Locust or Spruce Street 30 miles an hour. We decided that it was time to make this campus a little safer and while also adding a touch of pizazz to it. It is wild to hear from our friends that they have either been hit by a bike or come close to it so, we decided to build Speed Blights to increase visibility and safety not only for the biker but for the people around him or her as well.
What It Does
Speed Blights, the ultimate LED light system for your bike. This smart LED light system will make you glow on the road, making it safer for you to bike across campus or wherever you go. With better visibility with these lights implemented, you can be sure that you will be much safer on the road. Speed Blights will automatically dim or get brighter depending on how dark it is outside. The light sensor we have incorporated into the system will read the amount of light outside and will project the correct amount of brightness for the LED lights. Our second sensor is an accelerometer that is able to track your position, velocity, and acceleration. Depending on how fast you are traveling, the lights will change colors faster or slower. To communicate the data between sensors, we used HC05 Bluetooth modules. Each Arduino had one module and the two were paired so the data would be sent to the LED lights. Together, this colorful smart system will make any bike look amazing!
How We Built It
Since each LED pin may end up requiring an Amp or more to sink to the ground, power transistors are required. Directly connecting the pins to them Arduino will burn them out. We used a MOSFET to ensure the transistor is rated to be able to pass as much current as we needed. For example, since we draw about 0.2Amps per channel per meter, if you have a 16.4ft strip (such as ours) you will need to pass up to 1 Ampere per transistor. We also realized very soon that the 5V from our Arduino was not sufficient enough to power the LED strip lights, thus we invested in a 9V battery and connected it to the Arduino so that Vin supplies the high voltage to the LED strip.
Once we wired everything up, it is easy to control the color of the strip by using PWM output. For Arduino you can use analogWrite() on pins 3, 5, 6, 9, 10 or 1. An analogWrite(pin, 0) will turn that LED off, analogWrite(pin, 127) will turn it on half-way and analogWrite(pin, 255) will turn it on full blast. These values will later be complemented with the light values from the photoresistor to determine how bright or dim the lights should be.
Next, we moved onto configuring the photoresistor. The resistance of a photoresistor decreases with increasing incident light intensity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits. After the board was wired accordingly and implementing the code to read the light values, we recording the min and max values for when it was fairly bright outside and when it was very dark. These values were crucial in determining when the light intensity would change.
Additionally, we incorporated an accelerometer to the system to read values of position, velocity, or acceleration. Wiring the accelerometer to the breadboard and Arduino was fairly easy. We then proceeded to write code to print the x, y, and z acceleration values printed onto the serial monitor. Similarly to the process of the photoresistor, we recorded the maximum and minimum values that get printed while standing still, holding the accelerometer in different orientations and moving it around. These values were then implemented into the master code that controlled the behavior of the LED strip lights to ensure that the colors would change accordingly.
Lastly, our Bluetooth component of the system was catered by two HCO5 Bluetooth modules. We obviously could not upload two codes to one Arduino, thus, we had to use two Arduinos, one for the LED lights and photoresistor and the other for the accelerometer. The two Bluetooth modules needed to be paired first. We were able to determine that the two Bluetooth modules were sufficiently paired when the red light on each one of them started to blink in sync. Once the Bluetooth modules found each other, data was able to transfer across systems swiftly. However, that would not be the case since the modules were very glitchy and finicky. (See "Challenges We Ran Into). In the end, all you needed was a big battery pack to power the Arduinos and once the system was strapped onto the bike thanks to some duct tape, Speed Blights was ready to roll.
Challenges We Ran Into
The main challenge we faced trying to configure the Bluetooth system to our design. It was very difficult to work with a new Bluetooth component that we have never used before. The HC05 Bluetooth modules proved to be a little difficult to work with. Pairing them took a long time, gathering their serial numbers and checking to see if they were able to find each other was very difficult. Once we saw their lights blinking in sync we were elated and thought we had finally got it down. However, data was not able to be transferred to one Arduino to another. We kept getting a Serial B: 0 error message which meant 'false'. Sadly, it was the farthest we went with our Bluetooth component.
Another small challenge was strapping the design onto the bike. We almost ran out of space on the bike to put all our breadboards, batteries, and Arduinos on it.
Accomplishments That We Are Proud Of
We are extremely proud of learning and attempting to implement a whole new Bluetooth component to our system. Going into this project, it felt daunting and although it was a very grueling process, the learning process was very rewarding.
What We Learned
The biggest takeaway from this project was definitely learning how to be patient with trial & error. We learned how to adapt when one thing did not always work. There are always multiple ways to design a system and it took a long time to realize that sometimes the best option may be the simple option, not all great systems have to be complex.
What's Next For Speed Blights
For future reference and improvement, Speed Blights can definitely use a makeover on the design, and if possible a different Bluetooth component can be utilized for the smart system. Speed Blights are just the foundation for greater possibilities. For example, one could design the system to become waterproof so a person can bike in the rain with no worries.