Download presentation
Presentation is loading. Please wait.
Published byTodd Barber Modified over 9 years ago
1
Working with Arduino: Lesson #3: Force Sensitive Resistors EGN1007
2
Learning Goals Learning Goals: The student will be able to: 1.Build a complete circuit using the Arduino microprocessor 2.Identify important electrical components in a circuit and explain their use 3.Identify and apply specific elements in “C” code used to run a program in conjunction with how a circuit is built
3
Force Sensitive resistors The schematic symbol is that of a regular resistor with an arrow through it. And “f” net to the arrow is indicative of FORCE. An FSR is identical to a potentiometer, except rather that varying its resistance relative to shaft position its resistance varies with pressure. A force sensing resistor is made up of two parts. The first is a resistive material applied to a film. The second is a set of digitating contacts applied to another film. The figure shows this configuration. The resistive material serves to make an electrical path between the two sets of conductors on the other film. When a force is applied to this sensor, a better connection is made between the contacts, hence the conductivity is increased.
4
Let’s Begin 1.Place FSR on G5 & G6 2.Run a red wire from the 5V on the Arduino to H5. This will supply the FSR with 5V. 3.Run a wire from Analog 2 to H6. 4.Place a 10K resistor(Br-BL-O) in I6 and I12. 5.Place the LED on G15 and G16 with the longer lead(+) of the LED in G15. 6.Place a 560 resistor on H16 and H22. Notice that both the resistor and LED share row 16 7.Run a red wire from Digital 9 port on Arduino to H15. 8.Run a black wire from H22 to the ground(GND). 9.Run a black wire from H12 to I22.
5
Programming our sketch Let’s define 2 variables as integers. These will tell us which ports our LED and FSR are in.
6
Programming our sketch Just like before we need to set our LED as an output. We have a new piece of code here: Serial.begin ( ) Sets the data rate in bits per second (baud) for serial data transmission. So basically we are going to transfer 9600 bits per second to the computer. Old modems attached to our phone lines used to work at this speed. This was considered FAST back in the day, until 14400 finally came out.
7
Programming our sketch We begin by creating a variable called “value” which will read the value on the FSR and divide it by 4. This will then be written to the LED and ALSO sent as a piece of data and displayed in a Debugger Window. When “println” is used after the Serial command it takes the reading from the FSR and displays it in a window(debugger) for inspection. Compile, download, and test. Does the LED light up.
8
Your turn! Using what you have learned in this lesson AND the last lesson, write a short program that is BETTER than the one we wrote. Hint: Use the debugger to get the values you need and use information previously learned. The response from the LED should be a bit smoother. Write your code on the lesson worksheet and explain your code.
9
Challenge Can you write a program that lights more than one LED using the FSR so that they light in a sequence or other pattern? Write your code on the lesson worksheet and explain your code.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.