TTGO T-Higrow ESP32 Plant Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

TTGO T-Higrow ESP32 Plant Sensor

#1 Post by Haldi_2 » 24 Aug 2020, 18:33

Sup,

I had a few Plant Soil Moisture sensors lying around already, but now i've bought the whole in one Package from Lilygo.
Image
Image

And because i'm a big fan of ESPeasy and already have few ESP8266 with BME280 Temp/Humidity in my Home i tought instead of writing my own Code lets give it a try. first time on ESP32 but someone already got this thingy working with ESPhome so it should be possible!

As Expected Flashing with espTool didn't work. But thats no issue, the .bin file can be flashed via the ESP32 Flash Download Tool. I used the ESP_Easy_mega_20200812_custom_ESP32_4M316k and it worked right away. Strangely I did have some extreme lag in the WebUI Until i've plugged the power for 3-5 minutes, after that it was back to normal.

Things nice to know:
Pin 4 Has to be set to High on Boot for the Sensors to be turned on!
I2C Ports have to be manually changed for the BH1750 Light sensor to be recognized.
Analog Soil Moisture sensor works fine but i never managed to get any readings on the Salt Sensor (GPIO 34)
The BatteryVoltage according to liligy Github code is off by about 0.1V .... gonna try more with a decent power supply that allows for specific voltage when it arrives.

Sleep seems to work fine. According to my cheap USB Powermeter the device uses 0.015A when under full load and 0.007A when in deep sleep.


I've currently plugged a 18650 Battery and 10 Minutes Sleep with 15 second wake time (Set to 10 Seconds, but guess it takes longer to send all values via UDP). Will update about Batterylife after a few days.



Does anyone have a good idea what function i could put on the GPIO35 aka "Wake Button"? Pressing Reset pretty much wakes up the device so there is no need for a extra button.
And what is the correct configuration for Timing with Sensor Values and Sleep?
I've currently set 10s Wake, 590s Sleep and Sensors to 590s. Does that matter? Or is it enought to simply set Sensors for longer than the Wake time? i.e 20 seconds and it will poll once when it wakes up and then go back to sleep.


Greetings,
Haldi

TD-er
Core team member
Posts: 3299
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: TTGO T-Higrow ESP32 Plant Sensor

#2 Post by TD-er » 24 Aug 2020, 22:28

I wouldn't use such a long task interval (assuming that's what you meant with the sensor timing).
If you don't want the sensor to send multiple times while awake, simply set the interval slightly higher than the awake time.
Some plugins only give out a proper value at the second reading.

You could also let the sensors run a few readings and just collect their data via rules and only send the data at once via the rules instead of via the connected controller.
Then you know when you're ready and call to go to sleep from the rules.

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#3 Post by Haldi_2 » 29 Aug 2020, 13:19

Luckily all the sensors onboard this board seem to send the proper value the first time it get's read.
Maybe it only reads sensors after WiFi is connected and not straight at boot? Might give it some extra time.

I've tried Sensor values every 10 seconds, and sleep 10 seconds, wakeup and send all.
Ran both for about 2 minutes and got pretty much the same values.
Seems like everything works fine out of the box. No need to play around with rules.

I've now set the Awake time to 1 second.
Right at boot it only sends 1 Value, but after the first deep sleep it properly sends all values and then goes to sleep.
So Wake time is around 7 seconds right now.


P.S Sent a coffee your ways. Really like the job you guys doing.

TD-er
Core team member
Posts: 3299
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: TTGO T-Higrow ESP32 Plant Sensor

#4 Post by TD-er » 29 Aug 2020, 15:42

Nice to hear it is all working out of the box already :)
And thanks for the coffee

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#5 Post by Haldi_2 » 29 Aug 2020, 16:48

One thing that isn't perfect is the DHT11 Temperature Sensor.

Not sure if it failes to send data via UDP, or the sensor itself just doesn't want to read Data but i often get missing Temp/Hum values, while Soil and Lux sensors work fine.

Image

I didn't realize and missing values when i used Serial to monitor the sensors... so i assume it's an connection issue.

D1_PITER
Normal user
Posts: 1
Joined: 02 Sep 2020, 08:04

Re: TTGO T-Higrow ESP32 Plant Sensor

#6 Post by D1_PITER » 02 Sep 2020, 11:19

Hi. What operating time did you manage to achieve on a single charge?

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#7 Post by Haldi_2 » 24 Sep 2020, 15:16

Not entierly sure as i don't know how many mAh this battery here has ^^ some standard 18650 thingy.
Going by 10 Minutes Sleep and 1s awake i managed to run about 19 Days.

Image

Getting some better battery soon and also a battery tester to accurately check how many mAh can be drawn from them :)



P.S.
The battery Voltage is somewhat wrong.
Did some tests with a Power Supply connected to the battery input and the correction formula from TTGO: /4095*2*3.3*1100

