Hi all!
i must confess, i have VERY limited knowledge regarding electronic components so i really need some help on this one...
The project is fairly straight forward, a arduino nano is the main brain, witch is supposed to take input from a handlebar-mounted button box and turn on/off front and rear lights aswell as control turn indicators.
The idea is to use "standard" battery-operated bike lights and merely replace the switches with some sort of relay.
I belive im forced to build my own turn indicator led arrays (since i cant find one that uses less than 12v) but it will still require way more power than the arduino can provide, meaning i will probably need some sort of relay for the turn indicators aswell.
there will also be a brake light function.
The idea is to install some sort of switch on the brake handles, something that would disconnect the circuit as soon as the brake handle is moved (before actual braking occurs).
suggestions on this topic are also greatly appreciated!
I will install a separate led diode as a status indicator for the turn indicator (a small green led on the handlebar that glows (or blinks) if any turn indicator is active.)
So to simplify; i will be using 4 inputs and 5 outputs.
Input;
turn left
turn right
lights
brake sensor
output:
turn left
turn right
turn indicator led
lights (a Y-cable (one cable from the arduino that splits to both front and rear lights) should suffice?)
brake light
i would like to know what electronic components i would need for this project but i havent the faintest idea of what i need or how to find that out...
The only thing i know is that there will be 3 or 4 battery packs available, one in the front light, one in the back light, one for the arduino and possibly one for the turn indicators.
And that the only relay im familiar with (a "standard" car turn indicator relay) is way to big and demands too much voltage.
The Nano can easily take care of blinking the turn signals. No need for relays anywhere as you can drive the lights with MOSFETs controlled by Nano digital outputs. Pick your LEDs. Once you know how many LEDs and their current requirements you can specify the transistors and power supply(s).
Ive got some real studying to do to grasp the concepts of MOSFETS and stuff, but it feels impossible to have the tiny arduino to power several leds on the same output.
i really cant decide between one led or the other since i dont know any better but i would like to have about 6 turn indicator leds on each side, 12 in total.
i have been searching for bright orange diodes but havent yet found any that "smells" right..
on top of those 12 turn indicator leds i would like one small led (green preferably) as a turn status indicator on the handlebar, that would blink when any direction of turn indication is active.
each side would use separate output pins on arduino.
Im not sure if the cable lenghts between the arduino and its functions matters, but the bike is about 2, 2m long, so there will be about 2 metres between the rear and front turn indicator and between the front and rear positioning lights.
My problem is not the size of the resistors, i have a web-based calculator for that (found here)
My big issue is all the other bits of the project, how to connect the front and rear lights switches aswell as the handlebar button unit to the arduino.
but as stated earlier, the front and rear position lights (headlight and tail light) are normal bike lights with internal batteries.
i have two types of front light, one with a slide switch (on/off) and one with a simple push button.
i could use eather of the two front lights, or even both if i so desire.
the rear light has a 3 way switch, on/off/blink.
I would be very happy to use ON as position light and use blink as brake light.
I still cant figure out howto connect the position lights to the arduino..
my logic dictates that i need to connect pin a and b on the switch thru some sort of relay but prehaps there are other, similar electronic components that take less space/weight/voltage?
Switch DC loads is straightforward - but you do have to connect the negative
of the battery pack to Arduino ground. Its simplest to use low-side switching(*)
with n-channel LOGIC LEVEL MOSFETs or NPN switching transistors.
Posting some details / photos of the lights you want to interface to here should
help you get feedback about doing this.
(*) With low-side switching the light battery voltage can be anything, doesn't have to
be 5V, can be more or less without problem. If the physical switch isn't already in
the low side (between battery -ve and lamp/LED) then you'll have to break the circuit
there.
sorry about the image sizes, i dont know howto make forum size pictures that can be enlarged...
as previously mentioned, there are 2 front lights, i aim to use just one of them.
and for clarity, lets call the lights (from left to right) retro light, pico light, rear light.
Well several of those already have controllers wired into the circuit, which need
disconnecting alas - alternatively you can figure out the switch wiring that goes to
each controller (several flashing modes, presumably), or you can break-out at the
-ve battery terminal - again cutting traces needed
I'd sort of forgotten that LED bikelights tend to have flashing modes (non of
which are technically legal in the UK except for turn indicators).
If you're prepared to irreversibly modify them, just treat as a battery and LED,
break out at battery -ve. If you can fit a logic-level n-MOSFET in the case then its
source -> battery -ve,
drain -> LED cathode.
bring out source and gate as a twisted pair or screened cable back to arduino.
At arduino end gate via 150 ohm resistor to a digital/PWM pin, source to ground.