
Open media
While HomeGenie excels at smart home automation, its flexible architecture extends powerfully into the realm of robotics and mechatronics. Controlling physical movement with precision is key to these applications, from simple automated tasks to complex robotic systems. HomeGenie Mini, equipped with the appropriate firmware, provides an accessible platform for controlling servo and stepper motors – the building blocks of robotic motion. This capability opens up possibilities ranging from hobbyist projects and interactive toys to more sophisticated applications in automation and prototyping.
smart-motor
firmware for HomeGenie MiniAt the heart of controlling motors with HomeGenie Mini is the versatile smart-motor
firmware. Designed primarily for ESP8266/ESP32-based devices, this firmware is specifically engineered to interface with and manage:
When flashed with the smart-motor
firmware, your HomeGenie Mini device becomes a dedicated motor controller, exposing standard interfaces accessible through the HomeGenie ecosystem.
Control.Level
API command accepts a normalized position value (from 0.00 to 1.00), representing the position within the configured range. This simplifies automation logic, allowing complex movements to be implemented using mathematical transformations, event triggers, or sequences.For the robotic arm animations shown in the videos on this page, no code was written. Instead, the Visual Program Editor in HomeGenie Server was used.
Common applications of the smart-motor
firmware include:
Like other HomeGenie Mini devices, getting started with the smart-motor
firmware is straightforward. This guide focuses on a practical example: building a small, 3D-printed robotic arm equipped with four common MG90S servo motors (180-degree rotation) and controlled by an ESP32 running the smart-motor
firmware.
First, flash the firmware using the Firmware Upload form found on this page. Select the smart-motor
profile suitable for your ESP32 board and configure it to use 4 servo motors, assigning the correct GPIO pins for each servo's signal line.
(Tip): It is highly recommended to perform the initial Wi-Fi connection and servo calibration before fully assembling the Robot Arm. After flashing, connect the ESP32 to your servos (see the Connecting the servo motors section below for wiring details) and power it up. Use HomeGenie Panel or HomeGenie Server to connect the device to Wi-Fi and then command each servo to its center position (50% or 0.5 level). This pre-centering makes the subsequent mechanical assembly much easier and ensures correct alignment.
Next, 3D print the mechanical components. You'll need a 3D printer and suitable filament (PLA or PETG are good choices).
Download the 3MF files for the robotic arm components from the Project Files section below.
All parts are designed to fit on a small build plate (e.g., Bambu Lab A1-mini). Printing typically takes around 2 hours 45 minutes with a 0.4mm nozzle and 0.20mm layer height. Ensure your printer is well-calibrated for dimensional accuracy.
Once the parts are printed and the servos are pre-centered (see Calibration step above), you can assemble the arm.
1. Gather Hardware:
Besides the printed parts, you'll need:
2. Assembly Process:
The following sections detail the assembly of the main sub-components. Refer to the images for visual guidance.
The process involves preparing the finger components with screws, inserting the gears and levers, closing the finger assemblies, mounting them onto the gripper base while aligning gears, inserting the servo motor into its cover, attaching the drive gear to the servo, mounting the cover/motor assembly onto the base, and finally securing the motor cover lid.
Follow the image sequence below:
The process involves placing the two servos into the housing halves, routing all three servo cables (two from this segment, one from the gripper) neatly, closing the housing, attaching the servo horns, inserting nuts for the connection points, and finally attaching this segment to the gripper assembly.
Follow the image sequence below:
This final assembly section covers attaching the main arm structure (gripper and main body) to the rotating base stand, which houses the fourth servo motor responsible for the arm's rotation.
The process involves assembling the base itself by mounting the servo motor and securing it with a bracket, then aligning the completed arm assembly with the base and fastening the main pivot points.
With the arm assembled, connect the servo motors to your ESP32 board running the smart-motor
firmware. Pay close attention to the wiring:
smart-motor
firmware.Important - Power Stability: While some ESP32 boards can adequately power four low-power micro-servos like the MG90S directly from their 5V output (if the board has a strong power source), servo motors can cause voltage fluctuations. To ensure stable operation, it is highly recommended to add power supply capacitors.
You can use a breadboard for temporary connections, but a dedicated PCB shield offers a cleaner setup.
A simple shield can facilitate connections and provide convenient locations for soldering the stabilizing capacitors.
Once wired and powered, the device should connect to Wi-Fi and appear in the HomeGenie Panel app, ready for control and automation via HomeGenie Server.
Note: The Robot Arm design is based on a freely available model, remixed slightly for MG90S servos, M2 screws and for faster printing with a 0.20mm layer height. You can find the original SG90 Robot Arm by ChipCode on Printables.
Smart Light project files by G-Labs licensed under CC BY-NC 4.0
Connect your ESP32/ESP8266 microcontroller to your computer via USB, select your firmware version, and click "Create device" to upload the HomeGenie Mini firmware.
Installing firmware directly from this page works only in browsers with Web Serial API enabled.
See the Device setup page for further information about configuring a HomeGenie Mini device.
In addition to the common Device API, this device implements the following modules and API.
S<n>
moduleRepresents and controls the servo motor with address S<n>
(<n> ::= '1' ... '8').
Automation.Components/S<n>
(e.g. "Automation.HomeGenie/S1")
Status.Level
Status.ColorHsb
Status.Error
Motor.Type
Motor.Type.Servo.AngleMin
0
)Motor.Type.Servo.AngleMax
180
)Motor.Type.Servo.AngleSpeed
10
)Motor.Type.ServoEncoder.Speed
10
)Motor.Type.ServoEncoder.Steps
Motor.Type.ServoEncoder.Calibrate
Control.Open
Control.Close
Control.Level/<level>
Control.ColorHsb/<h>,<s>,<b>,<tansition_ms>
Motor.Calibrate