This project is aimed at recognizing digits that are air-written using accelerometer data and a deep learning-based model. The project uses the I2C communication protocol to gather data from an accelerometer (ADXL345), preprocesses it, and feeds it to a deep learning sequential model for training. The trained model is then used to recognize digits drawn in the air in real-time on a Raspberry Pi.
- Clone the project repository onto your local machine using the following command:
git clone https://github.com/Rahul2003s/Air_writing.git
- Install the necessary dependencies for the project using the following command:
sudo apt-get update
sudo apt-get install python3-dev python3-pip python3-smbus i2c-tools -y
- Enable I2C communication on the Raspberry Pi using the following commands:
sudo raspi-config
Navigate to 'Interface Options > I2C' and select 'Yes'. Then, reboot the Raspberry Pi using the following command:
sudo reboot
- Check that the ADXL345 accelerometer is working correctly using the following command:
sudo i2cdetect -y 1
The output should show "53" in the grid.
- Install the Adafruit CircuitPython ADXL34x library using the following command:
sudo pip3 install adafruit-circuitpython-ADXL34x
- Install TensorFlow on the Raspberry Pi by following the steps outlined in this blog post.
- Connect the ADXL345 accelerometer to the Raspberry Pi using the I2C communication protocol.
- Run the data collection and preprocessing script to capture the data required for training the deep learning model. The script generates 2D frames or arrays of the accelerometer data, corresponding to the digits drawn in the air.
- Train the deep learning sequential model using the generated data. The trained model is saved in a .h5 file, which is later used for real-time testing.
- Load the trained model onto the Raspberry Pi for real-time testing of the digit recognition system.
To use the digit recognition system, follow the steps below:
-
Run the real-time testing script on the Raspberry Pi.
-
Use your hand to draw a digit in the air. Ensure that the accelerometer is held firmly in your hand, and that the drawing is clear and distinct.
-
The digit recognition system will then recognize the digit and display the result on the screen.
If you find any bugs or issues with the project, feel free to submit a pull request or create an issue on the project repository. We welcome all contributions to the project.