Control unit for the bike electrics using arduino and relays

This is an other side project for my bike build. For the clean and tidy appearance of the bike I’d like to use minimalistic switches on the handle bar. And to use them I need a control unit, that does all the switching of the higher currents.

Properly the easiest and cheapest way to do that is with a small microcontroller and a relay card. And thats what I’m prototyping at the moment.
Here is, how I imagine the circuit:

Just thought, maybe it's a good idea to connect the 12 to 5 Volt converter after the fuse box ...
Just thought, maybe it’s a good idea to connect the 12 to 5 Volt converter after the fuse box …

 

I’m using an arduino nano and a relay card, I bought for cheap on ebay. After I bought it I figured out, that it’s a clone of Sainsmart relay card. Anyway extremely cheap and it can switch up to 16A AC and 10 A on 12V DC. Definitely good enough for what I need. After connecting it for the first time it did not work. Then I figured out that the inputs are inverted. I mean the relay is switching, when the logic input is connected to ground. That is good to know.

At the moment I’m writing the code for the standard functions, like light, high beam, indicators and so on. The next step will be the integration of a start/stop button – single button. I guess that will be a little more complicated. The plan is to read the voltage in order to figure out if the engine is running or not. A bit of a concern I got about the drop of the board voltage when the starter is running. Somehow I got to make sure, there is enough left for the arduino and the relay card. The DC-DC converter I got can handle an input between 8 and 22 Volts. But what if when starting the engine the voltage drops below 8 Volts? Maybe a big electrolytic capacitor on the 5 Volt circuit will to the job. But to figure that out, I need to have the engine running first.

That’s what I’ve got for now :

sketch_mar17a.ino

Control unit for the bike electrics using arduino and relays
Tagged on: