How to send control signal to sensor (arduino/ rasberry pi like)?

Now i can receive sensor data in farmOS. also, send high temperature alarm to email via farmOS notification module. but, now i want to sent control signal like motor ON or OFF to arduino or rasperrypi. please any one guide me?.

2 Likes

I probably suggest Node-Red too often around here…
But in this case Node-Red is probably the ideal solution.

You’ve a couple of options, personally i’d send the sensor values direct to Node-Red and have it handle all of the alerts/ automation and just forward the sensor values on to farmOS.

I wouldn’t rely on e-mail notifications to control a motor if it is critical for cooling.

Edit:
I’ve done some experimenting with external notifications from farmOS in the past, take a look here:

but again if it is a critical response to an over temperature event then less is definitely more, handle it directly with your microcontroller if possible or at least within one application if using GPIO on a Raspberry pi.

1 Like

I would second @Farmer-Ed’s Node Red recommendations! You can do a lot with that outside of farmOS!

I wouldn’t rely on e-mail notifications to control a motor if it is critical for cooling.

This is a very important point! You should never rely on a remote system (farmOS or anything else) to control critical systems! You should not rely on network connected servers/devices, because the network can go down.

Instead, it’s best to have all the logic necessary live on the device that controls the motors/actuators/etc, and only use farmOS as a “suggestion”.

For example, if you are controlling fans on a greenhouse, the Arduino that is responsible for turning the fans on/off should be measuring temperature itself. It can then send temperature data and motor on/off statuses to farmOS for you to see remotely.

If you need to control remotely, then one option would be to use a single data stream as a “trigger” with a 1 or 0 state, and set up the Arduino so that it checks the value of that data stream to see if it has changed. If it sees that it was set to 1, turn on the fan. If it was set to 0, turn it off. Then you can set the 1/0 values in any number of ways on your end. But either way, it’s a good idea to make sure the Arduino is capable of working without farmOS, so that it is resilient.

Good luck! :slight_smile:

1 Like

@Farmer-Ed , @mstenta ok sir, thank you.

2 Likes