How do I connect 6 Relais for sprayer

Hello, I use Brians latest 3.09 AOG with a simple construction. Only adruino nano, WAS, Cytron. Everything conncted with wires.
Now I would like to build a section control for my sprayer. At wich ports on the nano do I have to wire Relais 1-6?

Which Arduino sketch are you using? Is it the RelayPort.ino? If so the signal wires you need to connect to the relay signal inputs are pins D5-D10.

It is a little confusing for me. There is a “relay.ino” file in the “autosteer”-folder. And there is a seperate folder for relays also having “relay.ino”. Do I have to use a seperate arduino to trigger the sprayer-relays and install the second relay.ino on it?

Now I have used port D6 for the steerswitch.

Oh right, my mistake. There are two sketches (folders) in AOG, one for use with the PCB that has steering and relays on it, and one sketch for just relays if you’re not doing steering. The main ino file will always be the same name as the sketch folder, so you can easily identify it. The other ino files within the sketch folders are just subroutines basically.

In the AutosteerPCBv2 sketch folder, the relay pins aren’t defined for you, but it looks like you define them yourself to be whatever pins you want. If I’m not mistaken you can use any available digital or analog pin for this. Probably the easiest way to do this is to place the #defines in the Relays.ino file at the top. Something like this:

#define RELAY1_PIN D3
#define RELAY2_PIN D4
#define RELAY3_PIN D5
#define RELAY4_PIN A3
#define RELAY5_pin A4
#define RELAY6_pin A5

etc, based on whatever pins you have available. Also if your relay boards happen to have active low signals you can alter that in Relays.ino too, but most relay boards I’ve seen are active high.

Thanks for your reply, torriem. So, if I understand correct, I have 2 possibilities?:
1.: I can use 6 free ports on the arduino that is doing the steering
2.: I can take another arduino nano that only gets the Relay-sketch and controls the sprayer . This arduino will be conncted via usb to the pc.

The second option would be perfect, so I only need to connect one usb-cable when I use the sprayer.

I believe so.

Isn’t the Arduino that’s doing the steering also connected by USB? Or is it using bluetooth?

Right, That arduino is also connected via usb. I have got 7 USB-ports, so no problem.

1 Like

Hello! I also tried to use the autosteer arduino for control 4 sections but it doesn’t work… I have define pins as you have mentionned but nothing on my relay board…
AG open GPS know i dont want to use relays for uTurn but only for section control ?

Thanks a lot.


I used U-turn settings, and auto (on and off) maybe also set some relays!
But you must be inside a boundary like you see in attached image.

1 Like

Thanks Lars !

But with this solution, we can’t use as a section control solution ? If i placed 6 section of my spreeder and cross an already worked passage with angle, the sections can’t cut one by one ?


I have not tried, but did you set this part of the autosteerpcbv2.ino correct

#define Relay_Type 0 // set to 0 for No Relays
// set to 1 for Section Relays
// set to 2 for uTurn Relays


I have try with set at 1 for section controle but nothing at my relay board…
I must continue to search…


After definig Relay_Pins you muct also set what those Pins should do.

pinMode(RELAY1_PIN, OUTPUT); //configure RELAY1 for output
pinMode(RELAY2_PIN, OUTPUT); //configure RELAY2 for output
pinMode(RELAY3_PIN, OUTPUT); //configure RELAY3 for output
pinMode(RELAY4_PIN, OUTPUT); //configure RELAY4 for output
pinMode(RELAY5_PIN, OUTPUT); //configure RELAY5 for output
pinMode(RELAY6_PIN, OUTPUT); //configure RELAY6 for output

Thanks a lot !! It was my mistake…


Cause of the change coming with V4, relais and section control will be removed from the autosteer board. Also from the INO. So if you have plans to build a section control you will need a second arduino nano.


Hello, how do I have to change the high low state in the sketch, do you have an example.
Thank you for your time

What do you want? Section on is relay off, section on is relay on. The relais bords mostly have NO and NC contacts. Why do you need to change the high low state?

Yes, Richardklasens is right, it depends how you connect the section valve to the relais. Take a look in the arduino relais sketch, it is easy to understand.
Yesterday I made my first run and it works great. AGO 3.09. I build a complete new controlbox for my sprayer, so I could easily integrate a arduino nano and a relais-board.

Attention: in V4 the answer from the Sprayer to AOG (for position of the switches) needs 2 bytes PGN at the start.

If you don’t send switch status back, it dosen’t matter.

For ESP32 it is selectable via webinterface

For Nano see line 349-352

Thanks for your Answer
I am using for example this relais in several Implements

I was using Cerea an want to switch to Ag open. In my installations the Section is active when the Relais ist turned on and ist disabled when the Relais ist turned off.
In my test Ag Open did it the other way around. So I do like to switch this in the sketch so I dont have to change all the wires .