Step 6: 6 Make a box, get some batteries and put everything together

The project consists in a Arduino that gets the speed of the bike from a dynamo and it controls a laser which points always to the point where the bike is gonna stop if it continues going at the same speed.

Step 2: Step 2: Wire the dynamo in order to read the pulses it gives to the Arduino.

Make a single wave rectificator for the dinamo and make it give positive pulses out. Then conect these pulses to an analog entry.
For assuring that the dynamo is giving pulses correctly use the osciloscope.

Step 3: Step 2: Process the reading from the Dynamo and get the SPEED , ACCELERATION and DISTANCE

Get the data on the Arduino, and process de pulses in order to get the Speed, Aceleration, and distance depending on the pulses.

You need to acurate very precisely in counting the pulses and then calbulate the SPEED, ACCELERATION and DISTANCE.

Here you get the code.

// Bikeduino version 1
// Lets your bicycle point a laser at the spot where it will stand still if the deceleration remains constant.

// the angle at which servo is pointing horizontally
#define SERVO_STRAIGHT_ANGLE 140
// the amount of milimeters the bike moves in one pulse from the dynamo (measured)
#define mm_per_pulse 16
// the amount of milimeters the laser is above the ground (on the bicycle)
#define bike_height 1030

// the angle at which servo is pointing horizontally
#define SERVO_STRAIGHT_ANGLE 140
// the amount of milimeters the bike moves in one pulse from the dynamo (measured)
#define mm_per_pulse 16
// the amount of milimeters the laser is above the ground (on the bicycle)
#define bike_height 1030

Step 6: 6 Make a box, get some batteries and put everything together

Hi, <br> <br>I had the chance to pay visit you guys a short vizit on September 22. <br> <br>I'm glad to see it worked out great. <br> <br>Keep up the good work!

cool, do you have a video of this in action? how did you calculate the distance to break?

They calculated the speed of the wheel by reading out the dynamo. If you know the by which rate your speed is decreasing and you know the distance you advance between each pulse. you can easily calculate the distance where the time between the next pulse will be infinite.

This is interesting, <br>Some may over look it being that its on a bike, but I would suggest that its just as useful on a motorcycle / scooter, or even in a car. A simple crash avoidance detector maybe, anyway you are young and seem to have good ideas keep it up! <br>Hankenstien <br>Rduino.com