DC power switching

I am really struggling to get my project to behave the way I'd like and I would guess I'm missing something simple that would be easily resolved by someone who knows more. Here's the gist: I have a palludarium and I would like to control the lights and an ultrasonic humidifier from an Arduino. Each component is powered by a 12 volt DC wall wart and each has a break in the power line that is joined by a male/female 12 volt DC connector. It's my understanding that the amperages coming from these power supplies are too much for the Arduino to switch on its own, so I'm looking at relays, MOSFET's, and transistors. I would want this to operate silently, so any relay would have to be solid state. I've managed to wire up a relay so that its indicator lights go on and off on a timer controlled by Arduino. All well and good and it appears to work as expected. The issue is that the behavior at the switch is not cooperating. Now, I'm a super neophyte, so I'm sure I'm doing something wrong, but here's what I've observed: with a multimeter, I would expect when the relay is open I'd measure infinite resistance (OL), but when it's closed I'd measure nearly 0 resistance, unfortunately whether the relay is indicating on or off with the LED, my multimeter always shows OL. Similarly, when I wire this into the power supply, the relevant component just stays always on. With a transistor I get similar behavior (always on, no measurable state change with multimeter), with the added feature of the transistor getting very hot and smelling like burning.

I think where I feel most mystified is not in the coding or the concepts, but in the particulars of the wiring. I have some 12V DC jacks that I'm using to interface my project with the native power supplies as seen in the attached picture. The way I've wired these is to solder the two black leads to each other and connect one red lead on each side to either the switch terminals on the relay or the c & e legs of the transistor.

My biggest suspicion is that I've wired this wrong and that I am not properly using my multimeter. I say this because I have used two different brands of relays across 4 channels of operation plus the transistor and none of it is doing what I would expect. Any help is much appreciated.

show schematic

OK right off the top:

In the interest of keeping it simple I would just buy a two channel relay board. Similar to this but a Google of two channel relay module will yield plenty of hits. You are correct in that an Arduino or any micro controller has low current output pins.

Next:

I can't see exactly what you are doing but I hope you are not using a DMM trying to measure resistance on an energized circuit. You can measure between relay common and N/O or N/C contacts as long at your meter in ohms mode will not see any power.

Yes, even a hand drawn schematic would help, even in crayons. :slight_smile:
Ron

Ok thanks for the replies and apologies for the silence - been a busy week. This is the best I've got as a relative novice. I hope this isn't too confusing but I'm trying to represent the three different setups I've tried. There's using a transistor, using a 2 channel solid state relay, and then using a 1 channel relay. For clarity, power is colored red, ground is Navy blue, gpio is green, and components are yellow. The barrel connectors are what interface with the power supplies to the external components (lights & mist maker).

image
No. You can't use a 2n2222 (npn) as a high-side switch. You'd have to use a pnp for that. And a small-signal transistor is a poor choice for power applications anyway, so better just put it back into the parts box.

As to the 'relay switch' (???) and 'relay' modules, please upload photos of both and if possible link to product pages or datasheets.

Why is IN1 pulled up with 10k to Vcc?

What is the current required by the lights?
What is the current required by the humidifier?

https://a.co/d/9cn5CKs

https://a.co/d/gOGjIi3

These are the two different relays I have. The mist maker has a wall wart that says it outputs DC24V-800mA. The LED's say 12 volt .3A

Why is IN1 pulled up with 10k to Vcc?

Chat GPT told me to set it up that way lol.

Ah, I see. Keep in mind that ChatGPT doesnt know anything as such. It just says things that match patterns of human communication. This means it'll happily propagate existing errors in the training data, or invent entirely new ones.

1 Like

where i see possible issues


post datasheet of SSR

Perhaps re-examine the pinout of the '2N2222'.

  • Please explain what is happening here ?

  • Where is the common GND connection to the Arduino ?

There isn't lol. This is exactly why I'm on this forum. I don't know what I'm doing.

https://tech.iprock.com/archives/10030
https://s3.amazonaws.com/s3.image.smart/download/101-70-109/2_solid_relay.pdf
https://www.sainsmart.com/products/2-channel-5v-solid-state-relay

Here's what I can find on the 2 channel relay. This looks to me like it won't work because it's meant for handling AC

I'm not finding a datasheet or really much of anything on the other one, but here's some detail from the Amazon page:

3-32V DC 1-Channel SSR Solid State Relay High-Low Trigger 5A 5V 12V For ArduinoDescription:Using FR-4 double-sided circuit boards; Using high-quality solid-state relays 5A; The input and output are using KF128-3.81 Terminal Block, wiring more convenient; Use SS8050 1.5A high current transistor for switching transistor, quality is more stable; The board has four screw holes. Performance parameters: Power supply: 3-32VDC (wide voltage power supply) Trigger: high level trigger, 3-32VDC relay switches on (ON), 0-0.5V relay is switched off (OFF) 0.5-2.5 volts unknown state Load current: 5-220VDC 5A (DC only) Wiring Port Descriptions:DC +: positive power supply (3-32VDC) DC-: negative CH1: trigger terminal (3-32VDC high level trigger active) 100% new and high qualityMaterial: PlasticSize(LWH):6.89x7.10x2.28cm (1inch=25.4mm)Weight: 30g (1LB=453.59g) Color:As picture showsQuantity: 1Pcs Note:Light shooting and different displays may causethe color of the item in the picture a little different from the real thing.The measurement allowed error is+/-1-3cm.We highly appreciate all custome rsopinions to improvethe selling, also if anything you unsatisfied, please contact us for probable best solution. Thank you!Package Included: 1Pcs 3-32V DC 1-Channel SSR Solid State Relay High-Low Trigger 5A 5V 12V For Arduino(If there are any problems with the product, please send us pictures.Tell us more details about this problem)

So I'm using an Adafruit Feather M0, which only does 3.3v. From what I read this is within the specifications for triggering these relays but it sounds like you think that might not bare out? And then the pull-up resistor might be wrong as well?

The issue with this particular relay you've linked is that it's mechanical. This will be turning off and on regularly to regulate the mist production and will live in a critical audio environment so it has to be silent. That's why I've gone with the two solid state relays.

Maybe not. Some of those relays require 15mA or more to trigger, not sure what the M0 output current is.

The M0 can source 7mA and sink 10mA. If you want reliable operation with Amazon relay, I would a transistor to drive it.

Thanks for the suggestion. I'm now in the weeds again though. Can you describe how that would be integrated into this? Does the transistor functionally boost the amperage from the feather? Electronics is still a lot of black magic to me so assume I know nothing...

A BJT (bipolar junction transistor) does not amplify current. What it does is use its base current to control its collector current. The ratio of base current to collector current is given as hFE on the data sheets. So a change of base current of 1 mA can change the collector current of, say, 300 mA. But, the collector power supply has to be able to supply this.