Control a Robotic Hand With Muscles (EMG) and ESP-EEG: the Ultimate Open-Source EMG Interface!

by Cerelog99 in Circuits > Robots

94 Views, 0 Favorites, 0 Comments

Control a Robotic Hand With Muscles (EMG) and ESP-EEG: the Ultimate Open-Source EMG Interface!

March 3, 2026

Have you ever wanted to give yourself cyborg-like abilities and control a robot using nothing but the electrical signals in your muscles?

In our previous Instructable, we showed you how to read brainwaves (EEG) using the Cerelog ESP-EEG. But this powerful, 8-channel biosensing board isn't just for brains—it's a "multitool" for many unique bio-signals! Today, we are going to capture electromyography (EMG) data and map those raw muscle signals to control a robotic hand in real-time.

Whether you are building open-source prosthetics, experimenting with exoskeletons, or just want to feel like a superhero, this project will show you how to read the electrical activity of your muscles and turn it into physical movement.

Supplies

product_image_w.jpg

Step 1: Supplies (The Ingredients List)

To turn your muscle flexes into digital data and robotic action, you need the right gear. Here is the complete setup:

The Core Hardware:

  1. 1x Cerelog ESP-EEG Board: The high-precision bio-signal sensor used to read the EMG data. (Available atwww.cerelog.com)
  2. 1x uHand Robotic Hand: The mechanical hand used in this demo. (Available on Amazon for ~$160). Note: Cerelog isn't affiliated with this vendor.
  3. Laptop running on ONLY battery power (Crucial for clean data and safety!).

Required Accessories:

  1. Electrodes & Leads: To attach to your arm for signal detection.
  2. TENS Pads: For sticking to your muscle groups.
  3. Conductive Electrode Gel: Essential for getting a clean signal through the skin.



Source Code & Files: Check out our GitHub repository for the robohand_emg.py script and Arduino firmware for robotic hand

⚠️ WARNING

Screenshot 2026-03-14 at 7.58.40 PM.png

⚡ NON-ISOLATED DEVICE: BATTERY OPERATION REQUIRED ⚡

Just like when reading brainwaves, safety and signal quality come first. This device does not feature isolation circuitry. To ensure user safety and prevent 60Hz/50Hz mains hum from ruining your EMG data:

  1. ALWAYS use this device with a laptop running on BATTERY POWER.
  2. NEVER connect this device to a computer that is plugged into a wall outlet.

Mains power introduces massive electrical noise that will hide your muscle signals. More importantly, using a non-isolated device strapped to your body while plugged into the wall creates a safety hazard. Stay unplugged!

Hardware Setup & Electrode Placement

product_image_w.jpg
connecting diagram.001.jpeg

For this demo, we only need to use a single channel (Channel 1) on the ESP-EEG to read the flex of your forearm. Here is the special electrode connection note for getting perfect EMG readings:

  1. The Muscle Group: Apply TENS pads with a little electrode gel across the main muscle belly of your forearm. Connect the 1+ and SRB1 leads to these pads.
  2. The Reference: You need a neutral reference point. Place one more electrode on a bony area with low muscle activity, like your elbow or wrist.
  3. Special Note for EMG: Connect this reference electrode to the GND pin on the ESP-EEG. (While we normally use the Bias pin for EEG active noise cancellation to drive the right leg, I highly recommend you try this out with the 'GND' pin instead of Bias for this specific EMG demo usage).


Flashing the Firmware to the Robotic Hand

printed1.png

Before the robotic hand can understand your muscle commands, it needs to be prepped with the right code.

  1. Connect the uHand to your computer via USB.
  2. Open the Arduino IDE.
  3. Flash the Arduino firmware (provided in our GitHub repository) directly to the uHand. This readies the robotic hand to receive serial commands from our Python bridge.


Software Setup & Running the Bridge

Screenshot 2026-03-14 at 8.00.13 PM.png

With the hardware wired up and the uHand firmware flashed, it's time to bridge the connection. We've written a Python script that reads the live EMG data from the Cerelog ESP-EEG, calculates the signal strength, and triggers the robotic hand to close when you flex.

  1. Ensure your ESP-EEG is powered, connected to your electrodes, and ready to transmit data.
  2. Open your terminal or command prompt.
  3. Run the bridging script:

code Bash


# Example command to run the python script
python robohand_emg.py

# Note: If you are on a Mac, use python3:
python3 robohand_emg.py


Demo Time - Flex and Control!

Screenshot 2026-03-14 at 8.01.35 PM.png

Watch your computer screen as the script runs. The live GUI displays the RMS (Root Mean Square) of your muscle signals in microvolts (µV).

  1. Relax: Your arm rests, the graph stays flat, and the uHand stays open.
  2. Flex!: As you squeeze your forearm, the electrical spikes from your muscle's motor units shoot up the graph. The Python script detects this massive threshold crossing and instantly commands the uHand to close its mechanical fingers!

It's an incredibly satisfying loop: your biological signals translated instantly into mechanical movement. You are basically a cyborg now!

Conclusion

IMG_3756.jpg

The Cerelog ESP-EEG isn't just a circuit board; it's a gateway to understanding and utilizing human biosignals. Whether you are mapping alpha brainwaves for meditation or capturing EMG data to control robotic prosthetics, this board delivers the high-fidelity, research-grade data you need to make it happen.