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

**URL:** <https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920>\
**Category:** Using farmOS\
**Tags:** support-request\
**Created:** [March 6, 2024, 7:37am UTC](https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920 "2024-03-06T07:37:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [March 6, 2024, 7:37am UTC](https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920/1 "2024-03-06T07:37:27Z")

</div>

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?.

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [March 6, 2024, 10:24am UTC](https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920/2 "2024-03-06T10:24:41Z")

</div>

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:

> [@External notifications, webhooks, MQTT etc](https://farmos.discourse.group/t/external-notifications-webhooks-mqtt-etc/1218):
>
> Any modules for 2.x in development for dispatching events to external applications? I seen this thread [Controlling remote devices from within FarmOS - #5 by MBConsultingUK](https://farmos.discourse.group/t/controlling-remote-devices-from-within-farmos/29/5) but presume its 1.x discussion. I’ve also tried a Drupal Webhooks module but so far have not gotten it to work. [Webhooks | Drupal.org](https://www.drupal.org/project/webhooks) I got the following in error logs after enabling and creating a new log. Are there routing differences between Standard Drupal and farmOS? Symfony\Component\Routing\Exception\RouteNotFoundEx…

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.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 6, 2024, 10:38am UTC](https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920/3 "2024-03-06T10:38:41Z")

</div>

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! 🙂

---

<div class="post-metadata">

**Author:** ![aathi179](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/aathi179/32/1539_2.png) [@aathi179](https://farmos.discourse.group/u/aathi179)\
**Post date:** [March 6, 2024, 10:54am UTC](https://farmos.discourse.group/t/how-to-send-control-signal-to-sensor-arduino-rasberry-pi-like/1920/4 "2024-03-06T10:54:25Z")

</div>

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