My project blind assist as the name implies assists blind people particularly those who are recently experiencing blindness. The device assists them by helping them avoid bumping into objects in their homes which is prevalent with recently blind people as they haven't adapted to their current situation.
The device works by placing a BLE device on the blind individual and various objects in their homes. Using Bluetooth it estimates the distance of the blind individual to another object. When the user comes into a specified range the BLE device on the object plays a unique tone to tell the blind individual that it is close to a certain object, the tone is unique to each object in the home helping the individual to tell objects apart.
I built two devices: the one worn by the user, which we will call the Beacon, and the one placed on objects, which we will call the AlertNode.
Beacon
AlertNode
In summary, the device operates as follows:
The Beacon continuously broadcasts its UUID. When it comes within range of an Alert Node, the Alert Node activates its buzzer. The Alert Node is configured via a mobile application, with settings that include the unique tone it should play, the detection range, and the UUID of the Beacon Unit.
UUID (Universally Unique Identifier) is a 128-bit value used to uniquely identify A BLE device or a service running on a BLE device.
A service in this context refers to a specific function or feature provided by a device, like the Beacon. It could be something like broadcasting its location or sending data. The Alert Node can detect and interact with this service based on the UUID, triggering actions like activating a buzzer.Assembly and Wiring
The Beacon
The connection for the Beacon is straightforward, designing a PCB was not necessary, you just have to hook up the battery charger to the ESP32 s3 Xiao as in the schematic diagram below:
Make sure you make a hole in your enclosure to pass the antenna wire through, so you can close the enclosure
Alert Node
The initial design for the Alert Node had an OLED and a potentiometer, but after some feedback, I didn't see the need for them anymore. I wanted to use the potentiometer and the OLED for adjusting the buzzer's tone and sensing range, but I eventually moved all those features to the app. Below is the schematic diagram:
If you want to order the PCB, you can find the Gerber files in my GitHub repository here. The CD42 lithium ion charging module is not part of the PCB, there are two pins tagged supply on the PCB, through there, you connect the 5V output of the CD42 to the PCB.
After making all the connections you can now place all the components in the enclosure box, if your battery is bigger than the box like mine, solder it last.
Make a hole by the side of the box to pass the battery wires through, then solder the wires to the battery. This way the battery will be outside.
Use glue to hold all your components together.
Note: The code only works with esp32 board version 3.0.2 in the Arduino IDE, Version 3.0, 3 has issues with the Arduino tone function, at least in my code. So I stuck with 3.0.2.
The code for the Alert Node is named BlindAssistNode on GitHub
The code for the Beacon Unit is named BlindAssistBeacon
The Beacon
The Beacon code can be separated into two parts the advertising code and the timer code to keep the CD42 on. When there is not enough load on the CD42, it will go off to keep it on, we need to send a LOW pulse for at least every 30 seconds.
To achieve this, I used the xTimerCreate() function from FreeRtos to create a periodic timer.
The timer calls a function wake_charger every 20 seconds to send a LOW pulse to D5 on the ESP32S3 Xiao, which is connected to the key pin on the CD42.
The rest of the code is for the BLE advertising.
The full code can be found in my GitHub Repository.
The Alert NodeThe Alert Node code can be split into three parts SCAN,ADVERTISE, CHECK, and SAVE.
Scanning
the two important functions in the scanning code block are the setInterval and setWindow, with this you can manipulate the scanning efficiency of the device. The difference between interval and window:
Interval: This is the time between the start of two consecutive scan windows. It is defined in units of 0.625 ms. A smaller interval means the scanner will wake up more frequently to check for advertisements, leading to higher power consumption and potentially shorter discovery times.
Window: This is the duration of the actual scan period within the interval. It is also defined in units of 0.625 ms. A longer scan window means the device spends more time actively scanning within each interval, which can increase the chance of discovering devices but also leads to higher power consumption
ADVERTISING
We need it to advertise its service UUID so our app can use that to connect to it and send configuration data to it.
CHECK
This part of the code helps to check if the specific UUID we are looking for is part of the devices that came up in the scan and is in the specified range set in the configuration file.
SAVE
This part of the code collects data from our mobile application and saves it to the device. The code has to tell which setting I am trying to update to update the appropriate parameter.
For the UUID, which was more than 23bytes which is the limit of the amount of data that can be sent via BLE using the mobile app, I had to split the UUID into chunks at its hyphens then send then send each chunk to the ESP32 and then add the hyphen back.
The tone. To know if the app was sending a NOTE I had first to check if the data starts with N, if true, then save it as NOTE
The device name. Before sending the device name, I append the character 'n', to it, so the ESP knows it is receiving the device name. If any of the above conditions are not true then you are probably receiving the device sensing range.
I built the Mobile application using Kodular, you can access it via my GitHub repository here.
Using the Mobile app
There are four fields for inputs:
Device name: this is the name you want to give the Alert Node which will be placed on an object in the house. For example, if placed on a table, it would be ideal to name the device table.
Adjust range: This is the range you want the Beacon Unit to be detected.
Choosetone: You can customize the tone for different objects in the house, so objects can be recognised based on their sound.
Target deviceUUID: The UUID of the Beacon unit (The Beacon unit is constantly broadcasting its UUID).
Connecting to a BLE Device
Click the Bluetooth Icon to see a list of Bluetooth devices.
once it is connected, you will see connected and the device you connected to, as in the screen below:
Comments