Battery powered Wandering hour clock

Arduino clock run on 18650 batteries.
14
36
0
1283
updated August 16, 2023

Description

PDF

I love the remix of the Arduino clock but am not a fan of the wires coming out of it, so I designed this battery powered clock. To save power, which is essential for batteries, this version utilizes ESP32 deep sleep mode & an external RTC module to keep the timer correct.

Hardware:

ScrewsQuantity
M4x48 countersink screw1
Plastic screw wall anchor1
M3x6 bolts11
Heat insert M3x4 (optional)11
Electronic partsQuantity
ESP321
ULN2003 motor driver1
28BYJ-48 Stepper Motor1
FQP30N06L mosfet1
DS3231 RTC module1
CR2032 battery (for DS3231)1
18650 Battery shield1
Good quality 18650 batteries (2000+ mAh)2 or 4 depend on battery shield
10k 1/4W resistor1
1k 1/4W resistor1
Perfboard1 5x6 holes minimum
Single row male headers1x20
Colored electrical wires  
Dupont 2.54 female connector 
Soldering tools 
Crimping tool 
Hot glue gun 

Battery shield: https://www.amazon.com/Diymore-Lithium-Battery-Charging-Arduino/dp/B07SZKNST4

Get a 4-batteries shield if you can. I recommend this diymore brand, it has a usb port for ESP32 & multiple 5v output for the motor, making the whole process easier.

3d print files & Arduino sketch: 

https://github.com/hviet17/battery-wandering-clock

  • 3D printed parts and additional hardware listed from Printables, except ClockMovementGear and Standoffs.
  • Standoffs from Printables
  • The rest from here
PartQuantity
ClockMovementGearStepper1
BatteryMount1
PCBMount1
WallMount1
WallBalancer1

Electronic explain:

  • Using battery to power the clock is easy, the hard part is making the battery last a long time before needing to recharge by saving as much power as possible. To do that, we will not using WIFI & utilize deep sleep mode when the clock not running and only wake up periodically (60 sec) to turn the stepper motor. The downside is of course you have to turn the motor by hand to set the time at the beginning.
  • DS3231 module: you can use GPIO pin to wake up the board periodically, but the onboard RTC (real time clock) is not very accurate in deep sleep, that's why we'll be using an external RTC module to do the timing.
  • FQP30N06L mosfet: the battery shield that I linked have a switch to change between always-on / saving power mode and a button press to turn on the psu. Saving power mode will auto turn off the power supply after idle time about 40s, which we cannot use as is because we want our clock to keep running after deep sleep. However, always-on mode will consume a constant 90mA to keep the psu on, which is quite bad if we want to save power. That's why we will make a simple circuit using this mosfet as a switch connected to the button to emulate a press every 30s to keep the power on in saving-power mode. With this approach the power consumption is much lower (~2mA). You can use any logic level N channel mosfet that can be turn on with 3.3v, this particular model is tested and can do the job.

Read more:

Instructions:

Assuming you already printed all the parts & finish assembly the clock from the original design. This part will focus on the wiring and soldering of the battery circuit. If you're not using the battery shield, you can skip Step 1 & 2.

  • Step 1: Modify battery shield



    - Solder 2 male headers on 1 of the 5v output.
    - Crimp 2 wires (15cm) for this output.
    - Solder 2 wires (10cm) onto button pins, those are 2 pins on the left & right that are closest to the button, pay attention to the polarity. Crimp the other ends with Dupont connector.
    - Dab some hot glue on the button solder joints.
    - Optional: you can desolder those battery status leds to save even more power, I chose to leave them on.
     
  • Step 2: Solder battery circuit



    Solder like this drawing below, after that carefully bend the mosfet 90 degree to save space.



    The other side:


     
  • Step 3: Prepare the mount



    - There're 2 versions, with & without heat insert. Put BatteryMount & PCBMount in the position like this picture, then dab some hot glue on 4 corners of each mount. 
    - WallBalancer is glue on the other side of those components to prevent the clock from wobbling when mounting on the wall.
    - WallMount has an extruded part that goes under the rim of the clock's back side to prevent it from falling off.


     
  • Step 4: Final assembly & wiring
    - Open your computer, flash the sketch to ESP32.
    - Screw PCBs and battery shield onto the mounts.
    - Plug ESP32 into battery shield using USB cable.
    - Put CR2032 battery into DS3231.
    - Remember all those male headers on Ground (yellow) from Step 2? Connect 1 pin to ESP32 GND. Every GND referred below is connected to remaining pins.

    Depend on the position of your mounts that you need to cut the wire length accordingly, use different colors for easier assembly. 
    Here's the wiring:
ULN2003 Motor DriverESP32Battery shield
IN1GPIO19 
IN2GPIO18 
IN3GPIO17 
IN4GPIO16 
+ 5v +
-GND5v -
DS3231ESP32
VCC3v3
GNDGND
SDAGPIO21 (SDA)
SCLGPIO22 (SCL)
SQWGPIO33
Battery circuit (refer to Step 2)ESP32Battery shield
Pin 4 Button +
Pin 5GNDButton -
Pin 3GPIO32 

- Manually turn the ClockMovementGearStepper to set to the current time. Put on the glass cover. 
- Put 18650 batteries into your battery shield, please note that polarity is extremely IMPORTANT! As far as I know these shields doesn't have reverse polarity protection so it will smoking & permanently damage the board if you put in the wrong battery polarity.
- Remember to switch battery shield to saving power mode. After that, press the button on battery shield once to turn on the clock. Double pressed if you want to turn it off.


That's it. Enjoy!

Model origin

The author remixed this model.

License