Make the speaker work with the Arduino and produce a tone.
Before heading into this lab I knew I wanted to incorporate it into my fabrication assignment, which is to make an enclosure and have some electronics in it. First I had to complete the lab and understand how FSRs interacted with the speaker.
I connected everything based on this image:
Right off the bat I had some problems. First, I had a vague understanding of what I am doing. Second, the Force Sensing Resistors (FSR) gave me crazy values like -151 and 2566. Finally, no tone was being produced even though I copied the code from the lab. I wasn’t sure what was wrong, but I knew that something was. So I tested.
- Speaker on its own worked, so it wasn’t the speaker.
- FSRs worked, but produced odd values.
- When put together (with the code pulled from the lab) they didn’t produce a tone.
- By using a multimeter I realized that my FSRs weren’t receiving any power.
I connected the wires from 3.3V pin on the analog side of the nano and the ground pin to their appropriate destinations and my FSRs were finally receiving power.
The next problem I encountered was a coding one and for this one I needed Tom’s help. I booked office hours, recommend this to everyone btw, and got answers to my questions. It was with Tom’s help that I was able to comfortably draw the schematic above. Schematics are important and recognizing that is game changing.
The next step
Now that I had completed the lab, I wanted to proceed a little into fabrication. I want to stick the nano into a coffee can from Trader Joe’s and make it play the Nokia tune with a push of a button. I got the Nokia tune to play with the help of targate, but I still need to figure out the code for buttonState, so that I can use a button to play the tune.
I can feel my confidence slowly growing in terms of knowing some of the pins and connecting everything faster than before. I have a lot to learn more, a colossal amount.