Building Section and Machine Control - For Beginners

Hi All,
The plan is to build and document building a box that will allow for section and machine control that will work with AOG. The idea now is to build a seperate box that will work with relays to do section control for a start and then expand from there. Throw your ideas our way and we will see what happens.
Curt

2 Likes

Ok first thing you need is a parts list.

  1. Arduino Nano.
  2. Nano breakout board. Expansion Board
  3. Dual relay board or 4 channel or 8 or… Dual Relay Board
  4. interconnect wires (or just some fine wire stripped on ends) Dupont wires

You also need a little board (15x8 cm) to mount the parts on and some small #4 screws about 1 to 1.5 cm long. Also a usb cable to attach nano to your computer

We will be building this.

WIN_20200131_09_03_30_Pro

Based on this video.

2 Likes

Hello,
I’ve started building the system for my sprayer (7 sections) around an esp8266 as wifi station
udp client, so I installed it directly on the sprayer without wiring.
It catches the udp frames from aog port 8888 to control the relays.
Here are the parts from china
IMG_20200131_202104
Here is the schematic
Section
I’ve chosen Lolin esp8266 module because it has a lot of I/O, i’ve kept
GPIO for I2C link in case of future optocoupled I2C input module or display.
GPIO01 and GPIO03 remains free for debug (or serial connection …)
I’ve put 2 relays board in parallel because my sprayer requires one DPDT switch per section
(not finished defined, because I need also a signal for the regulation of the sprayer)
For configuration SSID, pwd IP address of aog, ports etc … I just switch DTR (GPIO0) to access to a simple
Html frame which allow configuration.
SectionHtml
The “problem” (more or less) is that I’ve written the software in lua over Nodemcu at the time beeing which is not optimum, but it’s OK.
francois

3 Likes

Once you got all the parts, we will start out with just turning on/off the relays without AgOpenGPS. The code below is from the “Blink” sketch that all arduinos come with, and are the hello world of programs. Along with the LED blinking, we will also turn the relays off and on at the same time. We’ll go thru the whole setup of the Arduino IDE, programming, follow thru the code etc.

I have a 4 relay, an 8 relay and Nano now. I have ordered a 16 relay and the breakout board so supposed to have them mid week. In a few days supposed to have all the parts for autosteer setup and USB hub etc so should be able to show a complete layout

Excellent. Do you have the breakout board for the nano?

Hopefully we can keep this simple to show how to make only the relays work for now for section control - and then include more.

No, breakout board for nano is mid week. Then I should be able to put it together

Your V4 has 16 sections? Do you want to show building that big or a 4 or 8, similar idea just different pin hookups

Well exactly, going thru the process is the same for 1 and for 4 or 8 or… Just shampoo, rinse, repeat. But understanding the process - that’s key

Only difference would be documentation on as to what pins to hookup? I was thinking about the relays, is there any chance of back feeding voltage from one to another because we are using a common power source or is there protection from that built into boards? Also my plan was to power relay board from switched power on Pcbv2 board with a fuse between that and relay board. Is there enough power going through pcbv2 or should relay board go straight to battery?

I just like the idea of power through pcbv2 so relays have no chance of coming on unless steering board is on

Then you should put on a power supply as well for the relay board - use the switched 12v coming from the autosteer board, thru a 5v supply on the relay board.

The big 16 relay board has its own 12v in 5v supply

The autosteer power supply isn’t designed to run external hardware.

But again, this is about learning the basics first, just use the usb power from computer at first

Makes sense, I was just thinking of taking the switched 12volt from the autosteer board to relay board but will just take a fused 12volt supply from battery to relay board. The Nano will be plugged in via USB to a powered USB hub so that should supply it’s power.

1 Like

Ok time to go step by step. First thing - install Arduino IDE.

Now make sure to install the drivers for the compatible non arduino official Nano. The driver is a CH340/341 type. This is an important step, be sure to watch and listen carefully. Ch340 drivers can be found here:

Arduino CH340 Drivers

And a video to watch:

An other detail for the software on the nano (I’ve done it on my ESP8266)

  1. On my sprayer, there is a “general” off valve which release completely the pressure if no section are used. In the program of my ESP8266 section control, the 8th relay is a logical or of the 7 other section for general Off.
  2. I’ve also added a timeout of a couple of seconds which switch off all sections in case of broken link
    Specialy in my case, esp8266 works over wifi. (See in the programmation picture above : Timeout Serveur = 5 sec)
    I think it could use also the serial link without any big modifications, if someone is interested …
    Best regards
    francois

Ok so here is a bit about the Arduino IDE. Making sure you have everything done right.

So now the Nano is hooked up, you see it in Device Manager, and in the IDE, time to program it with a very simple built in sketch to blink the built in LED connected to pin D13.

Ok so time to build our little test relay board and write the code. Really simple circuit, connect the following:

Pin +5v of the Nano to the 5v of the relay.
Connect Gnd of the Nano to Gnd of the relay board.
Connect D4 of the Nano to Relay board Input 1
Connect D5 of the Nano to Relay board Input 2

Let me know when you have that done.