MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Integrating Stepper Motors with MagicMirror for a Dynamic Smart Mirror

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 45 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      carl22
      last edited by

      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!

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @carl22
        last edited by sdetweil

        @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-PythonPrint

        See the doc here

        https://docs.magicmirror.builders/module-development/core-module-file.html

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy