This repository implements lightweight Machine Learning (“Light AI” or TinyML) algorithms running natively and entirely offline on highly constrained microcontrollers. It showcases how neural networks, pattern classifiers, and reinforcement learning can execute directly on edge silicon without cloud dependencies.
ArduinoANN.ino)Paradigm: Supervised Feedforward Artificial Neural Network (ANN) trained on-chip via backpropagation.
Task: 7-segment display digit recognition (mapping physical segments to digits 0–9).
Architecture: 7 input nodes, 8 hidden nodes, and 4 binary output nodes.
Mathematical Model: Calculates activations using sigmoid functions and performs localized weight updates with adjustable Learning Rate and Momentum.
ArduinoANNFIB.ino)byte wrap-around for values exceeding 255, such as 377 becoming 121 and 610 becoming 98) mapped to 4-bit classifications.ArduinoRL.ino)To get started, clone the repository and navigate into the project directory:
git clone https://github.com/universalbit-dev/universalbit-dev.git
cd universalbit-dev/ann/
You can compile and flash either model using the local sandbox script arduino_ai_uploader.sh.
# Make the deployment script executable
chmod +x arduino_ai_uploader.sh
# Run the automated uploader (Handles serial ports and chip auto-probing)
sudo ./arduino_ai_uploader.sh
.ino files (dynamically parsing ArduinoANN.ino, ArduinoANNFIB.ino, and ArduinoRL.ino into the menu selection).arduino-cli inside your home directory so your system packages remain unmodified./dev/ttyUSB1)./tmp environment to bypass multiple-definition or artifact conflicts.The firmware is fully compatible with standard AVR (Nano/Uno) and 32-bit Expressif (ESP8266/ESP32) boards.
USB Data Cable: Be sure to use a dedicated USB Data Cable. Standard charging-only cables omit internal data lines and cannot compile/upload sketches or output serial logs.
Old Bootloader Fallback: Many common Arduino Nano clone boards use the Atmega328P Old Bootloader. If your upload times out, simply select Option 2 (Arduino Nano Old Bootloader) in the command-line script menu.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full terms and conditions.