0

I am not sure if this is the correct forum since I tend to use the ESP8266 standalone and not together with the arduino nano. However, here is what I am planning.

I have a HC-SR501 PIR sensor, which I want to use to constantly track movements of animals outdoor. I dont want to go into further details, but 10 impulses per minute are expected (max. is 30/min) except for the night maybe. I am planning to count the impulses for one hour, than send the sum to a webserver using wifi and reset the counter. For powering I want a battery/akku solution (non-negotiable). Since the input of the PIR sensor is 4.8-20V I will directly connect it to the battery (provided the Voltage is high enough like with a 9V battery) and the ESP8266, which is used as WIFI station will be connected via an AMS1117 generating 3.3V.

WIFI Router which is connected to the internet is available and several sensor systems will be used to check several areas. Basic knowledge of using AT cmds or programming with Arduino IDE is given.

Questions:

  1. Can the ESP8266 module count impulses during one of the sleep modes?
  2. Do you have a less current consumpting module in mind allowing wifi transmittance? (LoRa or the NRF Module are not an option atm, since the router has to be used)
  3. What kind of battery/akku would you suggest? Having sufficient voltage and capacity (mAh) and still being easy to handle?

Optimum lifetime for the beginning would be 1 month for the first prototype. Afterwards a SolarModule + Akku solution will be implemented, but the first prototype has to be finished simple and fast yet satisfying :)

kind regards

2

This are multiple questions in one. But I will do my best to tackle them one by one.

  1. Can the ESP8266 module count impulses during one of the sleep modes?

The ESP8266 has different power modes. Short answer: As long as the CPU is running, yes.

Long answer: The ESP8266 has quite a few power modes. They are easily put:

  • No-sleep (as high as 170 mA while communicating)
  • Modem-sleep (15 mA Wifi is off, everything else is running)
  • Light-sleep (0.9 mA CPU is put to sleep and system clock stopped, can be waken up by a external interrupted)
  • Deep-sleep (20 uA Everything is off, basically it's powered down, but can wake itself on set intervals or reset it to wake it. everything in RAM is lost, except RTC RAM)

So if your sensor gives a pulse, you can use that as a interrupt and go to light-sleep. If you need to pull it, all you can do is modem-sleep.

ESP8266 power modes

  1. Do you have a less current consumpting module in mind allowing wifi transmittance? (LoRa or the NRF Module are not an option atm, since the router has to be used)

Modem-sleep is your friend. Only connect to the router if there is data to send.

You can set up an AVR and use it in ultra low power mode and only turn on the esp if there is data to send. But explaining how to set that up goes way too far out of this scope.

  1. What kind of battery/akku would you suggest? Having sufficient voltage and capacity (mAh) and still being easy to handle?

I can't choose a battery for you, there are just too many of them. But what I can do is tell you about how batteries work.

Take for example a 9 volt battery (not my first choice, you will see in a bit).

We take an energizer 522. It's a Alkaline battery and has 600 mAh. That means it can deliver 600 mA in one hour. But there is a catch. the more you draw from a Alkaline battery, the less capacity it will have.

It is 9 volts right? yes and no. you see. the voltage potential will drop (quite dramatically) over its lifetime.

A liniar voltage regulator (AMS1117) will take the needed mA of the output on the input and drop off the extra power as heat. So the battery will always have the same load (Yes, the esp8266 is a dynamic load, but lets keep it simple)

so lets say it's in modem-sleep (15mA). Lets divide 600 by 15, that is 40 hours of runtime. For simplicity I don't count the sensor itself.

9 volt block datasheet

The AMS1117 needs 1.5 volts more then its output voltage for ensuring a stable output. So that is 4.8 volts or higher. But no higher than 12 volts.

AMS1117 datasheet

Choose a battery that has enough mAh and isn't more then 12 volts and not lower than 5 when depleted. If using outside, check if its operating temp range is wide enough.

So basically try to lower your energy footprint as far as it can possibly go and then based on the new average power usage, find a battery that is big enough for the task.

Better yet, get a solar cell and a rechargeable battery. It has a full list of other problems, but this answer is a bit too long already and that topic is out of the current scope.

  • Thank you for this elaborate answer. I was diving deep into the battery topic and I agree with your last statement using solar power. This is a good tutorial [link]youtube.com/watch?v=SPpgMl_TeIc. The only thing I will add is the AMS1117 to get back to 3.3V after boosting to 5V (not nice but 4.8V is min for AMS). Regarding the sleep mode, what about sending the ESP to soft-sleep letting it being waken up every time I receive an impuls, incrementing that to the counter and saving the new value by overwriting the old one in a non-volatile memory space and going back to sleep? – Slev1n May 9 '18 at 10:16
  • @Slev1n Yes, you could go into deep sleep and store it in RTC ram (NV-RAM). That will conserve it. But you will reset the chip, when you wake it. so you need a system that keeps track of what it is suppose to do. Or it will always do the same. It will better work to make a program that will send a package to the router then go back into deep sleep. The downside is that the ESP takes time to wake from deep-sleep. Light-sleep is much better for this workload. Again, this comment is getting too long, here is some info on how to implement it (youtube.com/watch?v=6SdyImetbp8) – H Ruiten May 9 '18 at 15:16
  • Thank you for the link. For now I will try the solar panel approach as a prototyp but I learned a lot. Later I will switch to a complete low power Module from TI ti.com/tool/TIDA-00489 i just found. – Slev1n May 10 '18 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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