Automated Advent Calendar

Automated Advent Calendar

Project Concept and Overview
A wooden box has 24 doors that open and close automatically by servo. Additionally each box is individually lighted and controlled by WS2811. Each door represents days 1 - 24 of December as a countdown to Christmas. A small treat or chocolate can be placed in each door. It is also envision that a translucent Christmas image will be adhered to the front of the box with little cuts allowing each door to open. This will not allow the stencil box/day number to be seen unless it is illuminated.

The calendar will have only 2 buttons, 1 in the front and one in the back. The front button is used to open the current day door, the back button is used for system setup. The system is always in sleep mode until either button wakes up the system.

The door button will follow the logic below when pressed:

  1. If current month is not December, flash all doors 3 times quickly and go to sleep.
  2. If current month is December and current day has already been open, flash current day 3 times quickly, open door for 2 seconds, close, go to sleep.
    3.If current month is December, current day has not been opened then - light all doors and randomly turn off lights until only current door is lit. Door automatically opens for 5 seconds to retrieve “gift” and then shuts and everything goes to sleep.

The system setup button at the back starts an independent webserver that can interface through a webrowser to do the following:
• Observe the current system time
• Update/change the current time
• Reset whether doors have been opened
• Open all doors simultaneously (for restocking)

Materials List
1 ESP32 Development Board
24 SG90 Servos
48 Mini Cabinet Screws
24 WS2811 Individually Addressable lights
1 18650 Battery Shield
2 18650 Batteries
2 LED Push Buttons
2 16 Channel PWM Driver Boards
1 Mofset to cut power to servos when in sleep mode
M2 Wood Screws As needed for screwing together wood
Approximately 5 sq. ft ¼” sanded plywood
<0.5 sq. ft. 1/16” sanded plywood
Connectors and wires as needed

Planned Phases

Phase 1
Planning, Design, Initial Code Writing

Phase 2
Small Prototype – Laser Cut 2 box X 2 box mini sample to check dimensions, hinge connections, and breadboard wiring

Phase 3
Large Prototype – Laser Cut 4 box X 6 box. Hardwire and solder all connections. Final software testing.

Phase 4
Testing. Try it out for them month of December and see how it works.

Future(optional)
• Design a large PCB to simplify wiring
• See what costs can be cut. With some creative thinking I would like to get material costs < $50 CDN to be accessible to other hackers
• Incorporate a RTC module. The ESP32 time keeping has some drift would help keep time while not in use.

Current Status
I’m currently almost complete Phase 1. I have all the materials ordered and they have either arrived or will be arriving shortly.

I’m currently stuck on the laser cutting. I’ve included the .dxf file required for sending to the laser cutter. I sent the project to some local laser shops and they quoted me $150. I couldn’t part with that much money for this prototype when I know laser cutting is so cheap. I’m currently on the list to get laser training but I’m not trained yet. I posted in the newcomer channel that if another member who has training was willing, I’d be happy to pay or make a donation to cut this small prototype. Slack me if you are interested.

As for the current drawing I just started to poke around in Fusion 360. I’ve taken my first attempt at a 3D drawing of the small prototype and I’ve included this file as well as the .dxf of the sketch.

Advent_Calendar_Small_Proto.dxf
Advent_Calendar_Small_Proto.f3d

5 Likes

Looks like an awesome project! I’ll cut this for you, I’ve got a bunch of 1/4 baltic ply we can use. If you could donate $20 to the space I’d be happy with that. I’ll message you on slack to coordinate a time.

I’m hoping to being able to resume hosting laser trainings soon, I normally run at least one per month. I’m going to work with some other members drafting our guidelines to allow more engagement for new members and laser training is a big part of that.

Look forward to meeting you!

4 Likes

BUILD UPDATE


Accomplished Tasks:

  • 2X2 prototype was cut (thanks @TristanL for your help) and assembled
  • bread board circuitry was assembled and worked as expected for a 2X2 prototype including web interface for date setting and reloading
  • all hardware and electronics acquired
  • final version of 4X6 has been drawn

