Arduino Project 13

pdf

School

Utah State University *

*We aren’t endorsed by this school

Course

TEE2300

Subject

Mechanical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

3

Uploaded by ah751

Report
Amelia Herrick TEE 2300-IO1 Fall 2022 Professor Trevor Robinson Arduino Project 13 - Touchy- Feely Lamp Abstract: The goal of this lab was to introduce the capacitive sensor library, as well the different ways you can incorporate other libraries as well. It is supposed to build off projects 1, 2, and 5 and introduce conductive and non-conductive materials. Materials needed: 1. Five jumper wires 2. One LED 3. One 1 megohm Resistor 4. One 220 ohm resistor 5. Metal foil Procedure: First plug in your jumper wire to ground onto the breadboard, then insert an LED and connect the cathode to ground using a 220 ohm resistor, and the anode to digital pin 12. Then take a megohm resistor and connect one side to pin and one side to pin 4. On the other side of the resistor, opposite to pin 4, connect a long jumper wire. After this upload the code below to your arduino board, when you touch the end of the long jumper wire it should light up, and when you connect it to your metal foil and touch the foil with you finger, the LED should also light up then. #include < CapacitiveSensor .h> CapacitiveSensor capSensor = CapacitiveSensor(4,2); int threshold = 1000; const int ledPin = 12; void setup() { Serial .begin(9600); pinMode(ledPin, OUTPUT); } void loop() { long sensorValue = capSensor.capacitiveSensor(30); Serial .println(sensorValue); if (sensorValue > threshold) { digitalWrite(ledPin, HIGH);} else { digitalWrite(ledPin, LOW);} delay(10);}
Discussion: 1. List three different materials of each a conductor and an insulator. Conductor: aluminum, silver, copper Insulator: wood, glass, rubber 2. What can cause the capacitance/sensor value to increase or decrease in this lab? The conductor that we use or the resistors changing value. The program could also effect it. 3. You probably noticed that the values from the sensor changed depending on how much of your finger was touching the conductor. Can you use this to get other interactions with the LED? Explain. Yes, you can make it go on and off as much as you want, so if you wanted to create a light show you could. You could also use it to dim or brighten a light for a certain setting. 4. If you place a different value resistor between pins 2 and 4 it will change the sensitivity? Try it, explain your results. I used a lesser resistor and there was an obvious change, it was a lot easier to show the back and forth. 5. Capacitance can be measured through non-conductive materials like wood and plastic. Why can capacitance still be measured through these materials? Using this knowledge, how can this lab be expanded into something practical in your home? Electricity can still travel through these materials; it's just met with a lot more resistance. I can use it to for having light switches automatically come on when you enter the room by something in the floor. 6. How does a third party library work compared to an Arduino library? What is the same what is different? It essentially works in the same way, you just have to make sure it’s uploaded. It helps us not have to write as much programming. Troubleshooting: This lab setup was super easy, not a lot of issues with the circuit specifically. I did have some issues with uploading the library. The library that I had downloaded interfered with something else that my brother was working on with my computer so every time I tried to upload the programming it would say ‘Error: Teensy board required’ I eventually got sick of it and deleted
arduino and all the files related to the teensy board and then redownloaded and it worked perfectly from there. Conclusion: For this lab we learned about downloading a non native library, and how to include that library as well as manage the other ones. We also learned a lot about the conducive and insulator materials and how well electricity follows through each of them. Overall, pretty interesting circuit and programming that will help build on the next one and hopefully help us with our final project.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help