Position tracking docs added

This commit is contained in:
SebasKoedam
2024-05-31 12:09:22 +02:00
parent 84bdc7ca59
commit 70b5b1078b
4 changed files with 43 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

View File

@@ -2,19 +2,18 @@
## Introduction
For this project we want to design an embedded system that can track a users position. We want to track their current position on the ground. This system will be used to track their position to determine if a user is doing the exercises correctly.
For this project an embedded system that can track a users position is needed. This system will be used to track their position to determine if a user is doing the exercises correctly.
## Objectives
- Design an embedded system that can track user position.
- Develop an algorithm to process the data from the sensor and determine the user's position.
- Sync the code to the current task for the user.
- Design an embedded system that can track user position and sent the data to an Android App.
- Recieve the data from the embedded system in the Android App and sync the data to the current task for the user.
## Research and Analysis
### Choosing the sensor
For this project we have chosen LDR's as our primary sensor. The LDR's will be placed on the ground in a board and the user will stand on top of the board. The LDR's will be used to track the user's position. The LDR's will be connected to the esp32s3 microcontroller and the data will be processed to determine the user's position.
For this project we have chosen LDR's as our primary sensor. The LDR's will be placed on the ground in a board and the user will stand on top of the board. The LDR's will be used to track the user's position. The LDR's will be connected to the ESP32 microcontroller and the data will be processed to determine the user's position.
We have chosen this sensor since it's one of the easiest and cheapest solutions to our problem. Other sensors like pressure sensors, accelerometers, and Wii Balance Board are either too expensive, not the most optimal for the task, or hard to integrate with other systems.
@@ -42,9 +41,28 @@ Accelerometers:
- Cons: Will require additional hardware for data transfer.
- Cost: ~ 5 euros (https://www.amazon.nl/versnellingsmeter-gyroscoop-versnellingssensor-converter-gegevensuitgang/dp/B07BVXN2GP/ref=asc_df_B07BVXN2GP/?tag=nlshogostdde-21&linkCode=df0&hvadid=430548884871&hvpos=&hvnetw=g&hvrand=5187253011954678898&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1010543&hvtargid=pla-928293154057&psc=1&mcid=43bf111afa7b3ba593f4a49321683352)
### System Requirements
### Wii Balance Board
To be added
The use of a Wii Balance Board was considered for this project. The Wii Balance Board is a balance board that can measure a user's weight and center of balance. The implementation of the board is very similar to the LDR's with an ESP32. The board also had bluetooth which makes it possible to connect to the Android App. However, the Wii Balance Board is very hard to integrate with other systems. The board is not designed to be used with other systems and the documentation is very limited. This makes it very hard to use the board for this project.
#### Problems with the Wii Balance Board
- The Wii Balance Board is not designed to be used with other systems. The documentation is very limited and there is no official SDK available.
- The Wii Balance Board does not use UUID's for the services and characteristics. This makes it very hard to connect to the board and read the data.
- When trying to connect to the Wii Balance Board, the board would show up as a device but would ask for a PIN code. The PIN code is not documented anywhere and there is no way to connect to the board without it.
`Bluetooth pairing must be initiated by the host by sending a "Require Authentication" HCI command to its bluetooth device. The bluetooth device will ask the host for a link key, which must be rejected so it will ask for a PIN-Code. The PIN-Code is the binary bluetooth address of the wiimote backwards.`
When trying the solution above the board would reject the PIN code and would not connect to the host.
#### Sources
The following sources have been used to research the Wii Balance Board:
- [Wii Balance Board](https://wiibrew.org/wiki/Wii_Balance_Board#Bluetooth_Communication)
- [Wii Mote](https://wiibrew.org/wiki/Wiimote#Bluetooth_Communication)
Publicly available projects have been researched aswell nearly all of them dind't use java to connect to the Wii Balance Board. The projects that did use java to connect to the Wii Balance Board were either outdated or didn't work.
## System Design
@@ -52,39 +70,29 @@ To be added
The hardware of the system will consist of the following components:
- LDR: The sensor that will be used to track the user's position based on the light intensity.
- ESP32S3: The microcontroller that will process the data from the LDR.
- Pepper: The controller that will recieve the processed data from the ESP32S3 and will sync the data to the current task for the user.
- ESP32: The microcontroller that will process the data from the LDR.
- Pepper: The controller that will recieve the processed data from the ESP32 and will sync the data to the current task for the user.
#### Connection diagram
To be added
### Software
To be added
### Integration
To be added
![Connection diagram](../diagrams/assets/positionTracking.png)
## Implementation
### Prototyping
To be added
A prototype of the app has been created to test the connection between the ESP32 and the Android App. The app can discover BLE devices and connect to them. The app currently is not able to continously read the data from the ESP32. It can however read the data once.
### Testing and Validation
To be added
The prototype of the 'Tracking board' has been tested. The LDR's have were connected to the ESP32 on a breadboard. The ESP32 will emit itself as a GATT server and the Android App will look for the hosts name and connect to it. The Android App will then read the data from the ESP32 once.
## Conclusion
To be added
The LDR's with the ESP32 are a good solution for the problem. The LDR's are cheap and easy to use. The ESP32 is a good microcontroller to process the data from the LDR's. The Android App can connect to the ESP32 and read the data from it. The next step is to make the Android App continously read the data from the ESP32 and display it to the user/use it in the app for exercises.
## References
[Bluetooth Discovery](https://developer.android.com/develop/connectivity/bluetooth/find-bluetooth-devices)
## Appendices
To be added
[GATT Server Connection](https://developer.android.com/develop/connectivity/bluetooth/ble/connect-gatt-server)
[ESP32 GATT Server](https://github.com/nkolban/esp32-snippets/tree/master/cpp_utils/tests/BLETests/Arduino/BLE_server)

View File

@@ -25,4 +25,13 @@ Infrastructuur beschreven met problemen en oplossingen [Infrastuctuur](https://m
## K4: Je ontwerpt een embedded systeem op basis van gegeven hardware. & K5: Je kan software schrijven voor een intelligente controller voorzien van actuatoren en sensoren.
Research naar hardware en software voor de controller
Voor K4 ben ik bezig geweest met het onderzoeken van hardware die kan samen werken met pepper om de gebruikers positie te tracken. Aan het begin was het idee om met een Wii Balance Board te werken, maar dit was niet mogelijk. Daarom ben ik gaan kijken naar andere hardware waarmee dit mogelijk zo zijn.
[Research naar hardware en software voor de controller](/docs/documentation/research-questions/position-tracking-research.md)
Voor K5 ben ik bezig geweest met het onderzoeken en schrijven van de software die nodig is om de hardware te laten werken. Hierbij heb ik gekeken naar de software die nodig is om de hardware te laten werken en hoe deze samenwerkt met de software van een Android App. Research naar de software die nodig is voor de controller is te vinden in de link hierboven. De code voor de controller is te vinden in de link hieronder.
Code voor [BLE device scanner](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66/-/blob/bead6a5a13e5df6658cb9db451c4565250c6a2f6/code/src/Fitbot/app/src/main/java/com/example/fitbot/bluetooth/DeviceScanner.java). Deze code is geschreven voor een android applicatie die BLE devices kan discoveren en connecten.
Code voor de [ESP32](https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66/-/tree/bead6a5a13e5df6658cb9db451c4565250c6a2f6/code/arduino/Position-tracking). Deze code is geschreven om de ESP32 zich te laten opstellen als GATT server en de data van de LDR sensor te versturen naar de android app.
---