GithubHelp home page GithubHelp logo

risb21 / pico-shape-detection Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7.03 MB

Running a shape detection machine learning model using accelerometer data on the Raspberry Pi Pico W

License: MIT License

CMake 1.89% C++ 66.05% C 1.64% Jupyter Notebook 30.42%
machine-learning mpu6050 pico-sdk raspberry-pi-pico tflite-micro

pico-shape-detection's Introduction

pico-shape-detection

Running a shape detection machine learning model using accelerometer data on the Raspberry Pi Pico W.


Checklist of implementation

  • Read accelerometer data
  • Capture button presses
  • Store accelerometer data on button press
  • Make tflite-micro library interface
  • Feed captured data into the model
  • Display classification on LEDs
  • Error Handling

Running the project

Prequisites:

For the pico-sdk, follow the guide in Raspberry Pi Pico C/C++ SDK for Windows and Debian-based1 systems. Since I use Arch, I followed this guide to install the sdk: Arch Linux guide

ensure that the PICO_SDK_PATH refers to the actual path of pico-sdk

echo $PICO_SDK_PATH

The pin numbers have been chosen according to the following wiring:

Wiring for the Raspberry Pi Pico

These pin numbers can be changed as per your layout:

enum Pin {
// buttons
b_send = 13u,
b_record,
// I2C pins
mpu_sda = 16u,
mpu_scl,
// LEDs
};

In the repository directory, create a build directory, cd into it, run cmake and then make

mkdir build && cd build
cmake ../
make -j4

Before uploading the program to your Raspberry Pi Pico W, check for existing ACM terminals connected to the PC

ls /dev | grep ttyACM

Connect the cable connected to the Raspberry Pi Pico W while pressing the BOOTSEL button and release once connected

Mount the RPI-RP2 and copy the compiled .uf2 file from the build directory to the Raspberry Pi Pico W

udisksctl mount -b /dev/disk/by-label/RPI-RP2
cp pico_acc.uf2 /run/media/<USER>/RPI-RP2/

Reading output from serial port

Find the newly connected serial terminal

ls /dev | grep ttyACM

using minicom, connect to the serial terminal

sudo minicom -b 115200 -o -D /dev/ttyACMn

pico-shape-detection's People

Contributors

risb21 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.