I NEED HELP 5V TO 10V PWM

Yesdog

Well-Known Member
optocoupler seems to be the preferred way- plus no inversion. Just a matter of finding whatever resistors you need
 

xX_BHMC_Xx

Well-Known Member
optocoupler seems to be the preferred way- plus no inversion. Just a matter of finding whatever resistors you need
Are those resistance figures in the image not correct?

After reading the 3-in-1 dimming thread again, I think I will probably just use a transistor and DC voltage regulator to control dimming and a solid state relay for on/off. Similar to the image below, with the SSR inline between the resistor and controller. This looks like the simplest, most effective way to do it.
 

wietefras

Well-Known Member
How does that schematic with the regulator look easier than the one with the optocoupler?

I think an optocoupler inverts the signal as well. Who cares though? Just invert it in the software. You can go from 0 to 255 for 0 to 100 or from 255 to 0.

The easiest thing is to use a dim-to-off driver. Then you won't need a relais.
 

Yesdog

Well-Known Member
I decided to go the transistor route cause I was getting confused by the optocoupler datasheet lol.

You shouldnt need the voltage regulator either, I dont think. The DIM controller is actually a constant current device (0.1mA), so the resistance actually sets the voltage. So if you have an on/off path- one of them should have 0 resistance (the off path), and the other path should still have a 100kOhm resistor (this converts the 0.1mA to the actual 10V required by the dimmer, 100,000ohm x 0.0001amp = 10V). This is why when the DIM leads arent connected (infinite resistance) it actually pumps out like 110% or something to the LEDs.

@xX_BHMC_Xx it also looks you're building something very similar to what im doing lol. We'll have to compare and contrast, and see who electrocutes themselves first.

 

Yesdog

Well-Known Member
I settled on this schematic for the dimmer with my raspberry pi. The dimmer is on the right, represented as a 0.1mA constant current source. Also uses 2 NPNs to fix the inversion, but thats totally optional. I might ditch it just so I have less parts on the bread board.



Haven't tested the dim functionality yet tho, so no guarantees. (this is also for a 3.3V PWM, but it shouldnt matter really)
 

xX_BHMC_Xx

Well-Known Member
How does that schematic with the regulator look easier than the one with the optocoupler?

I think an optocoupler inverts the signal as well. Who cares though? Just invert it in the software. You can go from 0 to 255 for 0 to 100 or from 255 to 0.

The easiest thing is to use a dim-to-off driver. Then you won't need a relais.
Because I have no experience with the octocoupler, and I'm quite familiar with NPN transistors and voltage regulators, and HLG drivers cannot dim to off on their own, they require a line-in relay.
 

xX_BHMC_Xx

Well-Known Member
I decided to go the transistor route cause I was getting confused by the optocoupler datasheet lol.

You shouldnt need the voltage regulator either, I dont think. The DIM controller is actually a constant current device (0.1mA), so the resistance actually sets the voltage. So if you have an on/off path- one of them should have 0 resistance (the off path), and the other path should still have a 100kOhm resistor (this converts the 0.1mA to the actual 10V required by the dimmer, 100,000ohm x 0.0001amp = 10V). This is why when the DIM leads arent connected (infinite resistance) it actually pumps out like 110% or something to the LEDs.

@xX_BHMC_Xx it also looks you're building something very similar to what im doing lol. We'll have to compare and contrast, and see who electrocutes themselves first.

So, in theory, all I need is an NPN and a 100k ohm resistor?
 

wietefras

Well-Known Member
@xX_BHMC_Xx, An optocoupler is basically a light sensitive transistor. So you don't switch this transistor by applying a current directly at the base, but through a led shining on the base.

But yeah, a transistor (or optocoupler) and resistor is all you need.
 

xX_BHMC_Xx

Well-Known Member
@xX_BHMC_Xx, An optocoupler is basically a light sensitive transistor. So you don't switch this transistor by applying a current directly at the base, but through a led shining on the base.

But yeah, a transistor (or optocoupler) and resistor is all you need.
Is that switching led integrated into the optocoupler? I'm assuming yes.
 

wietefras

