Author Topic: Trying to boost a PWM signal from a arduino to 12v  (Read 2430 times)

0 Members and 1 Guest are viewing this topic.

Offline linkus_Topic starter

  • Newbie
  • Posts: 4
  • Country: se
Trying to boost a PWM signal from a arduino to 12v
« on: October 10, 2021, 06:10:51 pm »
Hi,
I'm trying to do a small project to drive a Pierburg CWA400 Waterpump with a arduino, the waterpump has 12v in and PWM in, however it seems that the pump really want a PWM signal of 12v to actually adjust it's speed.

I found a small Mosfet board (IRF520) locally that said it is usful for PWM (like dimming a LED-strip), however when i feed the mosfet 12v and send the signal from the arduino to the mosfet-board the output is not actually PWM'ing so to speak, i have attached a logicanalyser to the output of the mosfetboard, and i can see it pulsing but its not increasing or decreasing in length as i adjust the PWM out from the arduino.

Now i'm trying to wrap my head around this it not a complicated thing but i just cannot get this to work, is it the mosfet that is not suitable for my task or am i missing something?
Here is a crude schematic on how i connected the thing.

 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #1 on: October 10, 2021, 06:45:41 pm »
I decided my post was mostly useless because I misread the original drawing. :o
« Last Edit: October 11, 2021, 09:21:09 pm by StillTrying »
.  That took much longer than I thought it would.
 
The following users thanked this post: linkus_

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13035
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #2 on: October 10, 2021, 07:59:21 pm »
No, that wont help.  The pump has a 10 K pulldown on its PWM input and has thresholds of min. 60% (high) and max. 40% (low) of of its supply voltage, so low side switching of its power is the wrong approach.

See: https://tecomotive.com/download/datasheets/CWA400_EN.pdf
and: https://www.tecomotive.com/download/PWMinfo_EN.pdf

What it needs is a level shifter with a push-pull output.  If an inverted PWM is acceptable (i.e. 100% from Arduino = 0% to pump and visa versa), then a simple two NPN level shifter will do the job, otherwise you'll need a third for non-inverting.



LTspice sim attached.
« Last Edit: October 10, 2021, 08:36:00 pm by Ian.M »
 
The following users thanked this post: linkus_

Offline linkus_Topic starter

  • Newbie
  • Posts: 4
  • Country: se
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #3 on: October 10, 2021, 08:40:55 pm »
Holy crap thanks alot for this!

I found one guy on youtube that did something similar to me with a MOSFET i think and it did not look anything like this complicated, however if this is the correct way to do it i'm all for it!

Thanks again, i'll try your schematic and to source some parts.
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #4 on: October 10, 2021, 08:42:24 pm »
Non inverting circuit with NPN/PNP.

Resistor values are not critical. 1k to 10k would probably be fine. R3 may not be needed.

Transistors can be many common types such as 2N4401/4403, 2N3904/3906, PN2222/2907
« Last Edit: October 10, 2021, 08:44:33 pm by oPossum »
 
The following users thanked this post: Ian.M

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13035
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #5 on: October 10, 2021, 09:00:38 pm »
Yes, as the fan has an internal pulldown, and its only a signal input, your simpler circuit will do the job for non-inverted.  My circuits are more appropriate if you need more drive at the output.

@Linkus,
Component choice is non-critical.  It will work with anything from 1K to 10K resistors, any signal diode and just about any small signal NPN transistor so you should be able to build it with whatever you have on hand.
« Last Edit: October 10, 2021, 09:04:07 pm by Ian.M »
 
The following users thanked this post: linkus_

Offline linkus_Topic starter

  • Newbie
  • Posts: 4
  • Country: se
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #6 on: October 11, 2021, 06:45:41 am »
Thank you all! I'll try to source some components and build this!
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19875
  • Country: gb
  • 0999
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #7 on: October 11, 2021, 09:43:37 am »
There are also ICs which can do this: CD4504 and CD40109. A MOSFET driver will also work, such as the TC4423 but is overkill.

It depends on how many channels you require. If it's just one, a couple of transistors is probably more economical, but if you need two or more, consider using an IC.

Here's a non-inverting level shifter, using just two transistors. The downside is the MCU output has to sink all of the output current, plus about 3.5mA, for the biasing resistors, which can be increased, if it doesn't need to source so much current.

Q2, R2 and D1 can be omitted, if the pump's PWM input is happy with a source impedance of 4k7.
 
The following users thanked this post: oPossum

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #8 on: October 12, 2021, 11:14:34 am »
Zero999, your circuit looks a bit dangerous. Any little cross-conduction during the transition time will push 12V to the logic pin without any current limitation!


These circuits usually have slow transition times, causing a lot of distortion on a PWM signal duty cycle.
Can be ignored for up to a few KHz, but if using a very fast PWM you'll need compensation to make the BJTs switch faster.
For example, simulating this circuit gives 25ns falling and crazy 5ns rising time.
When allowing the transistors to fully to saturate (Removing R4) , neither adding base fast discharge capacitors, the turn off time was more than 10us!
Simulation has 10ns input transition time.
« Last Edit: October 12, 2021, 11:35:37 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19875
  • Country: gb
  • 0999
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #9 on: October 12, 2021, 11:44:59 am »
Zero999, your circuit looks a bit dangerous. Any little cross-conduction during the transition time will push 12V to the logic pin without any current limitation!


These circuits usually have slow transition times, causing a lot of distortion on a PWM signal duty cycle.
Can be ignored for up to a few KHz, but if using a very fast PWM you'll need compensation to make the BJTs switch faster.
For example, simulating this circuit gives 25ns falling and crazy 5ns rising time.
When allowing the transistors to fully to saturate (Removing R4) , neither adding base fast discharge capacitors, the turn off time was more than 10us!
Simulation has 10ns input transition time.
What cross-conduction?

Your circuit is more dangerous. The 3.3nF capacitors allow high current spikes into the base junctions of the BJTs.  Try plotting the base currents and you'll see what I mean!

C1 is a bad idea. The other unlabeled capacitor will help to speed things up, but is far too large. It should be an order of magnitude smaller and another current limiting resistor in series with it is a good idea.

My circuit can be speed up by reducing R2 and adding 100pF in parallel with R1. A 220R resistor in series with the 100pF would limit any spikes, if they're a concern.
« Last Edit: October 12, 2021, 11:47:28 am by Zero999 »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #10 on: October 12, 2021, 11:54:59 am »
Yeah, I agree. I didn't spend much time while designing it, it's more like a proof of concept.

What I mean is: When Q1 emitter is switched to gnd, if Q2 turns off only slighly later, !2v with have a direct path throught both C-E and D1?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19875
  • Country: gb
  • 0999
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #11 on: October 12, 2021, 01:04:54 pm »
Yeah, I agree. I didn't spend much time while designing it, it's more like a proof of concept.

What I mean is: When Q1 emitter is switched to gnd, if Q2 turns off only slighly later, !2v with have a direct path throught both C-E and D1?
Q2's base is pulled to ground, before its emitter and being an emitter follower is extremely fast. Try simulating it. There isn't any cross-conduction.

 
The following users thanked this post: Yansi

Offline linkus_Topic starter

  • Newbie
  • Posts: 4
  • Country: se
Re: Trying to boost a PWM signal from a arduino to 12v
« Reply #12 on: November 09, 2021, 08:18:44 pm »
Hello guys,
i just wanted to say thank you for your help and send a update on your way, after some time waiting for the transistors and diodes i finally got it working with Ian.M's non-inverting circuit!





Best regards!
 
The following users thanked this post: Ian.M


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf