Read the statement by Michael Teeuw here.
Integrating Stepper Motors with MagicMirror for a Dynamic Smart Mirror
-
Hey everyone!
I’m currently working on a fun project combining MagicMirror² and stepper motors. The idea is to build a smart mirror with physical movement — think rotating displays, hidden compartments, or even a mirror that tilts to greet you!
I’m using a Raspberry Pi 4 running MagicMirror² as the base. The stepper motor (28BYJ-48 + ULN2003 driver) is controlled via Python using the RPi.GPIO library. I’ve written a simple script that listens for certain triggers (like time of day or gesture input via a PIR sensor), and then moves the motor accordingly.
Next step: I want to connect the motor control to a MagicMirror module, so it can react to weather changes, calendar events, or face detection.
Has anyone here tried combining physical components (motors, servos, etc.) with MM modules? Would love to hear your experience or ideas!
-
@carl22 I have not seen any physical connection, but what you seek should be relatively easy
The calendar and weather and clock modules broadcast their data to allow other modules to consume them
So your module receives these events (at the notificationReceived function) and needs to tell the motors to move
Your web side sends a message to the server side, using the sendSocketNotification function
And the server side (node_helper.js socketNotificationReceived) ). Launches your python script to do that
My PythonPrint launches a python script on some cycle and sends the scripts output back to the browser side
https://github.com/sdetweil/MMM-PythonPrintSee the doc here
https://docs.magicmirror.builders/module-development/core-module-file.html
