Sound Classifier + Arduino

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.

Reference circuit from

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.

7-Segment LED display diagram

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s