In the course of a conversation with a friend they have mentioned that they want to dim some after market LED lights that they've recently fitted to their motorcycle, and I've said that I can probably do something to help. However, my friend has now taken me at my word, and told me to put my money where my mouth is ...
So, my questions are how to make this all work.
The first issue I see is the power voltage for the Arduino, and I've found a thread here explaining how to deal with that ... Powering Arduino at 5VDC off 12VDC circuit ... so that's all good.
Next, I'm happy enough with the idea of using the Arduino to dim an LED circuit using PWM, but at this stage I'm not sure about how to specify a suitable "relay" that will be able to switch the 12V (say 5A) circuit at the frequency that the Arduino will switch.
I've seen lots of articles on the 'net describing the use of relays, but I'm guessing that a typical mechanical relay won't be able to do the job, also I've seen a few articles mentioning transistors to control the switching, but to be honest, I'm a bit lost.
Therefore, I'd welcome any guidance on my basic understanding of what I'm trying to achieve, and also some suggestions on how to switch the 12V circuit.
Basically you could try to have the arduino control each LED individually or have a row of LEDs controlled together.
The question is how are you going to hold them on the bike... I suggest looking at strips of LEDs from a cheap site and modulating the power to the strip.
nilton61:
You cannot use PWM on a relay. The relay is much too slow for that.You will have to use a transistor switch (bipolar or preferable MOSFET)
Thanks, that's what I thought ... care to elaborate / tell me more about how to use transistors/MOSFET's ... 8)
Any links would be much appreciated.
james13:
I looked at doing that for my CBR1000RR..
Basically you could try to have the arduino control each LED individually or have a row of LEDs controlled together.
The question is how are you going to hold them on the bike... I suggest looking at strips of LEDs from a cheap site and modulating the power to the strip.
My mate's got a pair of after market LED lights fitted, and from memory each unit has 4 LED's within the body of the lamp, which is in effect a mother of a heat sink, and after riding his bike "cages" do seem to pay an awful lot more attention ... ;D
However, yes I know I can modulate a signal/trigger using the Arduino, but I need help with figuring out what to use to switch the power ... it can't be rocket science, but I really don't know much about what options are available, or even if I'm approaching the problem in the right way.
You can set R3 and R4 in that diagram to whatever suits your needs. e.g. if you need 30 mA running through the LED (the datasheet will tell you what you need), set R4 accordingly. The resistor for B doesn't need to be big but it needs to be there. You don't really need to do math for this one except for setting the forward current through the LED and making sure whatever current you feed into B is acceptable to turn the transistor on.
I've also mounted LEDs on my bike......er, bicycle in my case, lol. Works great! If I'm riding at night, I go from cars almost touching me when the lights are off to cars actually changing lanes when the lights are on. I'm just running a neopixel strip on my butt, basically, at full brightness. It's hilarious seeing the difference in how people drive around me when they're on.
It's hilarious seeing the difference in how people drive around me when they're on.
Thanks graymalk,
I've had a quick look at the links, and I'm now feeling much more confident about how to progress ...
Keep it safe out there on the roads. For all you folks in cars, keep your eyes open and on the road (not your phone), for us on two wheels, keep your eyes open and keep the shiny side up ... 8)