Help with AC relays

Short question: Can I connect a Optocoupler relay rated at AC 250V 10amp driven by an Arduino pro mini with an AC pump rated 230V 2.4amp. Do I need a bigger relay or can I get by with a relay protection diode?

Background: I’m a noob to electronics and just started out with MCUs just last week. Apart from the fun little projects without any practicality I got an idea for something useful: to automatize the filling of my overhead water tank.

So I’m using an ultrasonic sensor to find the water level in the tank which is displayed on an 16x02 LCD. There is an RTC (DS3231). Water is supplied from 6am to 9am. At 7am the relay is driven to turn on the pump. At each 2 minute intervals it checks if there is any waterflow or not (to prevent dry running of pump). If the pump is running dry or the tank is 90% full, the motor is shut down.

I’ve gotten the whole thing to work except for the relay. I mean the LEDs on the relay turn on and all but I’m afraid to connect an AC load. Maybe I’ll start out with a resistive load?

|500x380

Right. Now you illustrate a relay module that is not opto-isolated to start with. If you fancy otherwise give a link to the actual one you are using so we can advise.

A 10 Amp rated relay with a nominal 2 A pump should be OK, given that its starting current is probably substantially more than 2 Amps.

Try it out. Just makes sure that all your control wiring is tightly bundled so as not to leave any open loops to couple interference.

Similarly, keep the mains wiring tight, avoiding any open loops and keep it spaced well away from the logic.

Note the importance of a proper 5 V power supply connected to the "5V" terminal (and ground of course) on the Nano and also all the other 5 V modules. You cannot use the on-board regulator (nor could you as illustrated, on a UNO).

Finally, remove the connection from the potentiometer to 5 V. This is a very long-standing mistake in published designs; correcting it will make contrast setting easier. If using a 10k pot, you can connect both ends to ground for even better resolution. :grinning:

First of all thanks for the tip on potentiometer. I had no idea! Yes, the resolution seems much better now.

Yeah, my circuit doesn't look like that, I used circuito.io to make the circuit. It doesn't let me manipulate the circuit and I don't know other apps to make a circuit diagram but I'll try.

The relay module is this https://www.electronicscomp.com/1-channel-5v-relay-module

The nano isn't powering other stuff. I have a 9V AC to DC barrel adapter plugged into a breadboard power supply that provides a constant 5V rated at 700mAmp max. All the components including the Nano and the relay are drawing from it.

So can I just just turn it on? There won't be any AC back current that'll go to the breadboard and fry all my components? Btw I do know about inductive loads like water pumps. I read that the starting current is 4-6X the rated current. If my pump is rated 2.4amp won't that go over the 10amp limit?

Also my pin headers are too loose for the nano so I'm hooking it up straight with the jumper wires twisted into the Nano's holes. Could there be a sparking problem?

commercial contactors have a AC1 to 4 rating AC1 bring resistive load and AC3 being an inductive load a relay specified as 10amp and nothing else would be AC1 and its AC3 rating would be much lower when driving water pumps I use a relay (such as the one in your circuit) to operate a contactor with a suitable AC3 rating - in you case I would suggest AC3 of 4 or 5 amps

if you are looking for an application to draw schematics try TinyCAD

OK,lots of fun here! :grinning:

coldbreeze16: The relay module is this https://www.electronicscomp.com/1-channel-5v-relay-module

OK, this one. |500x500 well, this module -- with only three terminals - is not isolated, the optocoupler is merely a novelty. :roll_eyes: It may not matter, noting my points about critical layout of the wiring. Plenty of commercial equipment, properly designed and laid out, works without such isolation.

coldbreeze16: The Nano isn't powering other stuff. I have a 9V AC to DC barrel adapter plugged into a breadboard power supply that provides a constant 5V rated at 700mAmp max.

No it does not, or at least not after a few hundred milliseconds as it heats up. It is almost useless in the same way as I explained regarding the regulator on the UNO/ Nano with almost no heatsink.

coldbreeze16: All the components including the Nano and the relay are drawing from it.

You need a regulated 5 V supply such as a common USB "phone charger" rated at 1 or preferably 2.1 Amps with a cable split out to connect the 5 V and ground to your 5 V devices.

coldbreeze16: So can I just just turn it on? There won't be any AC back current that'll go to the breadboard and fry all my components? Btw I do know about inductive loads like water pumps. I read that the starting current is 4-6X the rated current. If my pump is rated 2.4amp won't that go over the 10amp limit?

