/ Concept. 1. Design Phase. 2. Circuit Design. 3. Board Production. 4. Programming the Board. 5. Reading the Data. /// Download Files.

Input Devices.

Concept.

For this session, the concept is to explore some sensor devices in order to get some input data as a result.

My interest is behind tangible devices and how touch can influence/trigger other systems. For this purpose I decided to explore the capacitive touch sensor, which I intended to create on my own using the guidance and library of Capacitive Sensing Library.

Design Phase.

Using the breadboard, I built my circuit in order to test the capacitive sensor. For the input a flat piece of copper foil is used, which is sticked on a vinyl surface, as well as connected to the arduino input, by means of two resistors 1 Mega Ohm and 1 Kilo Ohm as suggested in the library description. Some personal experimentation also lead to this values, having previously teste 5 Mega Ohm - which resulted in too high threshold and 500 Kilo Ohm, which didn't provied an accurate output.

To get a sensible output and visual clue whether the sensor works as intended, an LED is connected and lights up according to the simple if rule of suprassing the desired threshhold.

Using the Capacitive Sensing Library, the code defines the Pin 4 as input for the sensor through the 1 Mega Ohm resistor and the Pin 9 as input through the 1 Kilo Ohm resistor. The rest of the code specifies the rule of the LED blinking having surpassed the 1000 threshold. It also prints out the values sensed using SerialPrint.

As a result, when the piece of coil is touched, the sensor triggers and lights up the LED and the values are displayed in the Serial Monitor.

The values differ depends how much of the capacitive foil is touched.

Circuit Design.

For the circuit design, Attiny85 board is used, as it perfectly suits the assignment having 3 pins for Analog I/Os and 2 pins for PWM. Having all the components at hand, the most crytical was to design a pad on which the finger will be placed.

To do this, a new components needs to be created in Eagle by going to project folder, selecting New > Library.

New package is then created.

We draw the shape of the packed, in this instance it is a pad in a shape of the finger, having two inputs.

We also make sure to draw the symbol for it.

After we need to connect the symbol with the package, having matched the I/Os.

Now we can finally use it, by looking for the component in the library.

Using this component, similar to the Electronics Design week, we create the Schematic.

And the board layout.

Board Production.

The design is ran through the fabmodules.

The board is produced.

The components are soldered to the board.

Programming the Board.

The board is connected through the SPI and the board is flashed first.

It is crytical to change the input pins of the board, in order to have the right pins directing the signal. As a result, playing a bit with the threshold and lowering it all the way to 400, the board lights up the LED.

Trying to read the data using SPI from the board was a bit tricky, for that SOftwareSerial is used. Some changes are picked up by the Serial Monitor, however instead of having values, some funny characters are displayed.

Reading the Data.

Reading the data by having an Arduino board as an intermediate device did not work well. This time we connect the board by using an FTDI cable, by reading the TX pin. This is achieved by enabling the RX pin to be 1 pin of MCU and TX pin to be 0 pin of MCU in the Arduino code. As a result we connect the board in the similar fashion, by connecting the MOSI pin to the RX pin of FTDI.

By enabling the Serial Monitor of the Arduino IDE, we can receive the data as a result.

Download Files.
  • capacitive_sensor_v3.ino Arduino Code
  • touch_sensor.sch Eagle Schematic File
  • touch_sensor.brd Eagle Board File