Accessible Bluetooth Computer Switch Access
by WSUAssistiveTech in Circuits > Assistive Tech
83 Views, 0 Favorites, 0 Comments
Accessible Bluetooth Computer Switch Access
This project was designed to satisfy the task of providing our client, a 4 year old child with Cerebral Palsy, with a controller that allows him to control keyboard/mouse inputs with accessibility switches. We met with our client's family and physical therapist to establish the goals of this project, which were:
- Connect via Bluetooth
- Connect more than two switch inputs
- Allow remapping buttons for future use
- Visually accessible
- Remain within physical reach of our client
Supplies
Materials
Arduino Nano ESP32 or Adafruit Feather nRF52832 Microcontroller
AbleNet Jelly Bean or your own printed Buttons
Navona Velcro Strip (optional, to keep the case secured to a surface)
Micro-Lipo Charger for LiPoly Battery (If you use the Nano ESP32)
Voltage Boost Converter (Same as above)
Rechargeable Battery
Headphone Jack Sockets (These are stereo, but we recommend buying mono jacks instead)
Breadboard (For Testing)
Tools
Soldering Iron & Lead (or any alternative materials)
Hot Glue and Plaster
Scissors
3D Printer
Hardware Setup (testing)
We set up a simple circuit with the microcontroller and headphone jack sockets to test if our switches were properly connected. In the Arduino IDE, you can check to see if your switch is connected to the pin by using Serial.println(digitalRead(*PIN*)); in the loop function. It should print 0 in the serial monitor whenever the button is held down.
For our final design, we decided to use the Adafruit Feather nRF52832 microcontroller since it has a built-in battery port and charger. If you know how to properly connect the Micro-Lipo charger and voltage boost converter to the ESP32 Nano, then you can continue with that.
If you would like to 3D print the buttons, we've attached the .stl files needed to create your own.
Software Setup
Arduino IDE Download
The code allows the microcontroller to advertise itself as a Bluetooth keyboard. This will only need a Bluetooth connection to function, though do note that our design only accounts for Bluetooth and not any other type of connection. Each button is assigned to a GPIO pin on the microcontroller, and when the button is pressed, it sends an keyboard/mouse input to the computer. The seventh headphone jack was designed to put the microcontroller into deep sleep to save battery life.
Code for Arduino Nano ESP32
Disclaimer: When we tested this code, it functioned as intended. However, we were unable to develop this code further as our prototype that utilized the Arduino Nano ESP32 microcontroller experienced irreparable damage, so we pivoted to the Adafruit Feather nRF52832 microcontroller.
Bluetooth Keyboard Library: https://github.com/T-vK/ESP32-BLE-Keyboard/releases/tag/0.3.0
*We were using this specific version of this library due to issues with Bluetooth connection with the latest release.
Code for Adafruit Feather nRF52832
Enclosure
We designed a box with the appropriate openings to allow the charging port and the headphone jack ports to be accessible from the outside while keeping the internal components protected. Our team members possessed little to no experience with CAD or 3D modeling so we could only design a basic box with some support blocks. However, if you have experience with such, you can go ahead and add other details such as standoffs for the microcontroller, supports to keep the headphone jacks stable, or even a more appealing enclosure. Attached here are the .stl files for our enclosure if you would rather not make your own.
Solder
First, we soldered wires into the GPIO pins we decided to use. The pins we used are:
- ESP32: D2, D3, D5, D6, D8, D9, D11
- nRF52832: A0, A1, 16, 15, 7, A2, A3
We then soldered the other end of the wires to the headphone jacks. The area to be soldered can be seen in the second picture, with an example of the applied solder in the third. (Note: We used stereo jacks. If we could go back in time, we would've used mono jacks as that would have been much more simple.)
Once all of the headphone jacks are soldered, now we need to solder all of the jacks to ground. In the third picture, ground is the silver area on the jack the two wires are touching. We used six different small wires to connect all of the jacks together, i.e., the ground on jack 1 is connected to the ground on jack 2, the ground on jack 2 is connected to the ground on jack 3, and so on. We wouldn't recommend this as it makes the connection unstable. It would be a good idea to connect the ground on all of the jacks to something like a strip of metal.
In the fourth image, you can see an example of our finished product using the Adafruit Feather nRF52832, with all jacks aligned in a row.
In the fifth and sixth images, you can see the schematic diagram for wiring the ESP32 and nRF52832 respectively. As you can see, we connected the sleeve of each port together and connected it to ground. As for the Adafruit Feather nRF42832, pins 16, 15, and 7 correlate to GPIO11, GPIO12, and GPIO13 respectively.
Assembly
Once everything was soldered, we secured the microcontroller into the enclosure using our supports and glue. As for the headphone jack sockets, we used sealant to secure them in place so they wouldn't push back whenever we plugged in the switch. Along with that, we placed labels above the headphone jack socket holes to show what key each switch is assigned to. As these are label stickers, they can be replaced should any of the buttons be remapped to a different key. For the lid of the container, we used tape to keep it in place as we had not included a way to attach and detach the lid. It would be wise not to glue the lid in case of hardware failure.
Delivery
On our delivery date, we brought it to our client and showcased it to his PT and teacher. They tested it out with games that our client likes to play, along with the academic curriculum program his school is using, both of which were accessible using the project. As such, they were happy with the project and plan to make use of it during our client's development.