Bike Alert




Introduction: Bike Alert

About: I am an author and a maker. My current project is Santa's Shop. I'm working on a science fiction type book--more later. @EngineerRigsby

This morning, while riding my bike, I thought, "Wouldn't it be nice to know when someone is approaching from behind?" I didn't want to use mirrors or funny glasses, so I decided to use an ultrasonic transducer to trigger a buzzer when approached.

This involves a Ping transducer, Arduino, buzzer, switch, 9 volt battery and enclosure.

Thanks to the world of 3D printing, these things don't have to be force fit into a black box anymore.

For the design and print files of the box (created in Autodesk's 123d software--free):

Step 1:

I started by piling the major components together to see what sort of space it would take.

Step 2:

I followed by creating a box--sort of banana shaped instead of rectangular.

Step 3:

I added the transducer, buzzer and switch.  I didn't get my spacing quite right on the transducer, so I just fit one of the elements into one of the box holes.

Step 4:

The wiring is fairly minimal, just follow the schematic.

Here is the code for the Arduino:

const int pingPin=7;

long duration;

const int buzzer=3;

void setup()



void loop()

{pinMode (pingPin, OUTPUT);

digitalWrite (pingPin, LOW);

delayMicroseconds (2);

digitalWrite (pingPin, HIGH);

delayMicroseconds (5);

digitalWrite (pingPin, LOW);

pinMode (pingPin, INPUT);

duration = pulseIn (pingPin, HIGH);

if (duration > 12000 and duration < 20000)

{digitalWrite (buzzer, HIGH);


digitalWrite (buzzer, LOW);






Step 5:

Connect everything together and close the lid with a wood screw.

Step 6:

Secure to your bike in whatever way is appropriate--I use velcro.

Bikes and Wheels Contest

Participated in the
Bikes and Wheels Contest

3D Printing Contest

Participated in the
3D Printing Contest

Be the First to Share


    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge
    • Make It Modular: Student Design Challenge

      Make It Modular: Student Design Challenge
    • Origami Speed Challenge

      Origami Speed Challenge



    8 years ago on Introduction

    When I am ready you will be the 1st to know my friend ! Until then I will keep learning from the Pro's !


    8 years ago on Step 6

    Great idea Mike ! I like your custom enclosure too are the man with the 3d printer!
    I always enjoy your creative projects ...keep them coming and many thanks for sharing.


    Reply 8 years ago on Introduction

    Thank you! They have some really cool prizes in the "Bikes and Wheels" contest, so I thought I'd give it a shot.
    Hopefully, you can document and publish a project one of these days :)