Input Voltage Read
5.0 4960
4.9 4840
4.8 4740
4.7 4630
4.6 4500
4.5 4400
4.4 4290
4.3 4180
4.2 4090
4.1 3970
4.0 3870
3.9 3770
3.8 3660
3.7 3540
3.6 3440
3.5 3330
3.4 3210
3.3 3110
3.2 3000
3.1 2870
3.0 2770
2.9 0

But as you can see it's off quite a bit. At 2.9V the Board doesn't get enough Voltage and stops sending UDP packets.

But as always ESPeasy helps out all your needs :)
Setting a Calibration factor:
1562 -> 3000mV
2797 -> 5000mV
Solves all issues and accurately shows Input voltage via vBat monitor on GPIO33

Image



Another interesting thing i've found was that Amperage is sustained through Voltage range... in Idle the device always uses 0.085A no matter if you have 5V or 3.1V on the battery. This results in either 0.26W or 0.42W Power drain. So using lower Voltage Batteries is actually beneficial to this device.

Image
Image

P.P.S peak goes up to 0.170mA
AND when the device is powered up by Battery and not reset it will get stuck in some strange loop and be on 0.170mA and never go down to 0.085mA and the Web Interface feels totally sluggy. Also the Analog voltage is off by about -140mV. Not an issue if you use deepsleep anyway^^

TD-er
Core team member
Posts: 3299
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: TTGO T-Higrow ESP32 Plant Sensor

#8 Post by TD-er » 24 Sep 2020, 16:52

If you're using a linear voltage regulator, then it makes perfect sense if the current is constant (apart from the peaks at boot and RF calibration of course)
If not, then I can't explain why you should have a constant current regardless the supplied voltage.

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#9 Post by Haldi_2 » 24 Sep 2020, 21:15

probably a LDO on the TTGO T-Higrow for battery voltage input.

Aaaaand i found another issue....
There is a voltage drop of about 0.2V if you use some sensors at the same time while reading battery voltage, which is exactly what is happening if you boot the devices from DeepSleep.
Setting a correction of +180mV does give a proper value for me now. (Instead of creating a Custom rule and delaying Awake time just to get accurate Readings.)

Edit: Scratch that.... right after i unplugged the PSU and connected the Battery it was back to working perfectly as calibrated, no more need for the +180mV, no clue where that came from.


Also the Soil Moisture sensor is analog, so everything below 3.5V seems to give inaccurate values.
I've calibrated mine to go from 0% to 100% (as 100% = in water) and currently on the table completly dry i have a value of 6% with 3.5V and higher.
3.5V 6%
3.4V 13%
3.3V 19%
3.2V 25%
3.1V 31%

Below 3.3V DHT11 also seems to be affected, Temperature still works but Humidity is increase by 10% at 3.2V and +20% on 3.1V.
As i've ordered a few more of those i'll try with some others if they all behave the same.




P.S Sadly the DPS5005 device does not allow for saving data as .csv -.-
Image
But i'm pretty sure the numbers below are ticks and are going at 2hz so the 17 (from 1855 to 1872) shown there would be 8.5 seconds.
Already ordered a DPS8005 now...
Last edited by Haldi_2 on 25 Sep 2020, 11:38, edited 1 time in total.

TD-er
Core team member
Posts: 3299
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: TTGO T-Higrow ESP32 Plant Sensor

#10 Post by TD-er » 24 Sep 2020, 22:57

A DPS8005 is even worse in resolution as it has a voltage range of 80V but still uses the same resolution A/D converters

If you have the Bluetooth interface, you could also run the Android app.
As far as I remember, the app could save the recorded data, but that's quite a long time ago I used it as the Bluetooth link was somewhat unstable (it could hang the power supply unit)

And the voltage drop you may experience when drawing more current may also be caused by the used cables from the power supply to the module.

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#11 Post by Haldi_2 » 25 Sep 2020, 11:40

Yeah, thats if you use the app in the package from mediafire.
If you use the new Google Playstore app "RuiDeng" it works without hanging. But whenever you try to save data it says you don't have an app that works with this files ^^

No clue where the Voltage drop suddenly came from.... But it's gone when directly using the battery. so thats fine.

Haldi_2
Normal user
Posts: 7
Joined: 24 Aug 2020, 18:10

Re: TTGO T-Higrow ESP32 Plant Sensor

#12 Post by Haldi_2 » 01 Oct 2020, 15:13

So i did another quick Run, using 53s Sleep 1s awake (realtime 7 seconds) which is perfect 1 Minute intervals.

Ran for 6 Days 1 hour 20 minutes which would be 8720 Minutes aka 8720 Wakeups.
Simply upscaling with a 10 Minute Interval that should easily get 2 Months Battery life.

Image
Image

TD-er
Core team member
Posts: 3299
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: TTGO T-Higrow ESP32 Plant Sensor

#13 Post by TD-er » 01 Oct 2020, 16:45

You cannot extrapolate it like that, as the ESP and the parts mounted to the board all consume some quiescent current while the ESP is in deep sleep.

An ESP8266 will roughly take 60 uA when in deep sleep. The ESP32 is probably less.
If you still have an USB to serial chip on board, the quiescent current will be higher.

The same for other chips, which almost always have some residual current drawn.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests