unsure about which way to go with rechargeable battery or more efficent arduino

i have a 28byj-48 stepper motor and an arduino uno running off of 6xAA batteries pretending to lift a chicken door twice a day

it's all working nicely and i've done the code to reduce power consumption with the microprocessor sleeping and the stepper motor turns off when not being used but still holds the door. but my voltmeter fuse is damaged so i am unsure how much power it is still using. with those led's on the uno still lit i am doubting the batteries would last that long although it has been 3 days so far.

my question is i think the uno probably is not going to cut it in terms of battery efficiency so should i go with a solar panel and rechargeable battery or should i go for an arduino mini pro without leds and keep the 6xAA batteries.

im more inclined to think the rechargeable battery and solar panel is the way to go to take into account the stepper motor using power too but i am unsure. if the rechargeable battery is the best option does anyone have any suggestions on kind should i be looking at too.

thanks

jumpingjimmy:
or should i go for an arduino mini pro without leds and keep the 6xAA batteries.

The 6xAAs will need replacement eventually, so you might as well give that some thought now. A pair of 18650s would be worth considering, along with a decent 5v regulator. The latter would apply irrespective of whether you keep the Uno or use a Pro Mini.

Stepper motors consume current all the time, stepping or standing still. If You drop the power to the steppers they give no holding torque. Are You aware of that?

i used a sealed lead acid battery in a project awhile back and it worked well. check out this stye of battery:

they come in several sizes. they are going to last far longer than your AA's and they are rechargable.

jumpingjimmy:
i have a 28byj-48 stepper motor and an arduino uno running off of 6xAA batteries pretending to lift a chicken door twice a day

6 x 1.5 V batteries is 9 V, the wrong voltage to power an Arduino. What are you using to convert the 9 V to the 5 V working voltage of the Arduino? Please don't tell me you are using the "Vin" or "barrel jack" connections - that might make me (virtually: "internet") cry!

jumpingjimmy:
it's all working nicely and I've done the code to reduce power consumption with the microprocessor sleeping and the stepper motor turns off when not being used but still holds the door.

You said an Arduino UNO. You can sleep the microprocessor but you are still powering the USB chip. That isn't going to save much. How does the stepper motor turn off? Does the stepper motor run on the 9 V? How?

Fix your voltmeter for a start!

You want a "gearmotor", not a stepper.

Nick_Pyner:
The 6xAAs will need replacement eventually, so you might as well give that some thought now. A pair of 18650s would be worth considering, along with a decent 5v regulator. The latter would apply irrespective of whether you keep the Uno or use a Pro Mini.

i like the idea of the 18650s because they're small enough to pop in a box together with the arduino just above the door hole, i wasn't sure if them or the lead battery was the better way to go if i go down the route but after looking at the price i might go the lead one. is the 5v regulator to protect the uno because i don't really know what im doing regarding that. from what i read it appears i'd have to buy a 'solar module' which the solar and battery connect to and the solar module connects to the uno, i assume it would have the 5V regulator on it to protect the uno?

Railroader:
Stepper motors consume current all the time, stepping or standing still. If You drop the power to the steppers they give no holding torque. Are You aware of that?

i only found out after i bought all the parts but luckily for some reason the door doesn't seem to move it when it is off maybe it is just light enough. also if i get a rechargeable battery + solar and no one has replied to say getting a more efficient arduino is better so that might be the best then i might be able to switch the motor back on i was thinking and it probably wouldn't matter so much because the battery is big and rechargeable.

taterking:
i used a sealed lead acid battery in a project awhile back and it worked well. check out this stye of battery:

https://www.ebay.com/c/584237053?iid=323901865011

they come in several sizes. they are going to last far longer than your AA's and they are rechargable.

probably the best thing about it is it's cheaper than the 18650s, did you need to add anything else to it to protect the arduino im not sure if a "solar module" is an unnecessary thing to buy or if i can just plug the battery straight into the arduino

Paul__B:
You want a "gearmotor", not a stepper.

The 28byj-48 stepper motor that the OP is using is a geared stepper motor. They can hold quite a bit of torque without power applied.

Regarding the current need for steppers... Setting the Enable incative for the stepper driver will cut off the current consumtion of the stepper motors. If a holding torque is not needed it will work. In the aspect of power supply the steppers are rather thursty when they are active. They roughtly need like an Ampere at the least.

My 1.9829 cents says to do both.

Here is a link to an example of using solar to power an ESP32.

The same can be applied to a pro-mini.

A plug:

The ESP32 has 3 cores.

The ULP core is a Ultra Low Power core. The ESP32 can be shut to a sate of drawing as low as 25uA. The ULP can be programed, using macro assembler, to run periodically to check on a defined state or do a thing, or both check on state and do a thing. A do a thing could be awaking the rest of the system when their is a defined state. The ULP can be programmed with the Arduino IDE.

Here is how a ULP core program works written in the Arduino IDE:

void ULP_BLINK_RUN(uint32_t us)
{
  int memPortState = 8000; // memory address outside of program space to use
  int memCounts = 8001; // memory address to hold a count
  size_t load_addr = 0;
  RTC_SLOW_MEM[memPortState] = 0;
  // RTC_SLOW_MEM[memCounts] = 0;
  ulp_set_wakeup_period(0, us);
  const ulp_insn_t  ulp_blink[] =
  {
    // I_MOVI( R2, memCounts ), // get info from memCounts address
    // I_LD( R1, R2, 0 ),       // put contents of memCounts into R1
    // I_ADDI( R1, R1, 1 ),     // Add 1 to R1 holding result into R1
    // I_ST( R1, R2, 0 ),       // Put R1 into mem address pointed to by R2
    I_MOVI(R3, memPortState),               // memPortState -> R3
    I_LD(R0, R3, 0),                        // R0 = RTC_SLOW_MEM[R3(memPortState)]
    M_BL(1, 1),                             // GOTO M_LABEL(1) IF R0 < 1
    I_WR_REG(RTC_GPIO_OUT_REG, 26, 27, 1),  // RTC_GPIO2 = 1
    I_SUBI(R0, R0, 1),                      // R0 = R0 - 1, R0 = 1, R0 = 0
    I_ST(R0, R3, 0),                        // RTC_SLOW_MEM[R3(memPortState)] = R0
    M_BX(2),                                // GOTO M_LABEL(2)
    M_LABEL(1),                             // M_LABEL(1)
    I_WR_REG(RTC_GPIO_OUT_REG, 26, 27, 0),  // RTC_GPIO2 = 0
    I_ADDI(R0, R0, 1),                      // R0 = R0 + 1, R0 = 0, R0 = 1
    I_ST(R0, R3, 0),                        // RTC_SLOW_MEM[R3(memPortState)] = R0
    M_LABEL(2),                             // M_LABEL(2)
    I_HALT()                                // HALT COPROCESSOR
  };
  rtc_gpio_init( GPIO_NUM_2 ); // GPIO2 built in led
  rtc_gpio_set_direction( GPIO_NUM_2, RTC_GPIO_MODE_INPUT_OUTPUT );
  rtc_gpio_set_level( GPIO_NUM_2, 0);
  size_t size = sizeof(ulp_blink) / sizeof(ulp_insn_t);
  ulp_process_macros_and_load( load_addr, ulp_blink, &size);
  ulp_run( load_addr );
} // void ULP_BLINK_RUN(uint32_t us)

Paul__B:
6 x 1.5 V batteries is 9 V, the wrong voltage to power an Arduino. What are you using to convert the 9 V to the 5 V working voltage of the Arduino? Please don't tell me you are using the "Vin" or "barrel jack" connections - that might make me (virtually: "internet") cry!

yes barrel jack correct, i'm clueless about these things so i stole the idea from this guy if you're interested. his video made him look like he knew what he was talking about but he maybe left out the power considerations

Paul__B:
You said an Arduino UNO. You can sleep the microprocessor but you are still powering the USB chip. That isn't going to save much. How does the stepper motor turn off? Does the stepper motor run on the 9 V? How?

Fix your voltmeter for a start!

You want a "gearmotor", not a stepper.

don't say that i've written the code (starting from a base of knowing no code at all) and everything it is quite close to finished just need to sort the power.

the stepper motor turns off by me turning all the pins 8-11 on low in the code after it has wound the door up or down, the lights go off on the driver and the stepper stops being warm so i figured it is off. i don't get why you wouldn't think it would work the 28byj-48 stepper motor is 5V so why wouldn't it run off 9 but weirdly i accidentally bought the 12V version and it still works too so hopefully that continues to happen

is this what you mean by gear motor, from what i remember gearmotors need switches which i have no clue about. i also already bought all the parts for it and did the code which took me literally a week so i'd like to give it a go at least, but i will probably want to refine this system with a nano or mini pro in future and use the better motor if there is one. i also figured that if using 6AA's is not a going to work with a motor in any way then getting a big battery with a solar panel now is no loss cause i can use it with whatever improvements i make.

What is turned off regarding pins 8 - 11? I don't see that in the code.

Idahowalker:
My 1.9829 cents says to do both.

Here is a link to an example of using solar to power an ESP32.

The same can be applied to a pro-mini.

A plug:

The ESP32 has 3 cores.

The ULP core is a Ultra Low Power core. The ESP32 can be shut to a sate of drawing as low as 25uA. The ULP can be programed, using macro assembler, to run periodically to check on a defined state or do a thing, or both check on state and do a thing. A do a thing could be awaking the rest of the system when their is a defined state. The ULP can be programmed with the Arduino IDE.

