Trying to boost a PWM signal from a arduino to 12v - Page 1
Forum section: electronics / beginners

author: linkus_
author_rank: Newbie
timestamp: October 10, 2021, 06:10:51 pm
content: 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.

author: StillTrying
author_rank: Super Contributor
timestamp: October 10, 2021, 06:45:41 pm
content: I decided my post was mostly useless because I misread the original drawing.

author: Ian.M
author_rank: Super Contributor
timestamp: October 10, 2021, 07:59:21 pm
content: 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.pdfand:https://www.tecomotive.com/download/PWMinfo_EN.pdfWhat 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.

author: linkus_
author_rank: Newbie
timestamp: October 10, 2021, 08:40:55 pm
content: 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.

author: oPossum
author_rank: Super Contributor
timestamp: October 10, 2021, 08:42:24 pm
content: 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

author: Ian.M
author_rank: Super Contributor
timestamp: October 10, 2021, 09:00:38 pm
content: 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.

author: linkus_
author_rank: Newbie
timestamp: October 11, 2021, 06:45:41 am
content: Thank you all! I'll try to source some components and build this!

author: Zero999
author_rank: Super Contributor
timestamp: October 11, 2021, 09:43:37 am
content: 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.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 12, 2021, 11:14:34 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: October 12, 2021, 11:44:59 am
content: Quote from: DavidAlfa on October 12, 2021, 11:14:34 amWhat 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.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 12, 2021, 11:54:59 am
content: 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?

author: Zero999
author_rank: Super Contributor
timestamp: October 12, 2021, 01:04:54 pm
content: Quote from: DavidAlfa on October 12, 2021, 11:54:59 amQ2'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.

author: linkus_
author_rank: Newbie
timestamp: November 09, 2021, 08:18:44 pm
content: 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!