##There’s no new blog posts until Saturday because I am at the coast. Doesn’t mean you can’t still enjoy the old ones. 🙂 ##
This morning I was riding behind someone when they were hit by a car and it made me think about how I might be able to make something that can prevent further bicycle vs motorist incidents. I came up with a very simple and easy to make circuit called the Leanlight.
The Leanlight is a simple circuit that accepts 7-12V batteries. It lights up a bright light when the rider leans their bike to turn. The leaning motion of the bike is detected by a simple circuit with a tilt switch. The Leanlight is easy for anyone to make and use.
Let’s start by looking at what parts you’ll need to make this simple project:
- Some prototyping copper stripboard or veroboard. This is what I mean:
- 1 nice bright LED. Choose any colour as long as it’s bright and easy to see.
- 1 220 ohm resistor. You may need a different value depending on what LED you’re using. Check the datasheet for the LED.
- A tilt switch. I’m using a rolling ball type. See here for more on these devices: http://www.ladyada.net/learn/sensors/tilt.html .
- 1 7805 voltage regulator.
- 2 10uF capacitors.
- A half decent soldering iron.
- Some wire strippers.
- Some wire cutters (mine are built-in to my wire stripper).
- You will also need something for cutting the veroboard. I’ll be using a dremel with a flexible shaft and cutting attachment.
Let’s get started
So now that we have the parts gathered we can make a start on a prototype. You don’t need to make one of these before soldering up a Leanlight as I’ve already done the testing for you. However, it might be a good idea to make one just to check that your components are working. You’ll need a solderless breadboard to do this.
This circuit uses a 7805 voltage regulator to power an LED that is switched on and off by a tilt switch. The circuit accepts anywhere from 7-12V DC input voltage. The power supply circuitry is stolen from this tutorial: http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard .
You may notice in the fritzing vero board diagram above that the tilt switch is not green and both the tilt switch and the LED are wired off the board. This is to allow for a flexible setup when attaching this thing to a bike.
Laying out and soldering the veroboard circuit
I’m roughly following the layout I made in Fritzing as it has been checked with the schematic automatically (a Fritzing feature). I will however compress it slightly as you will see. Feel free to come up with your own creative layouts. Or to use multiple LEDs to indicate different turn directions. I don’t have two tilt switches so I can’t build one of those.
Let’s start by laying out our basic components:
As I said above, you can lay out these components in any way you wish. As long as you follow the schematic accurately. Then solder them to the board using a good quality soldering iron. Make sure you have a window open or some other form of ventilation as solder fumes are dangerous to your health.
The next step is to solder the LED to the board. Make sure it is around the right way i.e. the short lead soldered to the capacitor’s copper rail if you follow my layout.
Now is a good time to test your circuit. Do this by soldering some power wires to the board and connecting the LED to the resistor using a scrap of wire as shown below.
So all good so far. if you can’t get the LED to light up, check your circuit with the schematic and check that you’ve soldered everything in correctly. Also, check to see that you have the power connected correctly.
Now solder the tilt switch to a small bit of veroboard.
Cutting the board
Now it’s time for the high pitched, noisy and dangerous part. I’m not planning on having a book sized piece of board hanging off the back of my bike so I’m going to need the cut the board. I’ll be using a dremel to do this. You’ll need something to clamp the board to so it is secure when you’re cutting.
Oh and you’ll need a pair of safety glasses if you dremel is prone to coming apart at high-speed like mine is. They’re essential for safety. And for looking extremely silly.
You want to cut the board carefully as you could damage components with one wayward swipe (my nice blue LED now has a nice big scratch). You also don’t want to damage the copper rails on the board because they’re what makes the whole thing work.
So now we have the two modules cut out, all we need to do is wire them up. This is the last bit of soldering to do.
Now all that is left to do before fitting the unit to a bicycle is one last test.
Here’s where the power circuit integrated into the board is useful. This project accepts any voltage from 7-12V so you can use any battery that is within that voltage. I’ll personally be using an RC plane battery as it is light, fits underneath my seat and will last for ages. Plus I don’t have to pay for new batteries each time it goes flat. The battery is rechargeable using a special high powered charger.
Well that’s about where the tutorial stops because everyone’s bike is different so it is hard to give you a one size fits all kind of installation guide. It’s generally pretty easy to do though. Here’s some photos of the Leanlight on my bike.
That’s the simple operation of the project. Cyclists lean when they corner and this light detects this and turns on a blue warning lights telling motorists what they’re about to do. I’m going to see how my cycling group reacts to this next week when I show up with this. It’s going to be interesting. I’m more than happy to make them for people in Canberra and they would cost under $10.
Oh yeah, and thanks for all the pageviews today Ladyada!