BLE Control From the Wrist
by Markus Opitz in Circuits > Microcontrollers
522 Views, 9 Favorites, 0 Comments
BLE Control From the Wrist
The Xiao nRF52840 Sense has an IMU circuit on board, as accelerometer and gyroscope data would be available.
My father is over 80 years old and has a damaged shoulder which he does not want to have operated on. He can no longer lift his arm very high.
I would therefore like to make him a servo support for his shoulder (next project). But how to control the whole thing? I can't implant a chip into my father! I have already designed a large potentiometer knob, very easy to grip for old hands, but still impractical for control. That's why the controller is now on my wrist, in the form of an XIAO nRF sense.
The great thing about the newer XIAO devices from SeeedStudio is the built-in LiPo charging unit with contacts on the underside of the board. Soldering can be a little tricky, but the benefits are unbeatable.
Supplies
XIAO nRF52840 sense
switch
LiPo battery 100-200 mAh
3D printed parts
The XIAO NRF
The Xiao nRF52840 Sense can be programmed via Arduino IDE. You can learn how to do this on this page.
Download my program and upload it to the XIAO nrf. In my example, it only records the Y value of the accelerator data. This is enough for me to move the servo up or down. You can also enable X and Z values or the gyroscope. When switched on, a blue LED indicates readiness.
The XIAO nrf sense establishes BLE contact with the counterpart, in this case an ESP32 - the LED lights up green. The XIAO nrf sense immediately sends the data suitably converted as values for the servo from 0 to 180.
Only a little soldering is required: The battery is soldered to the +/- connections on the underside of the XIAO nRF via a switch. Caution: Avoid short-circuiting the battery by all means!
See also Step 3.
Downloads
The Wristband
I decided on a quick version, a 3D-printed wristband. The housing is matched to the XIAO nRF, a 150mAh Lipo battery and a slide switch. The housing and chain links can be printed together in one piece. The chain links have a distance of 0.2 mm and can be moved in relation to each other after printing.
Of course you can also use your own tape and install XIAO and battery only in the housing (housing_only.stl).
Downloads
The Assembly
The XIAO nRF is placed in the lid of the housing with a little hot glue. I also apply a little glue to the small viewing window, which will later distribute the LED light a little better. The slide switch is then installed and also fixed in place with glue. Parts of the switch can be shortened in advance using side-cutting pliers.
A wire (red) is soldered to the Bat. + connection and led to the switch. The red connection of the battery can now also be soldered there. The black wire of the battery (-) is soldered to the Bat - of the XIAO.
The Receiving Station
For my shoulder servo project, I opted for an ESP32-Wroom from AZ-Delivery. It also has BLE on board and is easy to program.
This is an ESP32 with a servo. It is preconnected to a buck converter (set to 5V) with a capacitor.
Download the receiver program and upload it to the ESP32. Instructions here.
After successful programming, our wristband LED should change from blue to green.
Now the servo is controlled from your wrist.
To make the servo movements a little smoother, I have added a so-called exponential filter with this line: