Presentation is loading. Please wait.

Presentation is loading. Please wait.

Arduino Setup & Flexing the ExBow

Similar presentations


Presentation on theme: "Arduino Setup & Flexing the ExBow"— Presentation transcript:

1 Arduino Setup & Flexing the ExBow

2 Installing Software (USB Stick)
Install Arduino Install Ardublock duo

3 Blink Program Begin by setting up the circuit as shown to the right
The positive end (long leg) of the LED must be connected to the resistor The negative end (short leg) of the LED must be connected to ground Digital Pin 13 (D13) 1000 Ohm Resistor Long leg Short leg LED Ground

4 Physical Circuit

5 Code Initialize pin 13 as an output pin - we will output a signal to tell the LED what to do For us, wherever it says LED_BUILTIN write 13 Turn the LED on Turn the LED off

6 Completed Code For us, wherever it says LED_BUILTIN write 13

7 Output When you’re done, it should look like this

8 Voltage Divider “A simple circuit which turns a large voltage into a proportionally smaller one” By changing R1 and R2, we can make Vout be a fraction of Vin Try R1=1000 Ohms and R2=1000 Ohms What should you get? What about is R2 is really high? For the Exbow, R2 will be our “flex” sensor

9 Code

10 Output To see printed outputs, go to the Arduino Program and click on Tools > Serial Monitor (Text Display) or Serial Plotter (Plot Display) You should see one constant line The analog input 0-5V is converted to value

11 Voltage Divider with Flex
arduino---v32/experiment-9-using-a-flex-sensor Voltage Divider with Flex Now we integrate the flex sensor into the voltage divider circuit

12 Physical Circuit

13 Code

14 Output Use Serial Plotter
As you move the flex sensor back and forth you should see something to the right

15 Min - Max Function Range of outputs for person using the flex sensor differs Use a formula to find bounds Initiate high minimum and every time the flex sensor has a lower value, the minimum becomes that Initiate low maximum and every time the flex sensor has a higher value, the maximum becomes that

16 Code

17 Output As the flex value grows, so does the maximum
As the flex value shrinks, so does the minimum Blue = actual output red=max green = min Label axis

18 Finding the angle Now that we have the flex values and the range of values, we can convert them to angles Find the proportional value of the flex from the MAX and MIN and multiply by 180 deg Example:

19 Code The left side of the equation maps the Flex value to a value between a new range of 0 to 1 (min to max) The right side then multiplies that into an angle from 0 to 180

20 Output Use the Serial Monitor: Tools > Serial Monitor
As you move the flex sensor back and forth you should see something to the right yellow is the angle now

21 Servo Motor Sweep

22 Circuit

23 Code

24 Output Use the Serial Monitor: Tools > Serial Monitor
As the servo moves the arm back and forth you should see something to the right Try increasing the Max Angle to see how the arm moves

25 Putting it all together

26

27


Download ppt "Arduino Setup & Flexing the ExBow"

Similar presentations


Ads by Google