It might, but in fact there is less of a problem with a relay making a circuit with that current than there would be if it was needing to break it (arcing).

coldbreeze16: Also my pin headers are too loose for the Nano so I'm hooking it up straight with the jumper wires twisted into the Nano's holes. Could there be a sparking problem?

There will be no sparking in the 5 V circuitry, but I am not sure what "pin headers are too loose for the Nano" might mean since pin headers must always be soldered to the Nano. It is possible to assemble a final project with wires soldered to the Nano, but since you need to make multiple connections to some, you would generally either mount the Nano with its pin headers soldered into stripboard or your own PCB, or plug it into a terminal adapter such as this: |500x500

horace: commercial contactors have a AC1 to 4 rating AC1 bring resistive load and AC3 being an inductive load a relay specified as 10amp and nothing else would be AC1 and its AC3 rating would be much lower when driving water pumps I use a relay (such as the one in your circuit) to operate a contactor with a suitable AC3 rating - in you case I would suggest AC3 of 4 or 5 amps

if you are looking for an application to draw schematics try TinyCAD

So something like this: https://www.amazon.in/RAJLITE-Pole-CONTACTOR-RCH-Type/dp/B0857H1KMM/ref=sr_1_23?dchild=1&keywords=contactor&qid=1599376251&sr=8-23

That costs as much as the rest of the setup combined and too bulky to fit in the tiny plastic enclosure. Can't I use something like this: https://www.tanotis.com/products/genuine-sparkfun-relay-spdt-sealed-20a?gclid=CjwKCAjwkdL6BRAREiwA-kiczIlMQDNGXFoyPYUYi6LP7UnBadidVwfTzcoaowLlvLvX_YnXqklgghoCwWIQAvD_BwE

well, this module -- with only three terminals - is not isolated, the optocoupler is merely a novelty. :roll_eyes: It may not matter, noting my points about critical layout of the wiring. Plenty of commercial equipment, properly designed and laid out, works without such isolation.

I had no idea about how optocoupler isolated the circuit, but some googling shows there are costlier relays with 2/3 more pins on 5v side to be connected to 5v and GND. You mean those?

No it does not, or at least not after a few hundred milliseconds as it heats up. It is almost useless in the same way as I explained regarding the regulator on the UNO/ Nano with almost no heatsink.

:o I'm not getting this! I left the circuit running last night and it has been running fine so far, I just used my multimeter and the voltage is a solid 4.99V. Are you suggesting that driving a relay will turn up the heat? Also how'd I use a phone charger? Stripping the micro USB end and putting in the vcc and gnd cables into the breadboard power rail? Sorry for being so dense.

There will be no sparking in the 5 V circuitry, but I am not sure what "pin headers are too loose for the Nano" might mean since pin headers must always be soldered to the Nano. It is possible to assemble a final project with wires soldered to the Nano, but since you need to make multiple connections to some, you would generally either mount the Nano with its pin headers soldered into stripboard or your own PCB, or plug it into a terminal adapter such as this:

Woe be to me for thinking I could solder my own pin headers, turns out I suck at soldering after nearly destroying a 1602 LCD. So I'm trying to prototype just with the jumper wires twisted into arduino's pin holes. Once I'm done I'll ask a guy I know to put everything together on a PCB.

industrial quality contactors are expensive I would think that the Sparkfun 20Amp would switch a 2.5amp induction motor OK I would still prefer to see the AC1 and AC3 ratings you could always contact Sparkfun and ask

the RAJLITE contactor explicitly specifies the AC1 rating at 20A and the AC3 rating at 16A

Relay link corrected: https://www.tanotis.com/products/genuine-sparkfun-relay-spdt-sealed-20a |500x500 Note that it is rated - as I suggested - at 20 Amps to make and only 10 Amps to break.

Since it requires 185 mA to operate its 27 Ohm coil (more than twice as much as your other relay), you will require a logic-level FET to switch it (bipolar transistors are so "eighties"). And sufficient power supply capability. :astonished:

coldbreeze16: I had no idea about how optocoupler isolated the circuit, but some googling shows there are costlier relays with 2/3 more pins on 5v side to be connected to 5v and GND. You mean those?