Here is how a ULP core program works written in the Arduino IDE:

void ULP_BLINK_RUN(uint32_t us)

{
 int memPortState = 8000; // memory address outside of program space to use
 int memCounts = 8001; // memory address to hold a count
 size_t load_addr = 0;
 RTC_SLOW_MEM[memPortState] = 0;
 // RTC_SLOW_MEM[memCounts] = 0;
 ulp_set_wakeup_period(0, us);
 const ulp_insn_t  ulp_blink[] =
 {
   // I_MOVI( R2, memCounts ), // get info from memCounts address
   // I_LD( R1, R2, 0 ),       // put contents of memCounts into R1
   // I_ADDI( R1, R1, 1 ),     // Add 1 to R1 holding result into R1
   // I_ST( R1, R2, 0 ),       // Put R1 into mem address pointed to by R2
   I_MOVI(R3, memPortState),               // memPortState -> R3
   I_LD(R0, R3, 0),                        // R0 = RTC_SLOW_MEM[R3(memPortState)]
   M_BL(1, 1),                             // GOTO M_LABEL(1) IF R0 < 1
   I_WR_REG(RTC_GPIO_OUT_REG, 26, 27, 1),  // RTC_GPIO2 = 1
   I_SUBI(R0, R0, 1),                      // R0 = R0 - 1, R0 = 1, R0 = 0
   I_ST(R0, R3, 0),                        // RTC_SLOW_MEM[R3(memPortState)] = R0
   M_BX(2),                                // GOTO M_LABEL(2)
   M_LABEL(1),                             // M_LABEL(1)
   I_WR_REG(RTC_GPIO_OUT_REG, 26, 27, 0),  // RTC_GPIO2 = 0
   I_ADDI(R0, R0, 1),                      // R0 = R0 + 1, R0 = 0, R0 = 1
   I_ST(R0, R3, 0),                        // RTC_SLOW_MEM[R3(memPortState)] = R0
   M_LABEL(2),                             // M_LABEL(2)
   I_HALT()                                // HALT COPROCESSOR
 };
 rtc_gpio_init( GPIO_NUM_2 ); // GPIO2 built in led
 rtc_gpio_set_direction( GPIO_NUM_2, RTC_GPIO_MODE_INPUT_OUTPUT );
 rtc_gpio_set_level( GPIO_NUM_2, 0);
 size_t size = sizeof(ulp_blink) / sizeof(ulp_insn_t);
 ulp_process_macros_and_load( load_addr, ulp_blink, &size);
 ulp_run( load_addr );
} // void ULP_BLINK_RUN(uint32_t us)

i think you forgot the link possibly which i am interested in because im not totally sure how to setup the solar. the rest is a little beyond me at this stage but i will keep it for when i make improvements if i get this up and going first so thanks.

Railroader:
What is turned off regarding pins 8 - 11? I don't see that in the code.

the stepper motor was connected to these so i put output low for them and it worked in terms of it seeming to be off, i could show you what i did if you are interested but it might be messy to read because i stole bits from everywhere

I repeat my question, please answer it. What is the function of those pins, 8 - 11? I'm interested in the enable pin being put to disable. Putting Dir and Step in any state makes no power save.

jumpingjimmy:
i like the idea of the 18650s because they're small enough to pop in a box together with the arduino just above the door hole, i wasn't sure if them or the lead battery was the better way to go if i go down the route but after looking at the price i might go the lead one. is the 5v regulator to protect the uno because i don't really know what im doing regarding that. from what i read it appears i'd have to buy a 'solar module' which the solar and battery connect to and the solar module connects to the uno, i assume it would have the 5V regulator on it to protect the uno?

Using a decent 5v regulated supply enables you to bypass the crude on-board regulators. Putting your finger on them when in use will tell you all you need to know about them. They are OK with a typical 9v wall wart but are a liability when using a battery. I don't see why you have to buy a "solar module" but it sounds like a good idea. You just need to ensure it has a proper regulated 5v output of sufficient power.

jumpingjimmy:
yes barrel jack correct, ithis guy[/url] if you're interested. his video made him look like he knew what he was talking

I submit that guy hasn't the faintest idea of what he is talking about. You using 6xAA isn't that bright, but it's a lot brighter than him, and he claims to be an engineer. He links to a 4xAA holder.

if you used a 6 volt sealed lead acid battery you would pry want to get yourself a small drop down converter. you can find small ones for your board as cheap as a dollar!

then send 5 volts to your 5 volt pin. and you are good to go.

if you allready have a solar panel you should be able to charge this sort of battery by sending it a little over 6 volts through a reverse blocking diode.