Mr. Robot

Precision motion control

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.

The smart-motor firmware for HomeGenie Mini

At 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.

Key features & configuration

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:

Getting started: building a 3D-printed Robotic Arm

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.

Firmware upload and motors calibration

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.

Printing the robot parts

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.

Assembling all parts

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.

Robot Arm - Gripper assembly

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:

Gripper Assembly: Step 1

Insert screws partially as shown. Do not fully tighten yet.


Open media

Gripper Assembly: Step 2

Place the gears and levers onto the bottom halves of the gripper fingers.


Open media

Gripper Assembly: Step 3

Attach the upper halves of the fingers.


Open media

Gripper Assembly: Step 4

Tighten the finger assembly screws.


Open media

Gripper Assembly: Step 5

Assembled fingers ready for mounting onto the gripper base.


Open media

Gripper Assembly: Step 6

Mount the assembled fingers onto the gripper base.


Open media

Gripper Assembly: Step 7

Align the gears during placement. Verify smooth and symmetric finger movement.


Open media

Gripper Assembly: Step 8

Insert the servo motor into the gripper base cover.


Open media

Gripper Assembly: Step 9

Attach the drive gear (using the servo horn/arm and screw from the servo kit) to the servo motor shaft.


Open media

Gripper Assembly: Step 10

Ensure correct gear orientation (as pictured) before placing the cover (with motor) onto the gripper base.


Open media

Gripper Assembly: Step 11

Maintain a finger opening of approx. 20mm while tightening the main gripper base screws.


Open media

Gripper Assembly: Step 12

View of the gripper base with all screws tightened.


Open media

Gripper Assembly: Step 13

Place the motor cover lid, ensuring the cable is routed centrally over the motor top.


Open media

Gripper Assembly: Step 14

The cable should exit towards the rear, as shown.


Open media

Gripper Assembly: Complete

Tighten the motor cover screws. Gripper assembly is now complete.


Open media

Robot Arm - Main body assembly

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:

Main Arm Body: Step 1

Insert the two servo motors into their slots within the arm segment housing halves.


Open media

Main Arm Body: Step 2

Route the servo cables neatly through the openings, ensuring they exit from the same side. Do not close the housing halves yet.


Open media

Main Arm Body: Step 3

Route the gripper servo cable alongside the other cables through the designated openings as shown. Close and secure the two arm housing halves.


Open media

Main Arm Body: Step 4

Ensure approximately 35mm of cable slack remains between the gripper attachment point and this arm segment. Partially insert the four M2 screws into the arm mounting brackets.


Open media

Main Arm Body: Step 5

Attach the appropriate servo horn/arm to the output shaft of the servo motor using its screw.


Open media

Main Arm Body: Step 6

Insert the required nuts into their designated slots on the gripper segment (for attaching this arm section).


Open media

Main Arm Body: Step 7

Align this arm segment with the gripper segment and attach the brackets using the pre-inserted M2 screws into the previously placed nuts.


Open media

Robot Arm: Base stand and final assembly

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.

Base Assembly: Step 1

Gather the base components: rotating base, final servo motor, servo mounting brackets, servo horns, and screws.


Open media

Base Assembly: Step 2

Insert the servo motor into the underside of the base; position the double-sided horn on the rotating component.


Open media

Base Assembly: Step 3

Secure the long double-sided servo horn onto the servo motor shaft using the small servo screw. Ensure the horn engages correctly and its aligned horizontally.


Open media

Base Assembly: Step 4

Put the nuts into the rotating component. Place the M2 screws into the two mounting bracket.


Open media

Base Assembly: Step 5

Insert the main body cables (3) into the cables pass-through hole on the base.


Open media

Final Assembly: Step 6

Let the cable out from the rear of the base letting them through the canal as shown in the image.


Open media

Final Assembly: Step 7

Position the previously assembled main arm body onto the completed rotating base assembly. Fasten the servo mounting bracket to the rotating base. Tighten the screws to secure the arm to the base.


Open media

Assembly Complete

The robotic arm is fully assembled.


Open media

Connecting the servo motors

With the arm assembled, connect the servo motors to your ESP32 board running the smart-motor firmware. Pay close attention to the wiring:

  1. Signal Pins: Connect the signal wire of each servo (often yellow, orange, or white) to the specific GPIO pins you configured when flashing the smart-motor firmware.
  2. Power (VCC / 5V): Connect the VCC wire (usually red) of all four servos to a 5V pin on your ESP32 board.
  3. Ground (GND): Connect the ground wire (usually brown or black) of all four servos to a GND pin on the ESP32 board.

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.

Project files download

3d printed Robot Arm

Robot Arm 3MF download REV. 1

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

Create this device now! 🪄

Connect your ESP32/ESP8266 microcontroller to your computer via USB, select your firmware version, and click "Create device" to upload the HomeGenie Mini firmware.

1. Select device type

2. Select firmware flavor

3. Let the magic happen!

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.

menu_open Content index
forum Q & A discussion forum

Modules and API

In addition to the common Device API, this device implements the following modules and API.

S<n> module

Represents and controls the servo motor with address S<n> (<n> ::= '1' ... '8').

Domain / Address

Automation.Components/S<n>

(e.g. "Automation.HomeGenie/S1")

Properties

Commands

menu_open Content index
forum Q & A discussion forum
HomeGenie
MINI 1.2 — Documentation