TTGO T-Higrow ESP32 Plant Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Haldi_2
Normal user
Posts: 53
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: 8643
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: 53
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: 8643
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: 53
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
New 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: 53
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: 8643
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: 53
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: 8643
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: 53
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: 53
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: 8643
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.

fumi38
New user
Posts: 1
Joined: 19 Jan 2021, 02:12

Re: TTGO T-Higrow ESP32 Plant Sensor

#14 Post by fumi38 » 19 Jan 2021, 03:16

Haldi_2 wrote: 24 Sep 2020, 15:16 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
:
:
:
I have ttgo higrow too.

The esp32 adc is known to be somewhat inaccurate.
But The ESP32 has values ​​in the chip to correct individual errors. Fixing it with this will be pretty accurate.
When I tried it, it almost matched the reading of the digital multimeter.

It is available as analogReadMilliVolts (pin) in version 1.0.5 of arduino-ESP32.
https://github.com/espressif/arduino-es ... -hal-adc.h
https://qiita.com/fumi38g/items/2fe0c4474d247cf422d6

to use the stable version 1.0.4.,here.(sorry,japanese)
https://qiita.com/fumi38g/items/bb728a0ee6f9094db4b9
https://qiita.com/koichaman/items/8c98ee5b6028e8d80703

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#15 Post by Haldi_2 » 27 Jun 2021, 14:58

Running roughly 2 months with 10 minutes intervals and 1sec uptime.
Screenshot 2021-06-27 145345.png
Screenshot 2021-06-27 145345.png (23.62 KiB) Viewed 19985 times
But sadly with that short uptime it doesn't properly measure temperature and ommit's it mostly.
Screenshot 2021-06-27 145500.png
Screenshot 2021-06-27 145500.png (135.44 KiB) Viewed 19985 times
Oh... and you can see when i unplugged the Sensor on 05/24, some dirt was still stuck on it So it increased from 40-60 Range to 60-80 range....

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#16 Post by TD-er » 27 Jun 2021, 15:18

What does the red line represent?

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#17 Post by Haldi_2 » 31 Jul 2021, 07:33

That's the automatic Battery Warning of 3.3V from Grafana.
Not a graph but a system value

Jimmy123
New user
Posts: 1
Joined: 09 Aug 2021, 09:58

Re: TTGO T-Higrow ESP32 Plant Sensor

#18 Post by Jimmy123 » 09 Aug 2021, 10:07

Hey everyone - I bought some of these sensors to help work on an algorithm but I'm having strange Lux readings with the BH1750 - Does anyone know what the default measurement outputs at? Testing against standalone light sensors and it seems to be around 10-13x lower.

Sorry, I'm not too experienced in this.

Thanks

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: TTGO T-Higrow ESP32 Plant Sensor

#19 Post by Ath » 09 Aug 2021, 10:41

Does the BH1750 have unrestricted access to the light? Isn't it partly covered by something or in a shaded area? There may be some cover on the chip to protect it during transport, or to reduce the amount of light when placed in direct sunlight, as it normally doesn't have the high-lux capability required to measure direct sunlight. And it seems somewhat direction-sensitive to me, so you have to make sure it is in the same direction as the external sensor (assuming that is also a BH1750 you're comparing it with?).
/Ton (PayPal.me)

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#20 Post by TD-er » 09 Aug 2021, 10:58

Is the sensor behind some glass that may filter out some of the spectrum?
Or is it possible it receives some reflections?

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#21 Post by Haldi_2 » 15 Aug 2021, 12:35

Just leaving this here for other people interested in this Sensor:

https://flashgamer.com/blog/comments/re ... ure-sensor
https://flashgamer.com/blog/comments/hi ... erthoughts
There are so many things not working with this board:

Does not support low-power, so it must be powered at all times
Charging 18650 does not work well
The physical USB connector falls off if you’re not very careful. It’s a very low quality component that breaks much too easily.
Power usage fluctuates a lot between boards. Some can achieve as low as 50mA power draw when setup correctly. Others will start at 170 mA and then slowly increase up to almost 340 mA. This indicates that the production process is really bad.
Poor soldering is a staple of these boards
The Humidity sensors failed on more than 30% of the boards and the humidity variates so much that you cannot compare two boards at all
And he also tested alternatives.
https://flashgamer.com/blog/comments/te ... re-sensors

ro85ac
New user
Posts: 1
Joined: 09 Jan 2022, 15:02

Re: TTGO T-Higrow ESP32 Plant Sensor

#22 Post by ro85ac » 09 Jan 2022, 15:06

How did you calibrate the sensor because mine (I have 4 pieces) always shows between 22% - 65% (as 65% in water) no matter the battery voltage?
Haldi_2 wrote: 24 Sep 2020, 21:15 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.

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

Re: TTGO T-Higrow ESP32 Plant Sensor

#23 Post by Haldi_2 » 24 Jul 2022, 19:33

ro85ac wrote: 09 Jan 2022, 15:06 How did you calibrate the sensor because mine (I have 4 pieces) always shows between 22% - 65% (as 65% in water) no matter the battery voltage?
Two Point Calibration in the Analog input settings.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 35 guests