Key Learnings:

  • Lots of dimensions need a little tweaking (front doors aren’t flush, control rods rub, LED lights interfere with servos). You can see in the photo I had to shave some of the front edges to prevent interference with the hinges. I have fixed the design for the full size version.
  • 1/4" plywood can vary between 5.4mm and 6.5mm depending on the type of plywood. This left the design a little looser in a few areas than would have been desired. I made sure my new sheet of plywood is 6mm thick.
  • The RTC drift of the ESP32 during deep sleep was a little bit more than what I wanted. I decided to add an RTC through I2C for more accurate time keeping. ESP32 RTC drift can be up to 10 minutes per day. DS1307 is about 5 minutes drift a month.
  • I didn’t like the look of the exposed servos in the back so the next version has them fully enclosed
  • Order of assembly is very important. Had to undo and redo a several components on the prototype.

Next Steps

  • Cut and build full size version
  • electronics assembly
  • work out any last bugs in software
  • find a translucent front cover that can be pasted onto the front face.

I’ll again put a call out for help if anyone can help me with the laser cutting. I still haven’t had the training for the laser cutter so I can’t do this on my own. I made a donation to VHS for the help Tristan gave me last time. I’m happy to do this again. I have all the materials on hand and I would be glad to be there to learn and observe how to use the laser.

So far I’m happy with how this has been turning out, and it should be done with plenty of time for Dec 1st which is the real due date.

6 Likes

Nice! There are a couple other advent calenders posted on here from years past if anyone is looking to make one.

1 Like

Update: Completed



WebBased Control - Screenshot:
(this is accessed by pressing the button on the back)

Operations (front button):
Case 1 - Month is not December - Lights flash three times and calendar goes to sleep.
Case 2 - Month is December and current day door unopened (see video below) - All leds turn on and then randomly turn off until current day is left. Door opens for 5 seconds to get treat, closes, goes to sleep.
Case 3 - Month is December and current day already opened - current day lights up and opens for 2 seconds, calendar goes to sleep.

Demonstration Video

Issues Encountered:

  1. I underestimated how much power 24 servos would simultaneously draw. I had a 3.5A Li-On power supply that blew a component and wouldn’t supply power any more. I was never trying to operate all servos at once but there are peak times when a board starts up that all servos are activated. I had to switch to some AA packs because that’s what I had on hand.
  2. The servos and door aren’t that precise. I ended up having to modify the program so each door had custom close and open angles so that doors behaved as expected. Close angles range from 55 - 75 degrees, open angles from 135 - 175 degrees.
  3. I would make the through holes for the servo arms a little bigger to allow the doors opened just a little bit more.
  4. Similar to the blown power supply, I decided to separate the power for the main boards and the servo and light supply. This provided better power consistency to the ESP32 and less brown outs.

So everything is working and good to go for December 1st. I’ll put a brake on this for now but there are some future improvements that I would like to do:

  1. I’d like to go back and find a different rechargeable power supply and install it. Currently the USB charging port on the back is just a filler and not connected to the battery.
  2. It would be good to do some analysis of current draw during deep sleep and see if there is any unexpected current leakage that if fixed would extend battery life.
  3. I would like to put some diffusers on the lights so there is a bit more uniform glow from each box.
  4. There is a lot more fun to be had playing with different light effects. It is hard to see in the video, but December 18th is actually purple instead of a white light. This is because December 18th is my daughter’s birthday and she wanted a purple light. More fun programming to be done.
  5. I’m generally unhappy with the wire management at the bottom. I’d like to clean this up and improve it.

Overall I’d say this project has turned out well and we are looking forward to using it this December to count down to Christmas. Way more time invested in this than originally expected but I think this is the just the life of making. Happy to chat if you are interested in any parts of this project and want to learn more.

8 Likes

Wow congrats Brian that turned out way cool.

This is SUPER cool Brian!