Added Section Controll to an Müller Spray Controll S terminal with an ESP32 connected to AOG via Wifi / UDP. The sprayer is equiped with five sections and motor valves. This means the polarity of motor must be changed. Therefore ten relais were added in terminal box. The signals for orignal sections LEDs have cut on original pcb and connected after added relais, so they do Show the real state. Also added an switch for Auto/Manual mode. This switch also powers relais only in Auto mode, by interrupting GND. Manual section switch feedback is returned to ESP. Code is based on MTZ8302. Only smaller adjustments were made (some negations).
One line was added, avoiding “double turn Off = On” when using manual switch in Auto mode.
last lines in relay.ino should look like this:
for (byte i = 0; i < SCSet.SectNum; i++)
{
if (bitRead(RelayOUT[0], i) == LOW) {
//add for mueller teminal: if switched of by hardware switch → turn relais on, or it would be double off → on!
if ((AutoSWVal) && (SectSWVal[i] == LOW)){digitalWrite(SCSet.Relay_PIN[i], HIGH);}
else
{digitalWrite(SCSet.Relay_PIN[i], LOW);}
}
else {
digitalWrite(SCSet.Relay_PIN[i], HIGH);
}
Video: