Go Down

Topic: Switching +12V from NodeMCU GPIO (Read 257 times) previous topic - next topic

wantmoore

Hi all,

I'm working on a NodeMCU-based circuit to do some automation/control for my inground pool. I have a variable speed pump (Century VGreen 165) that has four programmable stages (Step 1, Step 2, Step 3, Override). It has a means of allowing this control from an outside source by sending +12V DC to an input pin. I had originally planned to this by using some relays and then stumbled on to the transistor idea as it was being used to provide 12V to control a DC motor or RGB LED and thought maybe I could do the same. However, I can't seem to make it work.

I mocked up the circuit (see attached) on a breadboard, but can only seem to get the 3.3V output from a GPIO pin to pass through to the emitter. I believe the issue is the transistors I have on-hand (TIP120 NPN) should only switch the ground leg but I'm such an amateur at this I truly don't know. Would a PNP transistor be better? I really liked the idea of it being a bit more simple and contained on a smaller PCB but if I should just suck it up and wire up the relays, I'm ready to do that too.


The end-goal here is to control these GPIO pins as well as expose some analog channels for water temperature and flow rates to HomeAssistant or similar (likely via MQTT) to be controlled there.

I appreciate any help! Thanks!

Grumpy_Mike

Quote
but can only seem to get the 3.3V output from a GPIO pin to pass through to the emitter.
Yes you will with that circuit.

Quote
I believe the issue is the transistors I have on-hand (TIP120 NPN) should only switch the ground leg but I'm such an amateur at this I truly don't know
Yes a NPN transistor will only switch to ground. You have it in a mode known as an emitter follower which is not what you want.

I am not sure what that Green board is. It has no part number on it and it is not obvious what it is, so more detail needed please. Also what are you trying to do?

Quote
Would a PNP transistor be better?
It would be useful for what is called "top switching" that is switching the positive, but unfortunately this requites a 12V signal to switch it which you make with a NPN transistor. Also the TIP120 is not a single transistor it is in fact two transistors wired in a configuration known as a Darlington pair.


wantmoore

#2
May 23, 2020, 03:20 am Last Edit: May 23, 2020, 12:50 pm by wantmoore
I am not sure what that Green board is. It has no part number on it and it is not obvious what it is, so more detail needed please. Also what are you trying to do?
The green board is the "digital control" input portion of the Century VGreen 165 motor. It wants 12V DC (+/- 25%) applied to the various input pins on the far-right (Step 1/Step 2/Step 3/OVRD) to trigger those presets in the motor controller. There's a reference circuit (using relays) provided in Section 9 of the manual (page 25 of the pdf - but the page is numbered 23).

Thanks!

-Justin

runaway_pancake

Maybe take another stab at that link.
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

jremington

Best to use high side switching for controlling active circuits. Pololu makes this easy with their Power Switches.

ShermanP

So these are just signaling voltages, and not actually powering the motor?  I wonder if there is a risk-free way (risk-free to your meter) to measure the current when connecting the 12V supply to Step 1.

The standard solution would have your processor GPIO pin drive an NPN transistor, which in turn drives the base of a PNP transistor that supplies 12V to Step 1.  But if there isn't much current involved, I wonder if something simple like a quad op amp (LM324) might work, operating as comparators.  You would have a resistor divider producing about 1.5V, which would be the reference voltage for each op amp, and the other input would come from a GPIO pin.  Then you would run each opamp output through a forward biased diode so the output would be about 11V when on, or tristate when off.

Well, I'm not sure I understand how the Step inputs actually work.  The manual talks about them being "active low", but that's not what Figure 7 shows.

JCA34F

#6
May 23, 2020, 09:03 pm Last Edit: May 23, 2020, 09:20 pm by JCA34F
Looking at fig. 4 on page 11, you could connect 12V to ICOM (pin 5) and pull STEP 1 to ground with an NPN (2N3904) transistor.
Or maybe not.  :smiley-confuse:

runaway_pancake

#7
May 23, 2020, 11:14 pm Last Edit: May 23, 2020, 11:19 pm by runaway_pancake
Why not?
That AC/DC "GND" is different, isolated, from the other.

PE - Maybe change my 220Ω to 470Ω.
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

JCA34F

Quote
Why not?
That AC/DC "GND" is different, isolated, from the other.
Yep, just as I figured.   ;D

Go Up