I am mainly from software background with very very basic level of electronics/microcontroller knowledge.

I recently did a small IoT project for moisture/temp detection following this tutorial

At a very high level this uses Raspberry Pi4 and a capacitive moisture sensor (which is plugged into raspberry pi) to send the data via AWS IoT to my email.

I would like to upgrade to where I can have multiple stemma capacitive moisture sensors (1 for each of my indoor plants) without obviously buying many Raspberry Pis... I did some basic research and I believe I would need some sort of microcontroller with each moisture sensor for each plant that is battery operated and can send data either on WiFi/MQTT (something like this) or Bluetooth... then my Raspberry Pi can act as a server to each of these devices send data to AWS.

I kindly need guidance on what piece of cheap battery operated (ideally don't want to plug in)/WiFi or Bluetooth enabled hardware (microcontrollers?) is best for individually having many moisture sensors connected.

Also is my thinking correct?

  • your thinking is correct ... you could also use a timer to do the irrigation ... teach the system how often plants need to be watered and how much water is required for each plant
    – jsotola
    Commented Jun 29, 2020 at 1:30
  • At what frequency do you need updates? What battery lifetime can you live with? How many sensors? How far apart! Wi-Fi is easy but may eat your battery very quickly if you do frequent updates. Bluetooth may be much better in that respect, but you’ll need some other device to act as a gateway. Zigbee would be yet another option, but it’s even more difficult.
    – jcaron
    Commented Jul 1, 2020 at 18:17
  • How much are you willing to tinker? Commented Dec 22, 2020 at 12:38

2 Answers 2


You got the right idea, let's jump into your questions:

First of all, you need to think about the microcontroller itself. Since you said that you need wifi/bluetooth, I could recommend an ESP8266 (wifi only) or an ESP32 (wifi and bluetooth, also more expensive).

Now for the battery: there are some dev boards which already include all of the battery management stuff, like some LILYGO boards that can be easily found on AliExpress or the likes, with support for the commonly found 18650 cells. Another option would be to get a regular dev board with no battery slot, and add it yourself if you want something more involved.


Below is what I would do if I were you.

I would completely skip the Pi (unnecessary design complications and need for additional hardware + code) and ensure the nodes send data directly to the AWS over wifi(for indoors) using MQTT.

For ensuring a longer battery life, I would to the following:

  1. Ensure the nodes are in deep-sleep most of the times and wake up only when needed to send the sensor data and then go back to sleep. Something like below.

deep sleep-->timer elapse INT-->wakeup-->turn on radio-->connect to wifi-->connect to server-->read sensor data-->transmit data-->disconnect from server--> disconnect from wifi-->turn off radio-->reset timer/clear INT-->go back to deep sleep.

  1. Your battery life will also depend on the rate at which you transmit the data. I would generally do it once in a few hours in your case.

  2. To get a good estimate of how much power you node draws and how long it can last on battery. Measure the current drawn when a node is in deep sleep + measure the current drawn when full active and then do the math based on (2) and you can get a rough idea of how long the device could last on battery.

For suggestion for the micros, I would go with an AVR (something like the atmega1280 or 1281) and use an external module for wifi in case I decide to switch to a different one at some point in time, it would be easier.

  • thanks Vinay, which board to use for atmega1280...ardiono mega is expensive than ESP8266 (do you think ESP8266 can't do the node to aws job if we remove pi from the equation)... Commented Jul 3, 2020 at 8:00
  • ESP8266 should do the job too. But I'd prefer using the AVR with their Atmel Studio IDE and ASF for generating drivers etc. I have had a good experience with these in terms of reliability, documentation etc unlike the esp8266. atmega1280 is cheap as controller, think in terms of MCU not the whole board when it comes to cost. Commented Jul 6, 2020 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.