Well-Known Member
Is that switching led integrated into the optocoupler? I'm assuming yes.
Yes.

A problem with an optocoupler can be that the led can't switch fast enough. So a transistor is a safer bet anyway. There really is no need to use an optocoupler a tranistor works fine (better perhaps), but then neither is there a need to produce your own 10V source when the driver already supplies the source.
 

xX_BHMC_Xx

Well-Known Member
Yes.

A problem with an optocoupler can be that the led can't switch fast enough. So a transistor is a safer bet anyway. There really is no need to use an optocoupler a tranistor works fine (better perhaps), but then neither is there a need to produce your own 10V source when the driver already supplies the source.
So, will this work for a dim-to-off function, or will this pulse the whole fixture on/off with the PWM signal?
 

Attachments

Yesdog

Well-Known Member
Yes.

A problem with an optocoupler can be that the led can't switch fast enough. So a transistor is a safer bet anyway. There really is no need to use an optocoupler a tranistor works fine (better perhaps), but then neither is there a need to produce your own 10V source when the driver already supplies the source.
Yea the biggest mind-fuck for me was realizing that the DIM relied on a voltage of 0-10V, its kind of an odd way to look at it. But really it's a 0.1mA source that expects a resistance of 0-100.

So, will this work for a dim-to-off function, or will this pulse the whole fixture on/off with the PWM signal?
Put a 100kOhm resistor in parallel with the dimmer. This sets the default path of 100%=10V. Not sure specifically what the 10k is for.

The relay looks good, might want to do a small pull-down resistor to keep bleed away on the relay coil. But fuck power efficiency lol Probably not a concern.
 

xX_BHMC_Xx

Well-Known Member
Put a 100kOhm resistor in parallel with the dimmer. This sets the default path of 100%=10V. Not sure specifically what the 10k is for.

The relay looks good, might want to do a small pull-down resistor to keep bleed away on the relay coil. But fuck power efficiency lol Probably not a concern.
Like this?
 

Attachments

Yesdog

Well-Known Member
Like this?
yep, LGTM. Are you putting the relay on the power OUT from the driver, or the AC power in? I'm probably going to do the relay on the power OUT from the driver, not sure if there's any big difference.

EDIT: ooh, wait, i just saw the relay is in line with the PWM... that might cause some issues when the PWM is cycling. The PWM signal should drop to ground, or close to. I think you'll need another GPIO pin to control that. The SS relay might work where it is tho, depending on its characteristics, and the PWM frequency.
 
Last edited:

xX_BHMC_Xx

Well-Known Member
yep, LGTM. Are you putting the relay on the power OUT from the driver, or the AC power in? I'm probably going to do the relay on the power OUT from the driver, not sure if there's any big difference.

EDIT: ooh, wait, i just saw the relay is in line with the PWM... that might cause some issues when the PWM is cycling. The PWM signal should drop to ground, or close to. I think you'll need another GPIO pin to control that. The SS relay might work where it is tho, depending on its characteristics, and the PWM frequency.
Meanwell recommends using the relay on the line in, and not to have the unit powered on without a load. I'll just have to use another GPIO to control the relay, StormX has more than I need anyway. Thanks for the advice!
 

Yesdog

Well-Known Member
also, I really have to say that I'm loving these intel coolers for this project so far. They give almost perfect clearance for the holder brackets, about $10 each, rated at up to TDP 65W. Also hilariously easy to control with a rpi or other single board computers. Only issue is no holes for the holder mounting- just used gobs of thermal epoxy, and the mounting otherwise still gives a decent compression fit.
 

xX_BHMC_Xx

Well-Known Member
I did find one of these awesome relays (now that I know I have to use the AC input, good call @xX_BHMC_Xx):

https://www.adafruit.com/products/268

Just an inline AC 'cable' with a relay in the middle. I trust myself wiring AC as far as I can throw... myself.
Yeah, I've seen similar products to that, but unless you only want to control the entire fixture at once, you're gonna have to cut the plugs and wire them in anyway. Might as well save some $$/space and use the SSR's, imo. Wiring AC is no different than wiring DC, just make sure it's not plugged in when you start making connections or touching leads.
 
Top