Sounds like it. They have two circuits (which may be tricky to figure out), one (two wires, generally a control pin and Vcc) to drive the optocoupler LED and one (two separate connections, run as a pair) to power the relay itself. But you probably want a module for your bigger relay. |282x500

coldbreeze16: I'm not getting this! I left the circuit running last night and it has been running fine so far, I just used my multimeter and the voltage is a solid 4.99V. Are you suggesting that driving a relay will turn up the heat?

Yes, The one you have requires about 90 mA to turn on.

coldbreeze16: Also how'd I use a phone charger? Stripping the micro USB end and putting in the vcc and gnd cables into the breadboard power rail?

Yes but ...

coldbreeze16: Woe be to me for thinking I could solder my own pin headers, turns out I suck at soldering after nearly destroying a 1602 LCD. So I'm trying to prototype just with the jumper wires twisted into Arduino's pin holes.

Seriously not advisable. It will drive you mad when it develops some "mysterious" random fault. :cold_sweat:

At this point, learning to solder is a requirement before you proceed further! :grinning: You cannot really practice electronic construction without. Practice, practice, practice. Even to strip cables you need to "tin" the stripped ends to make them usable.

a Expansion Board Terminal Adapter for Nano as recommended by @Paul__B in post #4 would be a good idea

Thank you guys, both of you! After your assurance I tested the circuit (just arduino with relay, set to trigger the relay 5 sec after being turned on). It turned on my pump just fine. I ran it for 1 min and turned off the mains but left the arduino with the relay on for an hour or so. Nothing was warm, I’ll use it tomorrow to actually pump water in tank and see how it goes.

Since it requires 185 mA to operate its 27 Ohm coil (more than twice as much as your other relay), you will require a logic-level FET to switch it (bipolar transistors are so “eighties”). And sufficient power supply capability.

Sorry for being such a noob but since there’s 700mA power available on the power rail and the rest of the components except the relay are drawing well under 100mA, will a MOSFET be really necessary?

At this point, learning to solder is a requirement before you proceed further! :grinning: You cannot really practice electronic construction without. Practice, practice, practice. Even to strip cables you need to “tin” the stripped ends to make them usable.

Yes! Just ordered a micro soldering iron and I’m gonna practice on the board of whatever electronics I can salvage.

a Expansion Board Terminal Adapter for Nano as recommended by @Paul__B in post #4 would be a good idea

So that’s what these are! I’m just discovering stuff. Will order this https://robu.in/product/nano-io-shield-expansion-board-arduino-screw-terminals/

Thanks again guys. I have one final hiccup and it’d be kind of you if you chime in on this other question on the forum that I had.

coldbreeze16: Sorry for being such a noob but since there's 700mA power available on the power rail and the rest of the components except the relay are drawing well under 100mA, will a MOSFET be really necessary?

What makes you think you have 700 mA available? I have pointed out that the "breadboard power supply" cannot supply anything approaching that for any significant time. Unless by the way, you feed it with a USB "phone charger" connected to the USB jack although that may be limited by a 500 mA "polyswitch" (component labelled "T050" in this photo). |500x500 You do not need a FET to switch the relay - unless perhaps, you want it to actually be controlled by an Arduino pin which can only safely supply 30 mA. The relay board I cited does of course include a transistor for that purpose.

coldbreeze16: Yes! Just ordered a micro soldering iron and I'm gonna practice on the board of whatever electronics I can salvage.

Not sure what a "micro" soldering iron might be, but you need at least 30 W and preferably temperature regulated for general electronic work. Practice on junked PCBs is highly recommended. :grinning:

What makes you think you have 700 mA available? I have pointed out that the "breadboard power supply" cannot supply anything approaching that for any significant time. Unless by the way, you feed it with a USB "phone charger" connected to the USB jack although that may be limited by a 500 mA "polyswitch" (component labelled "T050" in this photo).

My breadboard power supply has a USB port too, I could use that.

Not sure what a "micro" soldering iron might be, but you need at least 30 W and preferably temperature regulated for general electronic work. Practice on junked PCBs is highly recommended.

It's the one with a pencil like pointed tip unlike the flat tipped one I have. I am not sure what they are called as.

Yes, you do need a reasonably fine tip, but it needs s bit of power behind it so joints are made quickly.

coldbreeze16: Arduino pro mini

coldbreeze16: The nano isn't powering other stuff

?

Details, details! :roll_eyes: