Part 1: Variable Input and Output
For this part, I built a circuit using a slide potentiometer and a flex sensor, which acted as a variable resistor for the circuit. The two LEDs were controlled by the varying analog inputs from the potentiometer and the flex sensor. The analog inputs were wired independently from the LEDs (See Fig1.1), and all communication between the two boards was done through the Arduino.
Initially, the potentiometer was creating weird values. After some troubleshooting with Nate and Arielle, I realized that there was a pulldown resistor was messing up the values, because the potentiometer didn’t need any extra resistance. The flex sensor; however, benefitted from the pulldown resister. I had to map the flex sensors values from around 40-350 to 0-255, so most of the full range of the LED’s brightness was being used. For the potentiometer, I divided the analog input (ranging from 0-1020) by 4 to create an analog output of 0-255.
Part Two: Tone Output
This part of the lab created a tone output on a small speaker that reacted to changing resistance in the photo cells. Again, all communication to the speaker was done through the Arduino. The changing voltage through the photocells was measured by the Arduino as an analog input, and converted into a tone in Hz for the speaker to output. The speaker and the photocells were not necessarily in the same circuit. Arduino was required for the two parts to communicate. (See Fig2.1)
In my lab, both part one and part two were wired to the same breadboard. They worked independently but simultaneously. I never had any issues with power or breadboard space, because both parts were relatively simple for the Arduino to handle. They didn’t draw enough power to cause issues with each other. The code for part one and two was identical, just because I built on top of Part One to create Part Two.
Part Three: Laser Cut Box
The material I chose to use for my enclosure was MDF, or medium density fiberboard. I bought a 2’x 2′ panel at home depot, and had it cut down to 1′ x 2′. I created the plans for the laser cutter in Adobe Illustrator with the help of MakerCase, www.makercase.com. The plans are displayed in Fig 3.1
The large circle in the middle is made to house the speaker, and the “slit” is covered up with paper, and LEDs are placed inside to give the box an illuminated display of sorts. The two tiny cuts on top are to house the photocells that provide user input for the speaker and LEDs. Although the speaker’s cuts almost intersect with the cuts of the edge of the box, the whole thing is pretty structurally sound, even though that part did break into two separate siding pieces.
I wanted the device to be thin and sleek overall, so I compromised a bit on durability. I intended the device to stand upright with the speaker on the bottom, but to make it as thin as I wanted it, the components would have to be smooshed in there (unless I wanted to secure them to the side of the wall, which I didn’t necessarily want to do.)
The final product consisted of tones reacting to changing levels of light (similar to Part 2 of the lab), with NeoPixels registering the changes in light in varying degrees of blue-ness and green-ness. I used the NeoPixel library for the first time, which was a bit of a learning curve because I never realized that NeoPixel was case sensitive, and I spent about a half hour uninstalling and re-installing the library before I realized it was just case sensitive. After I figured that out, the coding was simple to make the LEDs reactive to the photocells.
The final product was a box that displayed as well as sounded out the different levels of light received from the photocell. It was interesting to play with the different tones and lighting scenarios. Photocells aren’t typically used as a means of controlling tone or volume because they’re difficult to calibrate and their sensitivity is often not easy to control, so it was an interesting interaction.