Pyro - Remote Control for HandyControl

What is Pyro?

Pyro is a python script that can run on a Raspberry Pi. It reads data from an acceleration sensor and sends its data via Wifi to your PC. HandyControl listens to the incomming data from Pyro and controls speed and/or stroke of Handy if you tilt the Pyro remote.

The Pi can run the script on boot so you don’t have to enable it. Just plug in the power and it should send data after a while. If you are using a power bank or a battery you can even make it wireless, which was the primary goal of this project.

How to use it in HandyControl?

Pyro is used as a mobile sensor in HandyControl. Just select it in the dropdown of the device settings. Make sure to make a firewall rule to allow incomming UDP traffic.
grafik

In the main window select Mobile App as source and press Start.
See this page to get more information on how to use sensors.
You need HandyControl 1.2.3 to use Pyro.

I am using the sensors mainly to adjust the stroke lenght on a script during a session. This way you can decrease the intensity of fast sections on the fly.


How to build a Pyro remote…

Since this is my very first project with a Raspberry Pi there will probably be things that can be made better. So if you have some hints how to improve it please let me know :slight_smile:
I have expected it to be difficult but in the end it was quite easy to made.

Getting started with Raspberry Pi

What you need

  • Raspberry Pi Zero 2 W (others with included wifi might also work) 15,90€
  • MicroSD card to install the Raspberry Pi OS 6,40€
  • GY-521 MPU-6050 Sensor 2,60€
  • Wires, hot glue, soldering equipment
  • microSD Cardreader
  • Energy source (micro USB cable with at least 1A)
  • :inbox_tray: The ‘Pyro’ script

Optional

  • Mini HDMI Adapter (Until the VNC connection is enabled)
  • USB OTG Cable, A Female / Micro B (Mouse + Keyboard)
  • A compatible case 6,00€

Setup Guide copied from Pyro.py

# Attach sensor to Raspberry Pi
# Install OS on micro SD card
# Boot OS and setup your Wifi
# Enable VNC for remote access. Use VNC Viewer (RealVNC) on PC.
# Enable I2C
# Add modules
    # sudo nano /etc/modules
    # Add lines
        # i2c-bcm2708
        # i2c-dev
    # Restart        
# Setup Tools
    # sudo apt-get install i2c-tools python-smbus
# Test I2C
    # sudo i2cdetect -y 1
        # It should show one device with adress 68
    # sudo i2cget -y 1 0x68 0x75
        # It should return "0x68"
# Copy the the script to the Desktop of your Raspberry Pi
# Change the IP for your PC
# To run the script on boot add it to .bashrc
    # sudo nano /home/pi/.bashrc
    # Enter the text at the end if the file
        # echo Running at boot
        # sudo python /home/pi/Desktop/Pyro.py

How to connect the sensor

In the images above I have used hot glue to attach the sensor in the top of the case.
Try to get it as horizontal as possible.

grafik

Raspberry Pi MPU 6050
3.3V VCC
SDA SDA
SCL SCL
GND GND

Improvements (ToDo)

Existing battery modules for the PI are quite expensive so I am trying to find another possibility to power the Pyro but you are free to build one and post your results here.

In the current state it consumes ~750mW which means that a 3.7V lithium battery with 4.44Wh could power it for ~6h in theory. Attaching and charging this battery is not solved yet but I have seen examples on how to do it.

Another way would be to just use a power bank and connect it with an USB cable. The power bank could be placed inside a mobile phone bag that is worn on the upper or lower arm. My current power bank is too large to be used this way so I need to get one first to test it.

I also have to look out for possibilities to lower the energy consumption. Any ideas?

I have noticed that the Pyro script sometimes does not load on boot and I have to open the Pi console in the VNC connection to trigger it.

10 Likes

whoa this looks crazy impressive!

1 Like

Although I don’t have any use for this I think it’s really fun and interesting to see all the stuff you can to with things like Raspberry PI and a few simple accessories. Keep posting and share with the community (that goes for all who reads this) :clap:

1 Like

Wow! Now we need to get the streaming protocol up and running ASAP!

1 Like

If you have a hands free mount you can hold the remote in your hand and control the stroke lenght or speed of Handy on the fly. Works quite good for an edging session :smiling_face_with_three_hearts:

With the streaming protocol this would be even better because of the reduced reaction time.
Imagine using two sensors. One for speed and one for stroke range.

You could attach the sensor on your feet to be true hands free or attach it to something else :wink:

I also have other ideas how to use this device in the future.

This part looks a bit awkwardly solved. Using a blocking script in .bashrc.

Maybe you can use crontab to start your script: Run sudo crontab -e, then add the line:

@reboot python3 /home/pi/Desktop/Pyro.py

finally enable the cron service with sudo systemctl enable --now cron.service.

1 Like

I tried this and it did not work. I have done different spellings and even other solutions I found on the web regarding crontab and nothing was working. Moving back to .bashrc instantly worked. For me thats fine since its the only script that is running on that device.