Input Devices

 
 

This week’s theme was input devices. In other words, what kind of sensors can we use to gather information from the outside world? You can measure light, temperature, sound, capacitance, sonar, vibration, force, acceleration, etc etc. For me, this was definitely the most exciting week so far.


I spent some time playing with Neil’s step response boards, which are great for homemade touch pads and pressure sensors. I considered making a love meter, but I think I’ll save that one for the application programming week ;)


What I ended up making was a foot-operated clicking device. I find that after working long hours on the computer, my right shoulder gets really tight from all the clickingl This is especially when working on a laptop - all that click-and-drag can really take its toll! Since most people are accustomed to using their arms in parallel with their right foot (from driving), it seems natural to include the foot in computer work as well.


A quick trip to the laser cutter resulted in this:




I used pyObjC to write a program that implements a mouse click every time the foot pedal is tapped. Here’s a video demo:




















Stuff I Learned

  1. -The ATTiny45 has a really inconsistent internal clock.

The first board I tried to build contained a microphone (I wanted to detect cat meows, but that’s for another day). When I tried to visualize the sounds it captured, however, I got really strange looking results and my computer kept on crashing. So, I reprogrammed the microcontroller to only print out 0’s, and read the results from serial using rx.py. What I saw was that, about 80% of the time, I was reading 128 instead of 0! In other words, the highest bit of the bytes I was reading were randomly flipped. I think this implied a timing issue, where the stop bits sent after each byte was sometimes mistakingly read as the first bit of the new byte?

At the end of the day, I swapped out the ATTiny45 and everything worked fine. In the process I learned all about the RS232 protocol and using an oscilloscope for debugging, so it wasn’t a waste of time at all!




 

I felt like a kid in a candy store.