Controlling voltage from 0-10V with transistor - Unable to go lower than 5V

I have a project where I am controlling a pump using the Arduino. The pump has a serial interface and can be direct wired so that an input voltage from 0-10V controls the output pump speed (the pump is not actually running on the voltage, it is simply using it as an input).

When the project started I used the Arduino onboard power to use the PWM output to control the voltage from 0-5V without issue. But the full pump range requires 0-10V. To that end I followed the instructions I found at Instructables to put together a setup using a transistor and an external power supply. The sketch from that site is:

// Define which pin to be used to communicate with Base pin of TIP120 transistor
int TIP120pin = 11; //for this project, I pick Arduino's PMW pin 11
void setup()
{
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
analogWrite(TIP120pin, 255); // By changing values from 0 to 255 you can control motor speed
}

void loop()
{
}

The wiring was done on a breadboard and the setup, as far as I can tell is wired identical to the example at the website. I will update this with a wiring diagram once I get a chance to draw one out. Anyway, by changing the analogWrite value I could successfully adjust the output voltage of the system from 5V to 10V, but even at a analogWrite value of 0 I still had 5V at the output (measured with a multimeter). So now I am wondering if I am seeing the voltage from the board (and if so how do I stop that) or is one of the specs from the transistor giving me problems, some sort of minimum voltage, or do I just have the thing wired wrong? I am hopeful that someone more experienced could give their guidance on this.

I have the spec sheet for the transistor attached.

TIP120.pdf (45.2 KB)

Just draw a schematic how you have things wired and show it to us.

.

The diode should be from the output to 10V not 5V.
I suspect that is your problem.
Dwight

That 'Destructable' 'Instructable' is crap. Not even a decent schematic, and the diode is shown connected incorrectly, from the emitter to the collector of the transistor.
It should be from the collector of the transistor to the positive motor supply, (cathode to the positive motor supply). That won't be the problem, though. In fact, if your circuit is just supplying a 0V to 10V control voltage, and not directly driving the pump, the diode isn't actually needed.

Generally speaking, so-called Instructables are not the place to learn. Too many absolute beginners with no real understanding of what they're doing create Instructables and pass on their bad habits and mistakes to thousands. It's pretty sad. :frowning:

Besides the schematic that Larry asked for, please take a clear photo of how you have everything connected.

Your right Steve, I didn't see that bogus schematic.
This is the second bad schematic I've see.
Dwight

A 0-10volt control signal from an Arduino PWM output is usually made with a lowpass filter, followed by an opamp with a gain of two.
Not sure what you're trying to do with a TIP120 darlington.
That article tries to explain how to drive a small motor, not how to make a 0-10volt control voltage.
All of this has been done before. Try entering "0-10" in the search box on top of this page.
Leo..

I think 0-10V PWM signals are more typically made with 2 transistors, one to invert the PWM signal and the 2nd to provide the higher level signal.
Or just 1 if you don't mind an inverted PWM signal.

The PWM can then be low pass filtered if a DC level is needed.

Transistor circuits only works if you don't load the DC signal (too much).
Non-linearity is also hard to avoid.
Leo..

If linearity is wanted, then a 12V powered DAC would have been best.

The 2-resistors in series in your diagram.
How are you able to calculate them for 0-10volt output.
Leo..

You could try something like the attached - won't drive much, but may do.

the 0..10v is set by the TL431 - the psu voltage isn't critical.

The drive voltage isn't critical either - it just turns 0..100% PWM to 0..10v

regards

Allan

gain2.pdf (21 KB)

Output voltage depends on the load.
This diagram outputs 0-10volt into a 100k load.
Inverted logic, so PWM0 = ~10volt and PWM255 = ~0volt
Leo..

First, I apologize for not getting back to this faster after seeing so many people taking the time to try to sort out my issue. I have attached two photographs of the current setup (at the time of my posting) as well as a wiring diagram. I have never drawn a wiring diagram before so take it with a grain of salt.

I will go through the responses in the order they were received.

@LarryD - Wiring schematic is attached, sorry for not starting out with that, it should have been in my opening post.

@dwightthinker & OldSteve - When I removed the diode altogether a value of 0 in the sketch would now essentially cut the output voltage to zero, but a value of 1 would bring it straight back to ~5V. So now I can control from 5-10 and also 0. So it's a little better.

@Wawa - I wish I had someone in real life that could guide me like this but I am working only with the internet as a resource. I have tried to pick up electronics books in the past but electronics still seems like voodoo, at some point in searching for a way to control this output voltage I came across the method that I am pursuing now and since then I have latched on in hopes that it will work. You are certainly correct, searching for 0-10V in the upper box did give plenty of good results. In retrospect the search strings that I had been using before this were embarassingly bad, but that's always the hard thing when getting into something new, figuring out the right way of asking for what you need. If this method does not work out I will pursue some of those other methods.

@CrossRoads - Thank you for the schematic. I tried to replicate it with what I had on hand (photos attached) but it would only control the voltage between a narrow range of 8.9-9.1V, strange. I am not assuming that I am doing something wrong, but instead, probably everything wrong. The first transistor has a controllable output of 5-10V but the second seems to be fixed in that narrow range. I have looked at filtering the output of the system and that is the plan once I get a reliable range of voltage control.

@allanhurst - Thank you for the detailed wiring diagram. Since there are so many options for paths to choose from online, if my current methodology fails then I will attempt this. I have absolutely no spare parts on hand besides spares of what I already purchased so I would need to place an order. What does the Q mean in front of your transistor number? I found a number of 2n2222 transistors but hardly anything had a preceding Q. I should be able to follow your diagram.

@Wawa - Thank you for staying with me and posting this wiring diagram. I have been trying to follow these posts in order. I did not have the resistors that your diagram called for but I tried to assemble with what I did have assuming (I could be incorrect) that I would get some response. But I was unable to control the voltage at all. It's not you, it's me. After going through all of these posts I know I am wayyyy over my head on this. I need to take the time to try to digest and put all of this down after working on it for the last several hours. Maybe coming back with a clear head will help.

Thank you everyone for your help, I will try to come back to this topic once I get some more components, try some more diagrams, and get a little further, that is, if I cannot find a different way to do this somewhere else.

The meter is not supplying enough load.
When used on an I/O pin, the I/O pulse both ways,
to 5V and to grounds.
The transistor is unidirectional it only pulse one way.
When the transistor turns off, it floats because the high input
impedance of the meter.
Try putting a load, such as a motor or LED and limiting resistor
and then measure.
The diode does nothing the way it is installed, as Steve
mentioned.
Dwight

I will try that, thank you for the suggestion.

Hi - as regards the circuit - "Q" is often just used to signify a transistor - so Q1 is the first, Q2 the second and so on. If you have several, it's a means of identifying which one it is. It's not a part type.

Hence you often get R1, R2 etc for resistors, and C1 ,C2 etc for capacitors.

regards

Allan