Use the 3rd unused relay


Hello everybody,

If you know, the pin 7 is connected to the 3rd relay but unused.

I want tu use it with this code:

define Pin7 7

void setup() {
pinMode(Pin7, OUTPUT);
digitalWrite(Pin7, HIGH);

void loop() {
// Pin(7) HIGH
digitalWrite(Pin7, HIGH);
// Pin(7)LOW
digitalWrite(Pin7, LOW);

But the arduino run with the file: src>module_handler.h & module_handler.ccp

We see that in the module_handler.cpp:

ActuatorRelay actuator_relay_air_heater_default(6, “AAHE”, 1); // AC port 4
ActuatorRelay actuator_relay_light_panel_default(8, “ALPN”, 1); // AC port 2
ActuatorRelay actuator_relay_air_humidifier_default(9, “AAHU”, 1); // AC port 1

And confirm the 3rd relay is free and not define!

Can someone help insert the use of the third relay in "timer?

Many thanks!


Anybody know? :slight_smile:


So i have find the answer and that’s work fine:


  • \file src.ino
  • \brief Enables project to run in arduino IDE.
  • \details See module_handler.h for introductory documentation.
  • \author Jake Rye
    include "module_handler.h"
    define Pin7 7

void setup() { // runs once
pinMode(Pin7, OUTPUT);
digitalWrite(Pin7, HIGH);

void loop() { // runs FOREVER!
// Pin(7) HIGH (ajust the delay)
digitalWrite(Pin7, HIGH);
// Pin(7)LOW (ajust the delay)
digitalWrite(Pin7, LOW);


Hi Richard,

In the file module_handler.cpp add the following lines of code

Under // Declare Module Objects
Just after ActuatorRelay actuator_relay_light_panel_default(8, "ALPN", 1); // AC port 2
Add - ActuatorRelay actuator_relay_<<CustomName>>_default(7, "<<CustomeCode>>", 1); // AC port 3

Within the initializeModules function
Just after actuator_relay_light_panel_default.begin();
Add - actuator_relay_<<CustomName>>_default.begin();

Within the updateStreamMessage function
Just after stream_message += actuator_relay_light_panel_default.get();
Add - stream_message += actuator_relay_<<CustomName>>_default.get();

Within the handleIncomingMessage function
Just after return_message += actuator_relay_light_panel_default.set(instruction.code,, instruction.parameter);
Add - return_message += actuator_relay_<<CustomName>>_default.set(instruction.code,, instruction.parameter);

Just replace <<CustomName>> with a desciptive name (no spaces) and replace <<CustomeCode>> with a 4 character code such as AIGL

This way you can use the custom code to control the actuator like so
switch on - AIGL 1 1
swicth off - AIGL 1 0


Many thanks JohnZ

Actually i use “delay” that’s work but each time the code freeze in the same delay of application.

In your code i want add one timer, how it’s possible?


@JohnZ I understand this Arduino part of the code, but do you know how I could add this new actuator to the grobot, so that it can control it automatically? The answer is in the gro-api part of the project. Did you take a loot at it?


Exactly, this is for the Arduino and for the control it’s with the API but for me at this step i use only an automatically timer on the Arduino.

Certainly others on this community know how it’s posible to do that. I hope have more information soon!


Any news on this topic ? I am NOT a programmer myself but I would like to use that relay for the water pump, as it will safe energy and noise when I would be able to switch it on and off within the GRO recipe.
@JohnZ: I searched the RPI for that module_handler.cpp file but the results where empty (this probably shows my level of programming expertise…:-/ ) can you point out for me where to look for that file ? Thanks !


@peperoni The module_handler.cpp is on the Arduino, not he RPi.