MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
I know enough about electrics to be dangerous but need some help - I'm trying to set up a PWM to dim the high beam circuit independently on a Honda motorcycle. LED lights.
Main issue is that my PWM alters the ground output not the positive, and of course an LED always works one way only and the ground is always connected. So although in practise and isolation the PWM actually works flicker free with the LED I have it's not simple to set up as I'd hoped with a separate switch and a relay simply tapping into the high beam positive supply but leaving the main OEM high beam switch/circuit untouched.
Main issue being the ground supply is one line into the LED headlight unit - you cannot break or split this or you get no other lights working as intended.
I'm using this basic PWM at present.
I just need similar that pulses the + not the -.
https://www.amazon.co.uk/gp/product/B07RG9P29L/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1
It's confusing what you say about the PWM board altering the ground output. It appears to have a +ve and -ve input for power to the board, and then a motor +ve and -ve output. Are you saying the motor outputs are inverted relative to the input or something?
Maybe a circuit diagram of how you're trying to hook everything up would help.
A circuit diagram would be most helpful, but it doesn't seem too tricky to use the main beam feed to control a relay to switch the PVM unit into the earth circuit of the light. The bigger question might be, why? If you don't want the brighty lighty, don't turn on the brighty lighty?
Thanks Tom, basically the motor output (to my LED) affects the - output only. And as I can only easily tap into the + supply to the LED it has no affect. Please excuse the shoddy sketch and ignore the green - line (dimmer to high beam) as this is not workable.
This is an even more shoddy diagram of the OEM wiring.
Thanks crogthomas - it's one of those annoying 'Cyclops' set ups with two lights (dipped/main) and halos but only dipped used as DLR so many bikers like to even it up by dimming the main beam as it were to even things up but not blind others too much.
But this needs to be a separate circuit so you can still hit high beam as normal with the OEM switch to give full output when needed.
can you not just reverse the polarity of everything including power in to the PWM unit? I confess I'm not an electronics expert, but I [I]have[/I] been messing around with PWM light dimming via microcontrollers lately!
Would be a doddle to build you own unit for about a tenner to do exactly what you want using an Arduino or similar (I am using ESPs) - appreciate that would be a bit of a learning curve though if it's not the sort of thing you've done before!!
I don't think that is possible or would work - it has reverse polarity protection on the PWM anyway according to specs?
In which case could you use something like a MOSFET... your PWM device pulses the input of the MOSFET (presuming the polarity doesn't matter there?), the output of which is connected to your positive?
What you need to look for is a high side PWM dimming/switch circuit, (which is designed to interrupt the positive supply to the thing you are powering) rather than the low side PWM dimmer you currently have (which interrupts the negative supply line to the thing you are powering). The LED lamp shouldn't really care less if it is turned off by the negative or positive supply line being disconnected but would likely get very upset if you reversed the supply polarity.
This shouldn't be too difficult to design but I'm not sure how easy it will be to find an off the shelf module you can use on your bike.
Thanks guys, super helpful. bigginge - they must be available off the shelf but I'm struggling to find something.
Zilog - thank you, it's going beyond my knowledge but would it work something like this?
Sorry, I’m a tinkerer not a theorist 😂 if I had your device in front of me I’d hook it up on the bench and tell you in 2 mins whether the idea was a goer or not 😀 Hopefully someone more experienced could chime in as to the suitability?
Your PWM unit is probably an H bridge. See https://en.wikipedia.org/wiki/H-bridge
PWM = ON means your OP+ is 12V and OP- is 0V (this turns the LED ON)
PWM = OFF means your OP+ is 0V and OP- is 12V (this turns the LED OFF)
As you say this works well with just the LED across the outputs but your LED in your bike is connected to 0V (which will be connected to 12V when PWM = OFF).
The solution (as you have it above in your last diagram) is to just use the OP+ to drive the LED and don't use the OP-. Now you have an output that drives current into your LED or not. LED current has a return through its 0V connection.
I very much doubt it would be an H-bridge, but it might be. We would really need to know the model number of the PWM circuit to see that. If it is H-bridge then @servo's solution is nice. From what you have described it sounds like the + of the LED is normally meant to connect to the + output of the PWM and - of the LED to the - output. What you are seeing is that the - output is dragged to ground when the LED should be on
What you need is as bigginge suggests, a PWM circuit that works the other way round. That is the safest thing to do
What Zilog6128 suggests would also work, which is to use a mosfet on the -output of the PWM to invert the drive. The mosfet would need a pullup resistor on the input to make sure it was off when it was meant to be off (probably 10k is good enough) and a flyback diode across the the output to cope with any inductive spikes from cabling (although if you are using a mosfet module this may already be built in)
Safest is to go for the bigginge solution and find a PWM circuit that works the right way round
Separate thought, check that your led doesn't have a current controller built in to it to regulate and is actually dimmable.
K - yes all tested and it is dimmable.
Again, awesome knowledge base on here.
I just searched up 'mosfet' on eBay to get the drawing.
https://www.ebay.co.uk/itm/224372484519
servo - not sure which diagram you are referencing? - are you saying my latest sketch (with added mosfet being controlled by the PWM and using + output from that to high beam LED) is the way (in the absence of finding a PWM that varies the +)?
I was not clear on the part here specifically: "The solution (as you have it above in your last diagram) is to just use the OP+ to drive the LED and don’t use the OP-. Now you have an output that drives current into your LED or not. LED current has a return through its 0V connection."
In layman's terms the LED always has ground connected (and I cannot change this) and as my PWM varies ground (not +) to switch my PWM is ineffective of course.
In your last drawing you had just the +ve output connected to your LED and the -ve output not connected. I didn't realise you had changed the device on the right to a mosfet. I managed to get the link to the ARCELI 12V-40V 10A PWM but it doesn't say much about the signals. As you know, you really need just a single ended output to go 12V or 0V with the ratio set by the PWM. I thought that your output +ve could do this.
that mosfet that you linked to won't work as far as I can see. It just works in the same way as your PWM in that it pulls the -ve output to ground rather than the +ve output up. The mosfets there are 'n-type' and I think you need a 'p-type' for what you need. It's been a long time since I've done this stuff in anger though
I'm pretty sure your best way forwards it to do as bigginge says and look for a 'high side' PWM controller of some sort
@Max, I'm confused as to what you are trying to achieve. Does this sound correct?
You have a motorbike that has a high beam LED that is controlled via simple switch ie ON or OFF.
You want the ability to add a dimming function to the high beam LED.
So when the high beam switch is OFF you can use the dial to dim the LED. When the high beam switch is ON you have normal full high beam irrespective of the position of dimmer dial?
Hi jairaj - yes, in a nutshell. The 'dimmed' high beam is also switchable on/off independently and once the correct level of dim was set it would be left alone. It's quite a common mod but much simper in the older days with conventional bulbs. Similar to the Skene unit here but these are not available in the UK and don't work with all modern LEDs. https://www.skenelights.com/installation-iq-270-a
OK, thanks for clearing that up.
Next thing I'm not clear about is your OEM wiring diagram. In the top left corner you have the "H-light driver" and 4 wires that go into it. I can't read your writing to decipher what the two parts of the driver are and how the LED connects to the driver?
Is the LED and H-light driver one unit? It has two control wires going into it (grey/black) that from the light switch and relay and a further two wires (green/brown) to supply power to the LED / driver unit?
I have re-drawn your circuit diagram, if I have got it right it looks something like this:

I don't know why you can't do something like this:

Assuming the PWM unit can supply the current the LED requires? That should work.
When the relay is off the PWM will drive the LED so that it is dimmed.
When the relay is activated then the PWM signal will be overridden by the supply voltage and the LED will see a constant signal.
If the PWM unit is not able to supply the current drawn by the LED then you can use a MOSFET driver board like the one you linked to and put this in series with your LED.
The eBay link suggests it uses an P-channel MOSFET which in simple terms means when a positive voltage is applied to the gate the MOSFET will allow current to pass.
So again when the relay is OFF the MOSFET is driven by the PWM and will pulse on / off as the PWM voltage rises and drops. When the relay is ON it will drive the MOSFET gate to supply voltage and the MOSFET will be fully on regardless of the PWM.
edit: The MOSFET board might require some heatsink as it may get hot depending on the current drawn by the LED which as its motorbike headlight I imagine could be quite high?
Thanks so much jairaj - let me take in and study all you have posted and I'll come back. I was linked a high side PWM: https://www.abeltronics.co.uk/products/led-dimmer-rotary-potentiometer-controlled-pwm-12v-24v-10a-low-voltage/dim12
So, depending on how much current you need this to supply you might be able to get away with building something using the two modules linked below to do what you want (I think, assuming the basic motor controller is just feeding a PWM signal into a low side switch). It may even be possible to use the controller you already have in place of the module from Ali-express but it’s hard to say without knowing a bit more about it.
https://www.pololu.com/product/2815
https://a.aliexpress.com/_mP9EDRC
To get this to work I think you would need to connect something like a 1k resistor between the motor + and - terminals in the motor driver. The connect the - motor terminal to the “on” terminal of the polu module to use this PWM output to drive the high side switch. If the high side switch is fast enough you should then be able to connect its output (VOUT) to your light. The positive inputs to both modules would be connected to +12v and the GND and DC- inputs to 0V.
Edit: or just use that one in your last post.
@jairaj I think the problem with your circuit is that the pwm he has at the moment appears to switch the -ve output and the +ve output is just the supply voltage. So, as I understand bit, the LED would be permanently on.
That's just what I understand from the original post.
Nice schematic though. Makes it much clearer
That's correct and the main issue. Upshot seems to be a high side switching PWM is needed, then it's relatively simple.
I did post this in a couple of FB groups with not much input other than some saying it could damage the LED driver. Is this possible?
The only change to OEM spec seems to be the main beam trigger is being 'pulsed' rather than constant.
some saying it could damage the LED driver. Is this possible?
Yes it is possible but it is difficult to predict unless we know the LED is designed to be dimmed. It's likely to be ok as automotive electronics tends to be as cheap as possible so the driver is unlikely to be sophisticated but I just don't know. It might also depend on exactly which brightness you have as that might mess with the driver. It's a real suck it and see case I think
That's the potential issue - it's a big sealed unit at £700+!
problem with your circuit is that the pwm he has at the moment appears to switch the -ve output and the +ve output is just the supply voltage.
Ah OK, I get the problem now. You can change the wiring to the following:

Although ...
some saying it could damage the LED driver. Is this possible?
Yes it is possible but it is difficult to predict unless we know the LED is designed to be dimmed
That’s the potential issue – it’s a big sealed unit at £700+!
If the unit really is sealed and not easy to swap out any damaged circuits then I would prefer to use a current limiter to dim the LED rather than PWM.
Can't you just use one of these instead? 😂
This shouldn’t be too difficult to design but I’m not sure how easy it will be to find an off the shelf module you can use on your bike
Should not be too hard. For some reason Japanese aimed products tend to be lowside, Euroand US high side. IME anyway...
Thanks again to all, as ever the knowledge base on STW is superb.
If the unit really is sealed and not easy to swap out any damaged circuits then I would prefer to use a current limiter to dim the LED rather than PWM.
Yep, definitely sealed.
Err, sorry...can you explain more on current limiters?? 😀
An LED's brightness is proportional to the current, ie small current equals dim LED, higher current equals brighter LED.
A basic LED driver is a circuit that will aim to supply the LED with constant voltage and constant current. A dimmable LED driver circuit will aim to keep voltage constant and change the current depending on the brightness requested.
Take my last diagram and replace the PWN with a current limiter. This will limit the amount of current that can pass through the LED and keep it dimmed. When the high beam switch is toggled the current limiter is bypassed and the LED has direct path to ground and can draw as much current as the built in LED driver wants to supply giving full brightness.
Ah OK, I get the problem now. You can change the wiring to the following:
He can't do that as he only has access to the +ve connection on the LED, not the negative. I'm guessing that the -ve is done through the frame of the bike.
then I would prefer to use a current limiter to dim the LED rather than PWM.
I would possibly agree. The problem of course is that a current limiter will need a bigger heatsink than a PWM 🙁
Thanks guys.
I'm just going to ask one final (potentially daft) question - a much simpler mod some have done is to put a switch in the 12v + line to the dipped beam, this then leaves just the two halos lit.
Is there a way to have a switch with an inbuilt LED that of course illuminates the switch when the circuit is closed to be illuminated when the switch is *open*?! ie dipped beam OFF but switch LED on?
Is there a way to have a switch with an inbuilt LED that of course illuminates the switch when the circuit is closed to be illuminated when the switch is *open*?! ie dipped beam OFF but switch LED on?
A changeover (SPDT) switch with a lamp should do that I think. The +ve voltage that should go to the dipped beam goes to the common connection. One of the outputs goes to the dipped beam and the other output you feed back into the lamp via suitable resistor (if needed). The other end of the lamp goes to the -ve supply
So if the switch is in one position it turns the dipped beam on and in the other position it turns the lamp on.
I think that is what you are looking for?
Thanks leffeboy - only issue is the OEM switch (that I really want to use as it's illuminated and integrated neatly) is a SPST.
Just to clarify in the pics - the halos are permanently on with ign which I want to keep. I can interrupt the LH dipped beam which is what I want to switch but with the switch LED ON when circuit is OPEN? Possible?? 🙂
PNP / NPN - aka sinking/sourcing is what you are talking about here
https://automation-insights.blog/2011/01/18/industrial-sensing-fundamentals-back-to-the-basics-npn-vs-pnp/
edited to add - seems a lot of faffing about especially with a stock wiring system just for aesthetic reasons (unless I've misunderstood the OP?)
Thanks leffeboy – only issue is the OEM switch (that I really want to use as it’s illuminated and integrated neatly) is a SPST.
Use the SPST switch to drive a SPDT relay and do it that way?
