JAMA is open access hardware that was developed during my master's work at Edmond and Lily Safra International Institute of Neuroscience of Santos Dumont Insitute. The function of JAMA is to measure joint angles wirelessly with 9 DOF, using a microcontroller (ESP32) together with an inertial measure unit (GY-80). Here we are providing all the codes and guidelines necessary to build this device and with the structure provided it will be easy to adapt to other sensors or microcontrollers. Together with JAMA, we developed a python library (PyJama) to analyze the extracted data using JAMA and other devices available on the market (IMU, MIMU, optical devices).
Related libraries for the development and use of JAMA
- PyJama PyJama is a friendly python library for analyzing human kinematics data.
- EngineeringLibrary C++ library for microcontrollers and sensors
This section contains information for building JAMA
This section covers how to build the proposed hardware.
- ESP32-DevKit-C
- GY-80
- 2 batteries 3.7V
The total cost of the components is approximately $ 30
The proposed circuit was built in a 3D Case available openly. The file has 2 models, the model shown on the right of the image was designed to be used with small 3.7 V batteries and the other for large batteries. The holes were not made in the model in order to make it easy to adapt (sensor, battery or ESP model), for use in this project the holes can be made by hand. 3D models made in partnership with Iago "Raj" da Silva.
For the construction of the circuit, the connections must be made as shown in the image, by wiring or using jumpers.
Connections:
- Battery (+) -> Swtich Button (+)
- Switch Button (+) -> ESP32 VIN
- Battery (-) -> ESP32 GND
- ESP32 3.3V -> GY-80 VCC_3.3V
- ESP32 GND -> GY-80 GND
- ESP32 GPIO 21 -> GY-80 SDA
- ESP32 GPIO 22 -> GY-80 SCL
This section discusses how to build the firmware on ESP32.
Softwares:
This project brings support for the ESP32 chip to the Arduino environment. It lets you write sketches, using familiar Arduino functions and libraries, and run them directly on ESP32, with no external microcontroller required. Here we are using I2C and Async-TCP communications.
VSCode combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.
PlatformIO is an open source ecosystem for IoT development with a cross-platform build system, a library manager, and full support for Espressif (ESP32) development. It works on the following popular host operating systems: macOS, Windows, Linux 32/64, and Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
- What is PlatformIO?
- PlatformIO IDE Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode
- Project Examples
- Installing on VSCode
Using PlatformIO within the VSCode, add the workspace to the JAMA firmware folder. To work, you must change the IP address in the main file to the IP that you want ESP32 to have, and edit the file "WiFistaTCP_h" and determine the IP and password of the Wi-Fi to be connected.
To build select PlatformIO with ESP32 connected to the computer and select "Upload and monitor".
Step by step:
- Make sure the machine's IP and password are correct.
- Make sure the firmware is uploaded to ESP32.
- Create a Wi-Fi Hotspot on your computer.
- Make sure that the ESP32 is connected to power (battery or serial) and to the GY-80 sensor (if it is another sensor, you must change the library).
- Turn on the ESP32.
- Open and run the file "client.py"
- Operation messages will appear in the python interpreter.
- The file will be saved in the same location as the "client.py" file.
Here we present the JAMA device built in a way to facilitate tests and updates in the software. The total weight of JAMA is 134 grams.
For minor fixes of code and documentation, please go ahead and submit a pull request. A gentle introduction to the process can be found here.
Check out the list of issues that are easy to fix. Working on them is a great way to move the project forward.
Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first. PRs with such changes require testing and approval.
Feature branches with lots of small commits (especially titled "oops", "fix typo", "forgot to add file", etc.) should be squashed before opening a pull request. At the same time, please refrain from putting multiple unrelated changes into a single pull request.
- Tulio Almeida - GitHub - Scholar
- Abner Rodrigues - GitHub - Scholar
- André Dantas - GitHub - Scholar
- de Almeida TF, Morya E, Rodrigues AC, de Azevedo Dantas AFO. Development of a Low-Cost Open-Source Measurement System for Joint Angle Estimation. Sensors. 2021; 21(19):6477. https://doi.org/10.3390/s21196477
- If you publish any paper using JAMA please contact us to update here!
AsyncTCP This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs.