3 ms·
Awesome write up, I liked how accessible the writing is, as well as the fun tone. I have a problem where I will need to monitor the soil moisture of 20 trees i
by SCUSKU 3y ago
Awesome write up, I liked how accessible the writing is, as well as the fun tone.
I have a problem where I will need to monitor the soil moisture of 20 trees in San Francisco. My current thought is to strap an ESP32, Lora module, battery, and capacitive soil moisture sensor and to send data once every 6 hours or so.
I was wondering if off the cuff you have any suggestions or pointers on how to best approach this. Thanks and once again, thank you for sharing this!
- mwint 3y agoDo you need an ESP32 vs an 8266? I believe the 8266’s are more energy efficient. In either case, you can put them in a deep sleep that uses minuscule amounts of energy and can wake back up on a timer. I’d start there.
- SCUSKU 3y agoI think I am largely MCU agnostic, although preferably something where I can use Arduino since I am familiar with that. Good to know that ESP8266 is more energy efficient. I have seen this video which demonstrates that the ESP8266 can run off 2 AA batteries for 425 days [1]. Another thought I was having was to write a mobile app that as volunteers walk by the sensor would send data to their phone, which would then forward it to my backend. I suppose this is a mesh network of sorts? Not sure if this is feasible or a good idea though :/ [1] - https://youtu.be/IYuYTfO6iOs?si=oLuJiGxdQ8VHyu29&t=837 https://youtu.be/IYuYTfO6iOs?si=oLuJiGxdQ8VHyu29&t=837
- sodality2 3y agoAnother option would be LoRa - it’s pretty long range. The problem would be that could add a lot to power usage. Though 6h should be plenty of time - wake up, send a small packet, sleep for 6 hours. You would have a central LoRa receiver in a place that can reach all of the sensors. How far apart are the trees? Other than that, I would suggest testing out lots of different hardware. I bought several different boards before any decisions were made, and I’m glad I didn’t stick to just one. Costed me maybe $30 to buy a gamut of devices and now I’ve settled on a single one that does what I need. Also, make sure you’re flashing with the largest image size you can, if your code becomes too large. For me I had to enable an option in the board settings to use the full memory space. Lastly, one thing you should do is the low power option. See which board supports it the best. Then, what I would do at startup is turn on all the sensors, collect and send data right away, then turn all your sensors off. Do ultra deep sleep for 6 hours. then when it wakes up, don’t bother doing any kind of loop to the beginning - hard reboot. That avoids any problems with memory allocation becoming too large somehow over the course of the program, since it always starts fresh (which is all you need!). I’m not sure the trade off here but for me, I reboot every 12 hours and it works great. (I would do it after every scan but I don’t delay between scans for more constant data, so it would be a lot of set up every single minute).
- SCUSKU 3y agoThe trees are all pretty close to each other, about 3-4 city block radius (map of trees [1]). The issue is that as far as I can tell there is no existing LoraWAN gateway on The Things Network I can tap into [2], which means I will have to setup my own gateway. Which is fine, but it may prove to be difficult to get this onto a tall building since I am just an apartment dweller. At the very least I can put the gateway in my apartment window. [1] -- https://www.google.com/maps/d/u/0/viewer?mid=1e7K_VdEEYkxuAyGnPslgXgO-lVzAG5o&ll=37.79342060929441%2C-122.41617305&z=16 https://www.google.com/maps/d/u/0/viewer?mid=1e7K_VdEEYkxuAy... [2] -- https://www.thethingsnetwork.org/community/san-francisco/ https://www.thethingsnetwork.org/community/san-francisco/
- filterfiber 3y agoThere are esp-lora boards including lipo power management you can start with. The ESP has a few deep sleep modes, and there's a lot you can do to optimize them. I highly recommend Andreas Spiess on youtube. EDIT: Heads up that moisture sensors have reliability issues, Andreas's video 463 talks about them.
- SCUSKU 3y agoSo my thought was to utilize the capacitive soil moisture sensor and then coat the sides of the PCB with a waterproofing epoxy as Andreas recommended. My hope being that even if it craps out, I can just swap out the sensor, and since they are so cheap it won't be a big deal. Also, great to know that there esp-lora board w/ lipo power included!
- morphle 3y agoIf it is only 20 trees, you could use off the shelf sensors. Its much better and cheaper to design from scatch, use an $0.04 ultra-low power Arm microcontroller with ADC or a Padauk, add a single layer pcb with two well proportioned pcb traces in a plastic bag as a capacitive moisture censor (better than resistive sensor) and a $0.12 solar cell or rechargable battery. Single sensor cost around $0.41 excluding labor, mass produced $0.08 including labor and sensor network
- SCUSKU 3y agoThat's a great point. I have experience w/ Arduino and have made a carrier board one time [1], but am not familiar with full custom PCB + MCU designs. Do you have any suggestions on where to get started for someone with my medium level of experience here? And also, how difficult would you anticipate a custom MCU to be? [1] -- https://zachbellay.com/projects/odaf/#iteration-3-phase-2-wiring-the-electronics https://zachbellay.com/projects/odaf/#iteration-3-phase-2-wi...
- morphle 3y agoA custom MCU+pcb is at least 3 months work: downloading an design for an FPGA, testing it, using openlane to make an custom chip, taping it out, writting boot code and the main loop ( I would do that in assembly, much simpler than using C and some vendors library). The big issue is taping it out to a chip FAB, around $25K, see my comment below. I would get started with an off the shelf MCU with good documentation, writing the software on a good development platform with the same assembly as the final microcontroller. For the $0,04 ARM microcontroller I mentioned above as final target with analog to digital controller (ADC) I would first write the program (the main loop) on a Mac on a high level language like Squeak or Python and use the $4 raspberry pi pico as ADC. I would then rewrite the working software in ARM assembly and test it directly on the pi pico. Then I would flash it on the $0.04 arm microcontroller wired on a breadboard to the moisture sensor. Then I would debug it again, with simple flashing leds to see where your software goes wrong. morphle at ziggo dot nl for more questions like how to find a 4 cent arm chip. I would start at lcsc.com , use their sister company and eda tool to design the pcb only with lcsc.com parts and order it fully assembled. Then I would open source it so others can directly order assembled boards I would avoid Arduino like the plaque, in essence its just a precanned overpriced bloated C library on an overpriced microcontroller. You always get better results writing from scratch. See 'is it complex or did we make it complicated', a lecture by Alan Kay at Quallcom on Vimeo or Youtube, on designing systems from scratch or buy vendor stuff: https://vimeo.com/82301919 https://vimeo.com/82301919
- Kevin09210 3y agocheck this out https://dynamax.com/products https://dynamax.com/products
- antoniuschan99 3y agoEither a dfrobot: https://www.dfrobot.com/product-1385.html https://www.dfrobot.com/product-1385.html or M5Stack: https://shop.m5stack.com/products/earth-sensor-unit https://shop.m5stack.com/products/earth-sensor-unit https://shop.m5stack.com/products/watering-unit-with-mositure-sensor-and-pump https://shop.m5stack.com/products/watering-unit-with-mositur...
- chasd00 3y agolook at Adafruit's Feather line up. they have lipo support + charging and then an easy connector to use for i2c which you'll probably be using to interface to the sensor. You can probably find one with Lora included.
- Mumps 3y agoWould the Pimoroni Grow help you out? https://learn.pimoroni.com/article/plant-monitoring-with-enviro-grow https://learn.pimoroni.com/article/plant-monitoring-with-env... grab that, a pi pico, and some batteries (which should last months they claim), and set up an MQTT for data. It is pretty expensive at scale. But if you want "no fuss" I think it would do the trick for you.