I created this to do one thing: push a button. A very specific button. This might not work for your button pushing needs, but I decided to share it on the off-chance someone else has a similar need to push a button. It's like a switchbot, but for buttons.
Specifically, I wanted to be able to push the button from my home automation dashboard (home assistant). The bot uses an SG90 servo (to push the button) and a D1 mini running ESPHome (to tell it to push the button). I've provided an example ESPHome config you can use as a starting point, either for home assistant integration or you could enable the web server or REST API to use it standalone. Alternatively, the D1 Mini supports Arduino, MicroPython, NodeMCU, and others.
BOM:
1x D1 Mini (I used v3, but anything should be fine)
1x SG90 9g Servo
2x M2x5 screws (4mm - 6mm length is ok)
2x M4x8 screws (7mm - 13mm length is ok)
4x 6x2 magnets for lid
4x 6x3 magnets for body (6x2 should work ok here too, just don't press too deep)
USB power adapter/cable (recommend at least 500 mA)
2.54mm low profile board to wire connectors (optional)
Assembly:
I didn't opt to use any board connectors, and I didn't want to make the enclosure any taller. I figured I'll just pop it open and resolder if needed. If you want to use some, use something like JST XH. The Dupont connectors the servo comes with will too tight with headers on the D1.
Press servo horn into spur gear and screw onto servo (using screw that came with servo). Cut then solder wires from servo to D1 (5v, GND, and whatever pin you use for PWM - I chose D1), or solder/crimp board connectors if using them. Be sure to leave enough wire length to install everything. Flash D1 with firmware of choice, and move servo into your desired idle (button-not-pressed) position. You'll want to do this now since you can't adjust the horn/gear positions while it's installed. If you use my ESPHome config you'll notice it defaults to one extreme of the travel range to allow for maximum button pushing distance, and resets this position on boot.
Once that's done you can install the servo and pinion gear at the same time, sliding the servo into the slot in the enclosure. You'll want to line it up so the end of pinion gear (the end without teeth) is flush with the bottom of the enclosure with the servo installed. Once that's done, slide the bracket to secure the servo in above the servo and secure with the 2 M4 screws, then install the D1 Mini above that and secure with the M2 screws.
Install magnets into lid and enclosure. They should press fit, but you can use a bit of glue if they are loose.
Before installing over a button you'll probably want to do a test fit and figure out the travel distance for the servo. If using my example config with home assistant, you can use the "Servo Control" entity to adjust the position until you figure out the value you need. If you are using double sided tape or similar you may need to add a bit more travel to account for it flexing/lifting a bit.
The author marked this model as their own original creation.