Software apps and online services
My idea is to integrate voice control capability into the existing power lifts used by people with lower limb paralysis.
I am a quadriplegic who uses a power wheelchair to live on a semi-independent basis. I transfer into my wheelchair via a powered Hoyer lift. Being I do not have use of my thumbs, I have been working on a method to control a lift over my local network via voice using an Alexa device and an Raspberry Pi Zero W along with an ANAVI Infrared pHAT to send commands to the Hoyer Lift.
This would Enable Paralyzed Individuals to be able to Safely and Independently Transfer from Wheelchair to Anywhere and Back Again.
The potential gains in independence for people living with paralysis combined with the economic benefit of not needing another person for transfer to and from the wheelchair are almost incalculable, especially combined with the minuscule cost of necessary hardware.
For this Project you will need the following hardware:
- Raspberry Pi (any model or version with 40 pin headers such Zero, Zero W, B+, 2 or 3)
- Anavi Infrared pHAT
- USB power supply
- microSD card with Raspian
In my project, I am using a Raspberry Pi Zero W, which doesn't come with headers already installed, so I have to add the additional step of installing said headers.
I chose to use the GPIO Hammer Header (Solderless) from Pimoroni for ease of installation.
Once the headers were installed, getting started with the ANAVI Infrared pHAT is easy. You just need to plug it in to the 40 pin header on your Raspberry Pi.
After that, insert the microSD card that we just flashed with the Raspbian distribution and turn on your Pi.
Next, open a terminal on your Raspberry or just login via SSH and perform the following steps to enable the infrared receiver and transmitter:
sudo apt-get update sudo apt-get install -y lirc
Edit /etc/modules and add the IR pins by adding the following lines to the end of the file:
lirc_dev lirc_rpi gpio_in_pin=18 gpio_out_pin=17
Configure /etc/lirc/hardware.conf in a way to match:
# /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS="--uinput" #Don't start lircmd even if there seems to be a good config file #START_LIRCMD=false #Don't start irexec, even if a good config file seems to exist. #START_IREXEC=false #Try to load appropriate kernel modules LOAD_MODULES=true # Run "lircd --driver=help" for a list of supported drivers. #DRIVER="UNCONFIGURED" DRIVER="default" # usually /dev/lirc0 is the correct setting for systems using udev DEVICE="/dev/lirc0" MODULES="lirc_rpi" # Default configuration files for your hardware if any LIRCD_CONF="" LIRCMD_CONF=""
Edit /boot/config.txt and configure kernel extensions by adding the following line to the end of the file:
Reboot Raspberry Pi:
sudo shutdown -r 0
Learning the Remote(s)
Follow the below steps to create a LIRC configuration file and test the infrared transmitter:
Stop LIRC systemd service:
sudo systemctl stop lirc
List all available names for buttons supported by LIRC:
Type in the following to create a new LIRC control configuration file and follow the on screen instructions to scan a remote control:
irrecord -d /dev/lirc0 ~/lircd.conf
Example configuration output:
Now enter the names for the buttons. Please enter the name for the next button (press ENTER to finish recording) KEY_OVER Now hold down button "KEY_OVER". Please enter the name for the next button (press ENTER to finish recording) KEY_LIFTUP Now hold down button "KEY_LIFTUP". Please enter the name for the next button (press ENTER to finish recording) KEY_LIFTDOWN Now hold down button "KEY_LIFTDOWN". Please enter the name for the next button (press ENTER to finish recording) Successfully written config file.
Backup the original LIRC configuration file:
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd-backup.conf
Load the new configuration file:
sudo mv ~/lircd.conf /etc/lirc/lircd.conf
Launch LIRC systemd service again:
sudo systemctl start lirc
Sending Infrared Commands
Point the infrared transmitters on the ANAVI Infrared pHAT towards the Hoyer Lift and send commands using LIRC.
irsend SEND_ONCE /home/pi/lircd.conf KEY_OVER
Voice and Alexa Integration
While I had initially intended to use a combination of AWS, node-red, and some custom Lambda to interact with Alexa, the delay between voice command and response was unacceptably long, especially considering this was intended as a healthcare accessory. Fortunately,I happened across the very excellent voice_lirc by Rob Gibbon, and found it to be a much leaner and more responsive solution. Set up and installation was as easy as a couple lines in the pi's terminal which I would happily go through here, but I would just be parroting Rob Gibbon's also excellent README located at https://github.com/grobbie/voice_lirc.