I/O Device Assignment

Come up with a simple application using digital and/or analog input and output to a microcontroller. Make a device that allows a person to control light, sound, or movement using the components you've learned about (e.g. LEDs, speakers, servomotors).

Come up with a plan, include a system diagram and a schematic drawing of the circuit. Get the circuit and programming working first, then think about a housing for it. This shouldn't be a highly polished device. If you have the time and resources, try to give it a housing of some sort. Cardboard or plastic boxes can work well for this. If not, breadboard prototype is perfectly good too. Some of these videos on prototyping may be helpful.

A musical instrument

A simple musical instrument that functions similar to a piano. Plan to use eight input buttons corresponding to eight pitches. Each time you press a pushbutton, the speaker will output a pitch; release the button, the sound will continue; long press any button, the sound will stop. After attempts, I changed the plan and added one more button to stop the sound/a potentiometer to control the volume of the sound.

System diagram

Schematic diagram

Device prototype

Program the Arduino

The 1st attempt — Implemented basic functions. Press eight buttons, the speaker will output eight corresponding pitches. Release the button, the sound will continue.

The 2nd attempt — Failed to implement the operation of long-pressing any button to stop the sound. Changed the plan and added one more button to stop the sound/a potentiometer to control the volume of the sound. Try the Sensor Change Detection Lab

Demo

🎵 Click me to watch the demo

Previous
Previous

Serial Labs

Next
Next

Digital + Analog Labs