Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

3.3 V PWM to 12V PWM via Mosfet?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

3.3 V PWM to 12V PWM via Mosfet?

by inktomi on Mon Feb 17, 2020 12:30 am

Hi!

Will this idea work, maybe using something like https://www.adafruit.com/product/355 ?

12 VDC from external source -> Drain
3.3 VDC PWM in -> Gate
MeanWell Dimmable Power Supply needing 12 VDC PWM -> Source & also to GND hooked to Raspberry Pi GND

It seems like my Raspberry Pi's 3.3V PWM signal can turn on and off the gate, allowing my 12V source to flow through to the LED driver which expects a 12V PWM signal to control dimming. That's reasonable, right? Nothing else I'm missing?

inktomi
 
Posts: 5
Joined: Mon Feb 17, 2020 12:26 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by adafruit_support_bill on Mon Feb 17, 2020 7:37 am

Yes. That should work.

adafruit_support_bill
 
Posts: 76602
Joined: Sat Feb 07, 2009 10:11 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by inktomi on Mon Feb 17, 2020 11:06 am

Thank you for the double check. I'm not very familiar with circuit design. I appreciate it!

inktomi
 
Posts: 5
Joined: Mon Feb 17, 2020 12:26 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by inktomi on Sat Feb 22, 2020 10:41 pm

Hi -

I can't seem to get this to work. I'm using a mean well ELG-75-12B dimmable power supply, which takes 10V PWM in Dim+ and Dim- to dim anywhere from 100Hz to 3Khz. I have my PWM set to 800hz.

You can see how I've got it hooked up here, using 2k and 10k resistors. I can measure ~3.3V on the gate from the white wire, and ~10.4V on the source (the red wire going towards the bottom of the photo).

The Yellow wire is the Raspberry Pi GND, hooked to the Black wire from the power supply's DIM-.

The red/blue rails are +10V DC positive and negative from the same power supply that is powering the raspberry pi.

I have the White wire being the 3.3V PWM signal, through a 10K resistor, and into the Gate.

I have +10V DC into the Drain.

I have a 2.2K resistor on the Source, connecting to the Red wire which is the DIM+ on the power supply.

This does not seem to work. Any ideas? I've tried the same setup without the resistors, and I've tried swapping the source and drain.

IMG_20200222_183034.jpg
IMG_20200222_183034.jpg (204.76 KiB) Viewed 43 times

inktomi
 
Posts: 5
Joined: Mon Feb 17, 2020 12:26 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by zener on Sat Feb 22, 2020 11:55 pm

It would help if you can sketch your schematic and post it. You cannot use a N-Channel fet for high side switching for example. I am guessing their is some small error in your circuit that can be easily corrected but it is a little hard to trace out what all is going on from the picture.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by inktomi on Sun Feb 23, 2020 4:05 pm

Here's a sketch. I agree, I think I'm just making some silly mistake.

I'm using a MeanWell ELG-75-12B which can be dimmed via 10V DC PWM according to their docs on DIM+ and DIM-. They caution that DIM- should not be connected to the 10V DC negative rail, and I have not done so.

Reef Pi Lighting Dim Circuit.jpg
Reef Pi Lighting Dim Circuit.jpg (618.67 KiB) Viewed 32 times

inktomi
 
Posts: 5
Joined: Mon Feb 17, 2020 12:26 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by zener on Sun Feb 23, 2020 6:32 pm

Yeah, you can't use a N-Channel fet as a high side switch like that. It has to connect things to ground (low side switch). Try it like this:

Sch.jpg
Sch.jpg (160.41 KiB) Viewed 29 times


The PWM will be inverted, so 0% will be max and 100% will be min.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: 3.3 V PWM to 12V PWM via Mosfet?

by inktomi on Mon Feb 24, 2020 12:26 am

That solved it! I need to study the differences between what I had and the design you created - obviously I made some mistakes with mine. Thank you again!!

inktomi
 
Posts: 5
Joined: Mon Feb 17, 2020 12:26 am

Please be positive and constructive with your questions and comments.