24V relay with nodeMCU

Thread Starter

calinc

Joined Oct 16, 2020
1
Hi
I need to control a window motor with a relay; because the motor is powered by 24V, the first though was that I need a 24V relay, so I bought one.

1. And I bought the relay from image1
It works independently, without arduino. The problem I'm seeing is if the sensor detects the rain it starts the motor, and the motor will be under load until the rain stops, which is not OK.
rs
2. There is another relay (which I don't have) which has 3 pins VCC, GND si IN; sensor detects rain, tells to nodeMCU, and the board sends to IN pin the command to start the motor, and after (let's say) 30 sec I can send a command to stop the motor, so the motor will be not under permanent load.
rn
3. So, I have the 1st relay; can be used this relay to adapt the circuit from 2?
Question: can be made the circuit sensor - arduino - relay from 1. so the sensor detects rain, tells arduino and then the board commands the relay?
The issue is that in this case we have 2 relay pins (where the sensor was firstly linked) which must be used to make the connection arduino-relay. Can we use those 2 pins or just 1 to connect them?
In circuit 2. we had only 1 pin - IN - and not 2.
Can this be done?
rsn
Thank you
 

sghioto

Joined Dec 31, 2017
8,634
Some links to the actual modules in question would be helpful. Photo #3 should work, but you will most likely need the module connected to the rain sensor. I assume that is some kind amp or comparator.
Another option from photo #1 is to connect a normally closed limit switch activated when the window is fully closed.
SG
EDIT: Just noticed the relay board in photo #1 is made to work with a photocell. Basically a light/dark detector. That is not going to work with the rain sensor. Found a link to the module a XH-M131. The relay will be activated when the sensor is dry.
Here's a module made for rain detection.
1602884059035.png1602884059035.png
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,508
The solution is simple, which is to have limit switches to stop the motor at window closed and window open positions. The arrangement is a classic circuit and even found here in a few older threads.
 
Top