Learning in the MakerSpace: Arduino, Day 2 (AM)

Project 5: Mood Cue

I am now getting extremely frustrated with the poor quality of this kit. This project involves attaching a potentiometer (knob) and a servo motor. The potentiometer doesn’t fit on the breadboard as illustrated in the instructions. After searching through many forums, I found a solution that involved turning the potentiometer sideways and bending out one of the pins. This allowed it to fit and work as intended.

The code for this project was fairly easy to follow. The trick to this code was the map() function which scaled down the potentiometer values to angles between 0 and 179 degrees, which is the limit of the servo motor.


Project 6: Light Theremin

Finally we get to some music! And thankfully, this project worked the first time through! This was a much simpler project to wire than the previous ones. The only components were a piezo and a phototransistor. After uploading the code, the piezo makes sound based on the amount of light that the phototransistor detects.

The first part of the code tells the Arduino to calibrate. It establishes maximum and minimum light levels and creates a 5 second window for the user to move his or her hand over the phototransistor to set the actual limits of light. After that calibration phase, the Arduino maps the light levels to frequency.


Project 7: Keyboard Instrument

Again, the music project works out pretty well. This project used four buttons along with the piezo. Each button outputs a voltage that the code maps to an array of pitches. I had to go into the code and make an adjustment to the first button (mapped to middle C) because it was giving a different reading than what the book listed. I was able to use the Serial Monitor to see the value provided by the button and changed the code to accept a range instead of a specific value.


Leave a Reply

Your email address will not be published. Required fields are marked *