Automatic Bike Indicators

Updated 31 March 2022

This project uses an Accelerometer to detect when you are leaning left or right. Depending on if/where you are leaning, it will flash LEDs on the right or left of the bike's rear. Powered by an Arduino and a 12v battery pack (my case 8 AA Batteries). I have made a video on it below.

Here is the code you'll need to build your own.

What You'll Need

Step 1: Soldering the Accelerometer Headers

The first thing we have to do is assemble the accelerometer. Put the headers in the breadboard, apply solder and your done.

Image credit: Adafruit

Step 2: Wire it up.

Using the video above, or the wiring diagram below, wire the accelerometer, LEDs, and Arduino.

Step 3: Program the Arduino

Use the code attached below (Latest version) to wire the Arduino up.

There are these two lines which may need adjusting, line 161 and 162

if (event.acceleration.x > 2.5) { lBlink(); lBlink(); } //see if we are leaning to left, if we are, blink
if (event.acceleration.x < -2.5) { RBlink(); RBlink(); }// see if we are leaning to right, if we are, blink

Keep the majority of the code the same, and adjust the 2.5 to whatever sensitivity you want (note, you need to keep the minus on line 162)

Attachment - Project Files

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.