Is there an easy way to take the PWM output from a Raspberry Pi Pico W that scales from 0-3.3V DC so that it scales from 0-10V?
I have several devices that can accept a variable output voltage in the 0-10V range as a control signal, but the Pico can only push 3.3 V max.
The pump I’m trying to control won’t even turn on at 3.3V, much less scale the pump speed relative to the control voltage. So what I need is to transform the output PWM voltage from the Pi so that it ranges from 0-10V.
I’m guessing (hoping?) that there’s a board or device that doesn’t require me to solder up a circuit from scratch to do this.
Edit: An analog version of what I want to do already works, but it’s too cumbersome: basically, I attach an Adafruit digipot (via I2C) to the Pi, and then attach a separate 10V VCC source to the digipot. The voltage divider on the potentiometer can then be controlled to output 0-10V.
I’m trying to avoid that, however, as I would have to have a separate digipot for each device I want to control. Also, some of the devices I’m looking at specifically say they take a 0-10V PWM input as a control signal (separate from the actual power supplied to the device).
My 2p take on this is that you’re interpreting the PWM output as an analog voltage of 0-3.3v but that’s not how it works. The PWM pin provides 3.3v pulses that vary between off - tiny spikes - fatter spikes - full on.
So all you need is a MOSFET powered from a 10v power supply supply driven by the Pico’s PWM pin that can faithfully switch 10v pulses at the same pulse-width from the Pico i.e. an amplifier. I’m sure someone can point to a simple circuit to do that (just a MOSFET and some resistors?)
Thanks for the quick response! As a low-level electronics noob, I always appreciate good advice and knowledge shares.
I do have a question, though: From what I understand with PWM, isn’t the amplitude of the square wave equal to the output voltage? So, if the amplitude is 10V, but the duty cycle is only 50%, that would average out to a relative 5V output - correct?
Or am I missing something (which is highly likely).
Edit: And, for example, the light I’m talking about says that it takes a 0-10V PWM control signal. I interpreted that to mean a 10V signal that varies the duty cycle between 0 (0V) and 100% (10V)?
Again, I’m probably getting that wrong - hence all the questions.
Thanks again, though.
Here’s an example of what I’m talking about, using the Pimoroni Mini Submersible Water Pump (Grow)
These are the pumps I’m currently using with the two Grow hats that I own. You can control on/off power, as well as control the pump speed.
Looking at the python library for the Grow hat, the pump.py program indicates that the pumps are controlled via “soft PWM”:
My goal was to find an alternate way to drive those pumps without using the Grow hats.
Note that the lights I want to control have a similar setup.
With PWM as it’s name implies its the pulse width - not its frequency or amplitude - that changes.
Typically used to dim LEDs which are not easy to dim by simply changing the voltage.
For a supply of 3.3v and setting to on:off -
Using a 25:75 pulse the full voltage is only present for a quarter cycle so the average voltage is 0.82v.
Using a 50:50 pulse the full voltage is only present for half a cycle so the average voltage is 1.65v.
Using a 75:25 pulse the full voltage is present for three-quarters of a cycle so the average voltage is 2.47v.
The same pulse being switched on a 10v supply would give pro-rata “voltage” output
Depending on the frequency used, a LED might visibly flash but a motor would simply “see” a lower voltage.
I think I understand - the max output voltage doesn’t vary (for a Pico, that’s 3.3V). The duty cycle determines how much of that voltage something like a motor “sees”.
So, if I want to vary the PWM voltage between 0-10V, I have to have something that either:
- Supplies an initial max output voltage of 10V, or
- Uses the PWM output of 0-3.3V to control another device capable of providing a variable output up to 10V.
Or, in the case of the pumps I’ve referred to, (some base value) - 4.5 V.
Is that right?
For a 10 volt device you will need an actual 10 (or 12) volt power supply.
Then use a motor driver circuit driven by the PWM pin that switches the motor with effectively 10v pulses.
Logistically making a high-speed on/off switch in series with the motor.
Something like this (though out of stock at Pimoroni)