ESP8266 running 3 soil moisture sensors?

Well, before you start adding any more sensors, you need to re-structure this code so that it’s Blynk friendly. This means:

  • Removing everything from your void loop except Blynk.run and Timer.run (the Timer.run will become clear later

  • Removing all of the delays from your code

  • Putting the code you’ve removed from void loop into a function that’s called by a timer (hence the Timer.run in void loop)

You really don’t need to be checking your soil moisture level every second or two - pick a sensible frequency at which your timer calls the moisture testing processs.

You should look at the logic of your if then else statements, and use sensible variable names like ‘Notification_Sent_Flag’.

Your additional sensors will need to be attached to their own GPIO pins, and make sure that you choose ‘safe’ pins for this. See this post for more info:

You will also need additional functions to check each of the sensors, but you’ll need to be sensible about how you handle your notifications. You can only send one every 15 seconds, and you should really have one that tells you the status of each zone that your email monitoring.

Don’t make the mistake of calling all three timers that monitor the various zones at the same time. Have them on different timing schedules, or call them one after another.

Pete.