Week 11: Input Devices
Tasks
- Probe an analog input device
- Probe a digital input device
Analog Input: Force Sensitive Resistor
A force sensnitive resistor is a device that producess a large resistance when not pressed and produces less and less resistance as mechanical pressure is applied. For this weeks group assignment, we will be observing it in action. A force sensitive resistor cant just be plugged into a microcontorller directly though, we need to add another resistor to create a voltage divider which will scale the 3.3 Volts coming from the Pico depending on the force being applied. Our circuit looks like this one below. One side of the resistor is connected to 3.3 volts. The other is then connected to ground with a 10 kohm resistor (we were too lazy to find a 10 kohm resistor so we used 2 5 kohms in series). We will probe the voltage between the resistor and the force resistor which is the green wire coming off the breadboard. And we are just using the pico to provide power.
And we probed the green wire with respect to ground and got the following graph on the scope:
We were suprised at how little force needed to be applied. If you were to hold a penny between your fingers vertically, the minimum amount of force you would need to pinch to keep it from slipping is how much force was applied to max out the voltage divider at 3.3 volts. We didn't know it could be this sensitive. And of course by changing the value of the other resistor, we can make this less sensitive and needing more force.
Digital Input: Button
This week we were goingto observe a button in action, but we were going to be searching for some bouncing. When you press a button it doesnt perfectly switch between on and off, it may bounce on and off a few times and you often need to add some debounce when using buttons and external interrupts. We grabbed one of the higher quality buttons we had that historically has produced a lot less bounce and wanted to gauge its bounciness.
To test this we wired up a button and enabled a pulldown resistor on the pico to prevent the button from floating. This was our circuit:
And on the scope we saw the button in action. But in the time scale we were viewing it, we couldn't see it as button bounce happend in the order of 10s of milliseconds.
So we change the time div to something a little more fine and after pressing it a few times we saw some button bounce. The following image is the 100 ms after releasing the button once. But this did take us a few tries to get this and the button was quite reliable - only bouncing about 10% - 15% of the time.