CT262_FierroLab1

docx

School

MiraCosta College *

*We aren’t endorsed by this school

Course

250

Subject

Mechanical Engineering

Date

Apr 3, 2024

Type

docx

Pages

7

Uploaded by DeaconNewtMaster981

Report
Name: Jonathan Fierro GID: G00304033 Lab 1: Setting up the Arduino Grantham University Date: December 16, 2023
Introduction: This lab consisted of the initial set up and becoming familiar with the Arduino uno. In part a, the blink program will be loaded to the Arduino to control the built-in LED. In part b, the program will be modified to have the LED always on. Next, another modification such that the LED has a duty cycle of 40%. The multimeter will be used to measure the voltage across pin 13 and ground. Equipment/Components: Arduino Uno Digital Multimeter Arduino IDE Procedure: The initial blink program that will be loaded to the Arduino comes from the list of built in example in the Arduino IDE. This program is then modified for the desired output. It is expected that while the LED is on the measured voltage across pin 13 will be approx. 5 Volts and while the LED is off the measured voltage across pin 13 will be 0 Volts. Results/Analysis: Part 1a The following screenshot shows the blink program running on the Arduino:
Part 1b The following screenshot shows the blink program modified such that the onboard LED is always on: The following photo shows the Arduino running with the LED always on with the multimeter measuring the voltage across pin 13 and ground:
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
The measured voltage across pin 13 and ground was 5.04 Volts. To achieve a duty cycle of 40% over a 10 second period, the loop was modified as follows: void loop() { int on_time = 4; // 40% duty cycle int off_time = 6; digitalWrite(13, HIGH); delay(on_time * 1000); digitalWrite(13, LOW); delay(off_time * 1000); } The following screenshot shows the modified Arduino program with the LED having a 40% duty cycle:
The following photo shows the measured voltage across pin 13 and ground during the on portion of the duty cycle: As seen above, the measured voltage across pin 13 and ground during the on portion of the duty cycle was 5.08 Volts.
The following photo shows the measured voltage across pin 13 and ground during the off portion of the duty cycle: As seen above, the measured voltage across pin 13 and ground during the off portion of the duty cycle was 0.00 Volts. Conclusion/Discussion: After verifying the initial blink LED program would load and run on the Arduino, the loop needed to be modified such that the LED is always on. To accomplish this, all lines in the loop were commented out except for digitalwrite(LED_BUILTIN, HIGH); . With this being the only active line, the LED was always on. To achieve a 40% duty cycle, integers were declared for on and off time and assigned values of 4 and 6, respectively. The on and off integers are multiplied by 1000 in the delay functions to achieve the 40% duty cycle. When loaded to the Arduino it was verified that the LED was on for 4 seconds and off for 6 seconds. The measured voltage of pin 13 while the LED was on was approximately 5V, as this is the voltage the Arduino supplies to a HIGH pin. The measured voltage of pin 13 while the LED was off was 0V, as expected. Some features of the Keurig coffee maker that could be implemented with an Arduino very easily are listed below: 1. Power control: A relay can be connected to the Arduino to control the power supply to the coffee maker and can be interfaced with a switch.
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
2. Water level monitoring: A pressure sensor or a moisture sensor can be connected to the Arduino to sense when the water level gets low. An LED can also be connected and turned on when the level is low. 3. User interface: An LCD screen and buttons can be connected to display brewing size information and the buttons can be used for user input. Another project idea could be an automated plant watering system. The components needed for this would be a moisture sensor placed in the soil, a relay connected to a water pump, a water reservoir, and an Arduino for controlling. You could program the Arduino such that when the soil moisture reaches a certain point, it will trigger the relay switch to send power to the water pump. The water pump should only be activated for a few seconds. Then the Arduino should sit idle before attempting to read the moisture sensor again as it will take a few seconds for the water to soak in. References: Blum, J. (2013). Exploring Arduino: Tools and Techniques for Engineering Wizardry.