My first week back to physical computing, and I already spent most my time troubleshooting and having nothing work!
For small projects in this class, I plan on having some fun with microcontrollers and sensors. My first idea has been about shaming people in bathrooms who don’t wash their hands (it’s way more of a problem here than back home). So, I got a laser break beam sensor to at some point stick in front of a urinal (and sink) to see if people are there.
I think because of temperamental connections, I was hardly able to get accurate data. Only for two small instances in a couple of hours of trying to get it working was I able to get the data that I’m supposed to (digitalRead HIGH when the beam isn’t broken, and LOW when it is). I captured one of the instances on camera, though it’s blurry.
After not wanting to mess with that, I moved on to another idea. I wanted to make an annoying device for those people who find silence awkward. That person in class that when it gets quiet says ‘why did it get so quiet all of a sudden’. A microphone would be listening, and whenever the data level was below a certain level, a piezo speaker would spout out random notes at random intervals.
I didn’t know that the ATtiny85 can’t use tone that you would use in Arduino code, but there was a workaround using DigitalWrite HIGH and LOW. However the real issue was the mic getting levels, aggregating that after a certain amount of time, and determining if it’s quiet or not. It’s not real effective, but it works (sort of).
The connections were also really shoddy, and the ATtiny85 was really having trouble staying in the breadboard without popping up. Also, at some point when I went test my volume threshold, and tried to hook it back up to the Arduino to change it, I could no longer get it to work properly, and wasn’t able to fix. It’s likely a connection somewhere, but I couldn’t figure out where.
Anyways, here is a video of it working! I was near the ventilation in the shop, which was loud, and it didn’t go off.