Objective: Use the sound classifier model from ml5.js to control a 7 segment LED display connected to an Arduino Uno
To bring hardware and p5.js together, I first focused on building my circuit. I found this reference diagram below and used it to connect my LED display model # 350074.
Next, I worked on writing my Arduino code to light up the appropriate segments that correspond to each number. I used the following image as a reference to label my pins accordingly. The model of LED I used followed the format on the left.
In p5.js web editor, I established the serial port communication and loaded the sound classifier model from ml5.js with the preset dataset ‘SpeechCommands18w’. Using p5 serial control, my 2 devices began to communicate and the following project was born! You can say any digit from 0-9 and the digit will be shown on the LED display. Any label from the machine learning model that is not a digit between 0-9 will cause the display to turn off.