Build an LED blinker circuit for my motorcycle

Driving and riding in Hua Hin and Thailand, all topics on cars, pickups, bikes, boats, licenses, roads, and motoring in general.
SPONSORS: Bike Rental Hua Hin
Post Reply
Buan
Novice
Novice
Posts: 1
Joined: Thu Feb 01, 2018 2:20 pm

Build an LED blinker circuit for my motorcycle

Post by Buan » Thu Feb 01, 2018 2:50 pm

I'm building a (LED) blinker circuit for my motorcycle. It will have the basic on/off blinking for left and right (J1 & J2) and an "emergency" mode (J3) for more "aggressive" LED blinking, which will increase the visibility when driving between lanes during traffic jams.

J1, J2 and J3 are the inputs for the switches (L, R, both). J5 and J6 are the outputs to the LED blinkers. J4 and J7 are GND and +12V from the motorcycle.

There's a ATTiny45(http://www.kynix.com/Parts/160190/ATTINY45-15MT.html) which reads the inputs L or R. If both are high, it will go into emergency blinking mode. It uses two output pins with pulses that will blink the LEDs. (if anyone is interested in the code, I'd be happy to share it).

Now, the circuit works on my breadboard (and I hope I correctly transferred it into Fritzing). But since this is my first project in electronics I have a ton of questions and doubts. Now, I'm not asking you guys to review my project (however, would be appreciated), but want to focus on my biggest question for this circuit, the isolation between the "dirty" 11-14V inputs and the "delicate" ATTiny micro controller.

On the input side I've used an opto coupler. But I'm actually wondering if this de-couples anything, since there's a common ground.

On the output side I've used transistors + MOSFETS. I couldn't drive the MOSFETS directly, although I forgot why. I'm wondering if it's not safer to use an opto coupler here in stead of the transistors.

All parts used are in the diagram.
yohRN.png
yohRN.png (46.77 KiB) Viewed 639 times
Not sure if it matters much, but the environment on a motorcycle is relatively hostile, vibrations, voltage spikes, etc.

I hope I didn't make too many stupid mistakes! Many thanks for your input!

Thanks

User avatar
Nereus
Addict
Addict
Posts: 7068
Joined: Tue Jan 02, 2007 3:01 pm
Location: Hua Hin and Bangkok

Re: Build an LED blinker circuit for my motorcycle

Post by Nereus » Fri Feb 02, 2018 11:34 am

Hmm, a bit of a strange first post. You may be better off finding an electronics enthusiast forum on the internet.

I am a retired heavy industry electrical and marine engineer, not electronics per se. But many years experience with systems using optical isolators and transistor switched control and alarm systems. I cannot see much basically wrong with your circuit, although a bit confused by the label under R1 and R4 concerning the LED? Also, do not have your concerns about the common ground. The 5 volt regulator should keep the electronics isolated.

I would be more concerned about the environment than any "spikes" on the raw 12 volt supply. All of the components need to be in a sealed plastic box with just input and output terminals externally. Good luck.
May you be in heaven half an hour before the devil know`s you`re dead!

User avatar
J.J.B.
Guru
Guru
Posts: 921
Joined: Sun Jul 22, 2012 10:03 pm

Re: Build an LED blinker circuit for my motorcycle

Post by J.J.B. » Fri Feb 02, 2018 2:34 pm

I applaud the industry, I nearly melted in the heat just fitting an LED system to my moped. I fitted a pre-made system that I’d imported from the US via the UK.

More details here https://admorelighting.com/photo-gallery/

If you see a PCX with a Givi box on the back with plenty of LEDs, it’s probably me. Or someone’s stolen my ride.

:thumb:
"A man who does not think for himself, does not think at all."
Wilde

User avatar
Pagey
Ace
Ace
Posts: 1963
Joined: Mon Aug 30, 2004 5:14 pm
Location: On the beach

Re: Build an LED blinker circuit for my motorcycle

Post by Pagey » Fri Feb 02, 2018 3:36 pm

J.J.B. wrote:
Fri Feb 02, 2018 2:34 pm
If you see a PCX with a Givi box on the back with plenty of LEDs, it’s probably me. Or someone’s stolen my ride.
:thumb:
So was it you riding slowly down Soi 94 just after El Toro Loco just before lunchtime today?

I was trying to determine if the lights on the Givi were indicating right or left as they were both/all flashing as you appeared to be looking for somewhere. :thumb:
'If you didn't have a wasted youth you wasted your youth'

Man in pub circa 1987.

User avatar
Nereus
Addict
Addict
Posts: 7068
Joined: Tue Jan 02, 2007 3:01 pm
Location: Hua Hin and Bangkok

Re: Build an LED blinker circuit for my motorcycle

Post by Nereus » Fri Feb 02, 2018 3:37 pm

If you see a PCX with a Givi box on the back with plenty of LEDs, it’s probably me.
Is it a pink colour? :rasta:
May you be in heaven half an hour before the devil know`s you`re dead!

VincentD
Ace
Ace
Posts: 1067
Joined: Tue Jun 22, 2004 4:04 pm
Location: Bangkok

Re: Build an LED blinker circuit for my motorcycle

Post by VincentD » Fri Feb 02, 2018 7:59 pm

Interesting as a project but in practice would advise getting a commercially available one, they are typically designed to directly replace whatever was there in the first place and be compliant with the law.
There are certain shades of amber and red suitable for traffic; not all would comply. Also note that failure of a LED in a typical array would mean a whole missing string aka 'black hole'. Also commercially available LEDs are not the top grade (we did try conversion of incandescent non-critical wayside signals to LEDs and the LEDs were special order).

The other thing I hate about retrofitted LED signals (especially those brake lights that go through a flashing sequence before turning full on) is that even a touch on the brake pedal sets off the sequence, and this doesn't stop till it completes the cycle. Very annoying.

Good luck with it and have fun, I know I did way back when with 12V circuits and discrete components, though I think MOSFETs aren't the best things to use in a fairly hostile environment that a motorcycle would be exposed to.
วินเชนท์

User avatar
J.J.B.
Guru
Guru
Posts: 921
Joined: Sun Jul 22, 2012 10:03 pm

Re: Build an LED blinker circuit for my motorcycle

Post by J.J.B. » Sat Feb 03, 2018 3:27 pm

Pagey wrote:
Fri Feb 02, 2018 3:36 pm
J.J.B. wrote:
Fri Feb 02, 2018 2:34 pm
If you see a PCX with a Givi box on the back with plenty of LEDs, it’s probably me. Or someone’s stolen my ride.
:thumb:
So was it you riding slowly down Soi 94 just after El Toro Loco just before lunchtime today?

I was trying to determine if the lights on the Givi were indicating right or left as they were both/all flashing as you appeared to be looking for somewhere. :thumb:
Not me as I’m in Blighty but could be my friend who keeps the bike in his garage and uses it from time-to-time in order to keep it running. Not sure what he’s doing on Soi 94 and even more surprised about him being up before lunchtime so maybe someone has stolen my ride! :shock:
"A man who does not think for himself, does not think at all."
Wilde

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests