Input Devices

This week is all about reading various sensors. I will work with the volume control of my speaker. I want the interface of the speaker as simple as possible. It should therefore only be possible to turn on and off the speaker and turn up and down the sound. I can use different types of sensors, but will this week try to make two simple captive sensors. This I can then use subsequently in the speaker design.

Designing the PCB

My starting point is the hello world board I have used before. I delete the button and LED and put instead a simple 2x2 pin header that I can connect to my sensors, which I will make of 2 pieces of copper vinyl. It is very difficult to place all the traces in eagle, so I had to use two jumpers. Board design can be found here.

After the board is milled out, and all the components are soldered on, the board looks like this.

The Sensors

My sensors are two pieces of copper vinyl, with a wire soldered on they can be connected to my board. In the picture below, it can be seen that I have made the sensor triangular and placed them in opposite directions so you can touch them both with one finger. The idea is that, by moving the finger to different positions I can generate signals by looking at the difference in step response between the 2 electrodes which indicates the direction of movement of the finger. In theory, it would be possible to make a smarter volume control using this method. I will aim to explore this further.

The Code

To program the input device I took the starting point of Neils Gershenfelds code, and make a few changes to suit my board. For example I used a ATtiny44 instead of ATtiny45. I start with a code to test if my sensors work (which they did). I modified the code to change the pin-number, so I can test both sensors individually. The code and the board layout can be downloaded here.

I get a good reading of the sensors, there is a clear change in value indicating that the electrode had been touched. I look forward to implementing this device in my speaker volume control system.