ESP 01 & IRFZ44N I am looking for battery suggestions

Hello team,

In my current project, I have an esp 01 that controls a mosfet IRFZ44N to turn on and off a tiny motor (which turns on for a second and then go back to off). Now, this project is working fine with two AA batteries (3v in total) but of course the batteries lasts about 12 hours. The esp01 is always in listening to see if Alexa or myself give it the command to turn on the tiny motor for a second.

I am looking to buy a battery that can last longer. What is your suggested solution?

Thanks in advance :slight_smile:

Consider using a sleep mode and having the Alexa signal being a wake up call for the esp 01, instead of always listening.

ESP8266 Core documentation [Welcome to ESP8266 Arduino Core’s documentation!](http://Welcome to ESP8266 Arduino Core’s documentation!)

Idahowalker:
Consider using a sleep mode and having the Alexa signal being a wake up call for the esp 01, instead of always listening.

Can you elaborate on that a little please? I'd like to know if that is possible. As far as I know, during sleep, the esp won't be connected to the network to receive a signal from Alexa.

I am looking to buy a battery that can last longer. What is your suggested solution?

Connect 2 more AA batteries. That should give around 24hrs. Sorry if you already thought of that, but you didn't give any idea how long you hope a different battery would last.

AA NiMh have a capacity around 2000mAh, Alkaline a little more, I suppose, but with only 2 of them, the voltage will drop too low to operate the esp before they are fully discharged. I hope you are not using disposable batteries if you are getting through them at a rate of 2 every 12 hours! Think of the planet! If using NiMh, I would consider using 3 to see how long they last.

Another option could be 18650 size Li-Ion batteries, but these require a special charger, and when fully charged, their voltage is 4.2V which is too high for the esp, so an LDO regulator would be needed (e.g. mcp1702). 18650 have capacities around 2500~3500mAh. Any Li-Ion advertising significantly more than that is highly suspect. My advice is stick to well-known brands like LG, Sony etc when buying them.

I have heard that LiFePo4 are useful with esp, because their highest voltage is lower than Li-Ion, so no regulator would be needed, but I have no experience with this type of battery.

an esp 01 that controls a mosfet IRFZ44N to turn on and off a tiny motor

That's not a great choice of transistor. Size-wise, it's overkill, but not being logic-level, not going to do a great job anyway, especially with max of 3.3V on it's gate.

What current does the motor draw, at maximum? To find this out, you will have to stall the motor for a few moments while you measure the current draw.

PaulRB:
Can you elaborate on that a little please? I'd like to know if that is possible. As far as I know, during sleep, the esp won't be connected to the network to receive a signal from Alexa.

My thinking goes along the lines of using a signal from the Alexa to wake the uController.

Idahowalker:
Consider using a sleep mode and having the Alexa signal being a wake up call for the esp 01, instead of always listening.

ESP8266 Core documentation [Welcome to ESP8266 Arduino Core’s documentation!](http://Welcome to ESP8266 Arduino Core’s documentation!)

Is this possible? Will it be still connected to the network?

PaulRB:
Can you elaborate on that a little please? I'd like to know if that is possible. As far as I know, during sleep, the esp won't be connected to the network to receive a signal from Alexa.
Connect 2 more AA batteries. That should give around 24hrs. Sorry if you already thought of that, but you didn't give any idea how long you hope a different battery would last.

AA NiMh have a capacity around 2000mAh, Alkaline a little more, I suppose, but with only 2 of them, the voltage will drop too low to operate the esp before they are fully discharged. I hope you are not using disposable batteries if you are getting through them at a rate of 2 every 12 hours! Think of the planet! If using NiMh, I would consider using 3 to see how long they last.

Another option could be 18650 size Li-Ion batteries, but these require a special charger, and when fully charged, their voltage is 4.2V which is too high for the esp, so an LDO regulator would be needed (e.g. mcp1702). 18650 have capacities around 2500~3500mAh. Any Li-Ion advertising significantly more than that is highly suspect. My advice is stick to well-known brands like LG, Sony etc when buying them.

I have heard that LiFePo4 are useful with esp, because their highest voltage is lower than Li-Ion, so no regulator would be needed, but I have no experience with this type of battery.

Yes at the moment I am using rechargeable AA batteries but charging them every 12 or 24 hours is what I would like to avoid.

The motor is a very small motor and when I say that it runs for a second I really mean that it runs for a second so I think that most of the power is used by the ESP 01 to stay online. What is the long lasting option here?

Idahowalker:
My thinking goes along the lines of using a signal from the Alexa to wake the uController.

If it helps, I am using fauxmo to control the ESP with Alexa

ESP32 API Sleep Modes - ESP32 - — ESP-IDF Programming Guide latest documentation

That is for esp32, and the OP is using an esp-01 (esp8266) but that also has light sleep mode. I never had much success with that, I found that light sleep mode only seemed to take effect during delay(). If I put delay(1000) in loop(), I could get the current down from the usual ~80mA down to less than half that, but the side effect was slow response to client requests, for the obvious reason. How have you used light sleep on esp8266?

What is the long lasting option here?

That was what I was trying to explain in post #2, which you quoted back in post #5. I suggested several battery types and options and gave example capacities. What more were you hoping for? Essentially, bigger battery capacity + lower current consumption = longer battery life. If your circuit consumes 80mA and you battery capacity is 800mAh, then that will last for around 10 hours. 8000mAh would last 100 hours. (BTW if you see 18650 batteries advertised with 8000mAh capacity, or anything like it, give them a wide berth. I learned that the hard way!)

PaulRB:
That is for esp32, and the OP is using an esp-01 (esp8266) but that also has light sleep mode. I never had much success with that, I found that light sleep mode only seemed to take effect during delay(). If I put delay(1000) in loop(), I could get the current down from the usual ~80mA down to less than half that, but the side effect was slow response to client requests, for the obvious reason. How have you used light sleep on esp8266?

No, I've not used a ESP8266, I just use ESP32's.

Idahowalker:
No, I've not used a ESP8266, I just use ESP32's.

Ok, so how did you use it with esp32? What was the current saving? Did you need to use delay()? Maybe the same or similar techniques work the same on esp8266.

Here is part of an application I am currently working on:

void fDoTheThing( void * pvParameters )
{
  while (1)
  {
    // log_i( "DoingTheThing" );
    xEventGroupSetBits( eg, evtTheThingsToDo ); // trigger tasks
    mqttClient.loop();
    xSemaphoreTake( sema_ReadBMP280, portMAX_DELAY ); // wait for task to be done
    xSemaphoreTake( sema_DoDayLight, portMAX_DELAY ); // wait for task to be done
    xSemaphoreTake( sema_ReadinputVoltage, portMAX_DELAY ); // wait for task to be done
    if ( FiveVoltsGood )
    {
      log_i( "entering light sleep" );
      vTaskDelay( 10 ); // used to allow log_i to print. not needed for regular operations
      mqttClient.disconnect();
      WiFi.disconnect(true);
      esp_sleep_enable_timer_wakeup( (60000000) ); // set timer to wake up every 60000000uS (1 minute)
      esp_light_sleep_start();
      connectToWiFi();
      connectToAWS();
      // vTaskDelay( 300 ); // for testing without sleep
    } else {
      // go to sleep LONGER when 5 volts is not good
      log_i( "entering deep sleep" );
      mqttClient.disconnect();
      WiFi.disconnect(true);
      WiFi.mode(WIFI_OFF);
      esp_sleep_enable_timer_wakeup( (60000000 * 6) ); // set timer to wake up every 60000000uS (1 minute) * 6
      esp_deep_sleep_start();
    }
    //
  } //while(1)
  vTaskDelete ( NULL );
} // void fDoTheThing( void * pvParameters )

Current savings, the unit has ran on a single 186650, 26000mAh, battery for 37 hours, before I allowed the solar cell to begin the recharge.

PaulRB:
That was what I was trying to explain in post #2, which you quoted back in post #5. I suggested several battery types and options and gave example capacities. What more were you hoping for? Essentially, bigger battery capacity + lower current consumption = longer battery life. If your circuit consumes 80mA and you battery capacity is 800mAh, then that will last for around 10 hours. 8000mAh would last 100 hours. (BTW if you see 18650 batteries advertised with 8000mAh capacity, or anything like it, give them a wide berth. I learned that the hard way!)

I thought there were specific batteries for ESP in terms of size and capacity but from what I am seeing it's not like this.

PaulRB:
BTW if you see 18650 batteries advertised with 8000mAh capacity, or anything like it, give them a wide berth. I learned that the hard way!

Do you mean that they are a fraud? I was actually looking for a battery that takes the same space of 2 AA batteries but that last longer. Ideally to be charged once a week

Idahowalker:
Here is part of an application I am currently working on:

void fDoTheThing( void * pvParameters )

{
 while (1)
 {
   // log_i( "DoingTheThing" );
   xEventGroupSetBits( eg, evtTheThingsToDo ); // trigger tasks
   mqttClient.loop();
   xSemaphoreTake( sema_ReadBMP280, portMAX_DELAY ); // wait for task to be done
   xSemaphoreTake( sema_DoDayLight, portMAX_DELAY ); // wait for task to be done
   xSemaphoreTake( sema_ReadinputVoltage, portMAX_DELAY ); // wait for task to be done
   if ( FiveVoltsGood )
   {
     log_i( "entering light sleep" );
     vTaskDelay( 10 ); // used to allow log_i to print. not needed for regular operations
     mqttClient.disconnect();
     WiFi.disconnect(true);
     esp_sleep_enable_timer_wakeup( (60000000) ); // set timer to wake up every 60000000uS (1 minute)
     esp_light_sleep_start();
     connectToWiFi();
     connectToAWS();
     // vTaskDelay( 300 ); // for testing without sleep
   } else {
     // go to sleep LONGER when 5 volts is not good
     log_i( "entering deep sleep" );
     mqttClient.disconnect();
     WiFi.disconnect(true);
     WiFi.mode(WIFI_OFF);
     esp_sleep_enable_timer_wakeup( (60000000 * 6) ); // set timer to wake up every 60000000uS (1 minute) * 6
     esp_deep_sleep_start();
   }
   //
 } //while(1)
 vTaskDelete ( NULL );
} // void fDoTheThing( void * pvParameters )

Too complicated for me ???

adelast:
Do you mean that they are a fraud? I was actually looking for a battery that takes the same space of 2 AA batteries but that last longer. Ideally to be charged once a week

Yes, fraud.

A battery that takes the same space of 2 AA batteries but lasts a week instead of 12 hours, would have 14 times the energy density of NiMH, which would be a wonderful thing, but I don't think we have the technology yet, at least affordable technology, outside of a lab.