![](images/banner.jpg)
Week 9 Input Devices
Last week we programmmed the Helloboard, we were very limited in what we could do on the hello world board with a 14 legs attiny 44, especially if we want to work with various sensors. The hello world board still requires an ISP even after burn bootloader. It also has limited pin headers for connecting sensor boards.
This week we will try different sensors with Arduino UNO.
The goal of this week is to design a microcontroller board, add a sensor to it and read it. The board would need to be able to read sensor inputs, and eventually turning inputs into outputs.
Weekly Assignment
- Individual assignment: measure something: add a sensor to a microcontroller board that you have designed and read it
- Group assignment: probe an input device’s analog levels and digital signals. 、
Arduino Board
Two common arduino UNO:
![](images/week09/03.png)
![](images/week09/study_arduino_uno.jpg)
You can use arduino board to connect sensors and actuators
![](images/week09/05.jpeg)
![](images/week09/04.jpeg)
Final project input : Force Sensing Resistor (FSR)
FSRs are super robust pressure sensors that are used in all kinds of industries. You will find them in electronic drums, mobile phones, handheld gaming devices and many more portable electronics. These sensors are easy to use and great for sensing pressure.
The resistance of an FSR depends on the pressure that is applied to the sensing area. The more pressure you apply, the lower the resistance. The resistance range is actually quite large: > 10 MΩ (no pressure) to ~ 200 Ω (max pressure). Most FSRs can sense force in the range of 100 g to 10 kg.
![](images/week09/01.png)
An FSR consists of two membranes and a spacer adhesive. The conducting membranes are separated by a thin air gap when no pressure is applied. One of the membranes contains two traces running from the tail to the sensing area (the round part). These traces are woven together, but not touching. The other membrane is coated with a conducting ink. When you push on the sensor, the ink shorts the two traces together with a resistance that depends on the pressure.
![](images/week09/02.png)
Voltage divider circuit
In order to measure the applied force with an Arduino, I need to build a voltage divider circuit with the FSR and a pull-down resistor. This circuit creates a variable voltage output that can be read by the ADC (analog to digital converter) input of the microcontroller.
![](images/week09/Voltage-divider-circuit-Interlink-FSR-402.png)
Design PCB for my final project:
For my final project I need to have 3 buttons and one force resistor as input, bluetooth as output. So I draw the schematic on paper first
![](images/week09/06.jpeg)
Then I draw it on Eagle. Make sure it has enough pins for buttons, FTDI, bluetooth.
![](images/week09/Gino2.jpeg)
![](images/week09/gino1.jpeg)
Then I make the milling trace for GINO board.
![](images/week09/fpattiny-traces.png)
![](images/week09/fpattiny-outline.png)
![](images/week09/fpattiny-holes.png)
I use fab mudule to creat path for CNC. The setting is below.
![](images/week09/milling.png)
![](images/week09/milling2.png)
I also make a board for force resistor and then milling it.
![](images/week09/WechatIMG14的副本.jpeg)
![](images/week09/freagle.png)
![](images/week09/frtrace的副本.png)
![](images/week09/frtrace2的副本.png)
![](images/week09/frholes的副本.png)
Final project board:
![](images/week09/WechatIMG12的副本.jpeg)
![](images/week09/WechatIMG15的副本.jpeg)
1 Try the force resitor with leds.
![](images/week09/test.jpeg)
Code is below:
![](images/week09/ledtest1.png)
![](images/week09/ledtest2.jpeg)
![](images/week09/test.jpeg)
Try to use with buttons with force resistor. The code is below:
![](images/week09/test2.jpeg)
![](images/week09/buttonnoblue1.jpeg)
![](images/week09/buttonnoblue2.jpeg)
![](images/week09/buttonnoblue3.jpeg)
Test video:
Download Link:
- Download code code for this week.
- Download code Nano Radar
- Download code Final board