Opinions on improving the system (ESP32, soil sensor)

Hi,

I am currently working on a project that focuses on monitoring the soil parameters (moisture, pH, NPK, temp, EC, etc.) using industrial grade sensors and ESP32 as mcu.

The prototype system that I've built so far is shown in the schematics here. The ESP32 runs on 5V through a DC-DC buck step down voltage regulator. The sensor uses RS485 protocol hence the MAX485 converter is needed.

I'm planning on implementing a low power consumption design by putting the ESP32 in deep sleep when idle. There's a lot of tutorials online that can guide me how to do it, but my question is since the soil sensor is running on direct supply (the min voltage needed is 12V), does the sensor drain battery if the ESP32 does not request data from it? (Anyone has experience using such sensor?).

I don't have much electronics knowledge in general, any idea how I can measure the power consumption by the components? Also let me know if you guys have any other idea(s) to improve the soil monitoring system, I'd definitely appreciate it.

Hi @fakhrullahs ,

Welcome to the forum..
lol, you know, looking at that fritzing, i'd say you be blowing some bucks.. :slight_smile:

~q

probably going to have to take some measurements to be certain..

got a volt meter??
Measure-Amperage

curious, the esp32 is 3.3 what driver board are you using, might want a volt divider on the rx line so you don't clobber the esp with 5v if your module is a 5v unit..

good luck.. ~q

Sorry my english isn't really good. Are the connections bad? :sweat_smile:
I've run the system so far the sensor is giving consistent readings. No idea how it's going to sustain in the long run though.

sorry, i should watch out for that..
bucks is slang means money..

look at the outputs of the buck, it's shorted..

~q

I do have a multimeter, however i didn't know how to use it and i broke a sensor as I might've short circuited it for connecting the ammeter in parallel with the sensor and voltage buck converter :smiling_face_with_tear:

Its a nodemcu esp32wroom

I've read online the Vin needs 5v for the Vin port

Oops small mistake in the schematics

1 Like

I was asking about the max485??
I know your esp32 is 3.3v..
But that max485 may be a 5v unit, which means the RX pin on the esp32 could be sent 5v which is not good, should be max 3.3v..

~q

Yes, it has it's own 3.3v regulator..

~q

It's a 3.3V unit

good..
measure the amp draw on the sensor..
if it's too much, maybe you could use a relay and power it down before going to sleep..

~q

Will do once I get back to the lab. Thanks

1 Like

Apparently, the sensors would run even when the esp32 isn't requesting data from them. So I decided to implement a n-mosfet that acts as a switch, together with a pull-down resistor. If the input from an esp32 I/O is low, it would turn off the switch and disconnect the circuit, effectively reducing the power consumption by both sensors and max485 module.

Now I want to know if the mosfet connection is correct and whether it is safe for the esp32 i/o. Can someone clarify? :thinking:

I don't think you are ever getting good battery life with this setup. That step down converter is probably drawing a lot even without load. You could use 6V battery for esp and boost converter for your sensor. Then put a relay to cut voltage to boost/sensor when not needed.

Hmm
My initial idea was to add more components that operate at 5v in parallel with the max485 module in future, so 6V might be too much for them, but if i use 5V battery, its voltage discharge over time might not be enough to power those components. (From what I understand) Unless I use another voltage regulator but that might consume more current no? :thinking:
Also, doesn't relay consume more current when ON? that's why i plan to use transistor.

Either way, I'll have to check current draw by the buck converter to see if it's significant enough to turn off loads when not in use. Gotta find time to test this system in the lab again.

I would power max485 from esp 3v3 pin. I don't know your module, but mine are working reliably.
Advantage of relay is that it only draws current when "on", so if your setup is sleeping 99.99% of time, consumption would not be relevant.

Noted. My max485 module needs 5v to run.
Relay that's currently available operates on 5v, can the esp32 gpio power it though?

I see you wrote that your max485 has voltage regulator. Are you sure?? Put a link.

No, you shouldn't drive it from gpio, do it with transistor or better, buy a relay module.

Edit:

Actually , if you have boost converter with enable-pin, you don't necessarily need relay at all.

https://my.shp.ee/gXGtxAx
Not sure if you're able to access that link but it says the module needs 5v as i tested powering it using 3v esp32 pin and it wasn't enough.
So i'd still need to use a transistor then, because there's thousands of them but a relay module in the lab which comes back to my initial question: was the mosfet connection correct? :S

No , link doesn't open. But you can have a look at your module to identify voltage regulator.
I don't see any sense to look at your mosfet circuit, before you have verified current draw of your buck converter. I would estimate that it's going to suck your battery quickly even if you don't power up your sensor. That's why I proposed boost converter circuit option.
I also wrote "Actually , if you have boost converter with enable-pin, you don't necessarily need relay at all."

1 Like