ECT 363 Project 1
Dr. Alaa Al Ghazo Samuel I. Ward Department of Electrical and Computer Engineering
What you should submit:
1. Lab Report which will consist of following components (by Tuesday 3/24/2020 ) a) Introduction: Present overall goal of project b) Techniques: Describe all skills and knowledges which are used for each problems (for example, introduce and
explain variables, operations, logics and functions which you used) c) Experiment: Include all the working code and put comments for important lines – Explain your algorithms d) Conclusion: Describe what you learned from project 1
2. Demonstration of the Completed Code (before end of class hours of Tuesday 3/24/2020 )
Problem 1: This is for Warming-up of Arduino Project. Finish all activities below!
o Set up your Arduino LED circuit and run the Blink program => Verify that everything works correctly and the LED blinks on for 1 second and off for 1 second.
o Challenge #1: Blink with a 20 ms interval
o Challenge #2: Blink to mimic a heartbeat
o Challenge #3: Determine the fastest blink that the “Your Eye” can detect
o Challenge #4: Create a circuit and program to mimic a traffic light
1ST LED on for 3 seconds 2ND LED on for 1 second 3RD LED on for 5 seconds
Problem 2: This is for Digital input/output practice of Arduino Project. Finish all activities below!
o Set up your Arduino LED circuit and run the Button program 1. From File menu -> Examples -> 02.Digital -> Button 2. Verify that everything works correctly and the LED is on while the button is pushed and off when it is not
pushed.
o Challenge #1: Have the LED turn off while the button is pushed and on while the button is not pushed.
o Challenge #2: Have the button toggle the LED.
o Challenge #3: Have a LED1 turn on while the button is pushed and have a LED2 on while the button is not pushed.
o Challenge #4: Have the button toggle between LED1 and LED2.
Problem 3: Using a given DHT11 sensor, make a circuit and program which activates like below:
o Set up your Arduino with DHT11 Digital Temp/Humidity Sensor. 1. From lecture 7, follow the procedure which import DHT11 library 2. Run the given DHT11 sensor reading code with the imported library
o Challenge #1: Verify that everything works correctly and the Digital sensor is transmitting all the correct information.
o Challenge #2: Connect the 2nd Arduino board to the current Arduino board and establish communication between them (Serial, I2C and SPI). Then, transmit the sensed data to the 2nd Arduino.
o Challenge #3: Connect the switch and made the current Arduino board to transmit the sensed data to the 2nd Arduino board while the button is pushed on.
Problem 4: Using a PWM and Analog voltage reading capability of Arduino, make a circuit and program which activates like below:
o Set up your Arduino for Fading LED Project which is covered in Lecture 7 1. From Sensor-Actuator Ref file, copy the code from Fading LED sketch file. 2. Paste the code to the new sketch file and Run the PWM generating code
o Challenge #1: Verify that everything works correctly
o Challenge #2: Connect the PWM output to Analog input pin of Arduino (be careful!! See above link). Then, modify and run the Analog voltage reading code which is also covered in Lecture 7. Verify that the read value is corresponding to PWM signal which are generated from Fading LED code.
o Challenge #3: Connect the switch and made the PWM has a pre-determined duty cycle value which is 122 when the button is pushed on.
http://arduino.stackexchange.com/questions/10041/can-i-connect-a-pwm-pin-on-one-arduino-to-an-analog-input-on-another
Problem 1: Make a code which works like below:
• When, button is pushed on, return the distance value using ultrasonic sensor. • When, button is not pushed on, return the temperature value using the Analog Temperature sensor.
Using ultrasonic sensor, measure the sensitivity (of the sensor) which depends on material charateristics.
1) Place the 1st (white color) object in front of ultrasonic sensor with 4 different distances: 5cm, 10cm and 30cm and 1m.
2) Place the 1st (black color) object in front of ultrasonic sensor with 4 different distances: 5cm, 10cm and 30cm and 1m.
3) Place the 1st (reflective color) object in front of ultrasonic sensor with 4 different distances: 5cm, 10cm and 30cm and 1m.
How is result? Are they same? Or not?
Problem 2: First, read all materials below
A Servo Motor is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. If the coded signal changes, the angular position of the shaft changes. In practice, servos are used in radio-controlled airplanes to position control surfaces like the elevators and rudders. They are also used in radio-controlled cars, puppets, and of course, robots.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Servos are extremely useful in robotics. The motors are small, have built-in control circuitry, and are extremely powerful for their size. A standard servo such as the Futaba S-148 has 42 oz/inches of torque, which is strong for its size. It also draws power proportional to the mechanical load. A lightly loaded servo, therefore, does not consume much energy.
The guts of a servo motor is shown in the following picture. You can see the control circuitry, the motor, a set of gears, and the case. You can also see the 3 wires that connect to the outside world. One is for power (+5volts), ground, and the white wire is the control wire.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Working of a Servo Motor
The servo motor has some control circuits and a potentiometer (a variable resistor, aka pot) connected to the output shaft. In the picture above, the pot can be seen on the right side of the circuit board. This pot allows the control circuitry to monitor the current angle of the servo motor.
If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not correct, it will turn the motor until it is at a desired angle. The output shaft of the servo is capable of traveling somewhere around 180 degrees. Usually, it is somewhere in the 210-degree range, however, it varies depending on the manufacturer. A normal servo is used to control an angular motion of 0 to 180 degrees. It is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear.
The power applied to the motor is proportional to the distance it needs to travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small amount, the motor will run at a slower speed. This is called proportional control.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
How Do You Communicate the Angle at Which the Servo Should Turn?
The control wire is used to communicate the angle. The angle is determined by the duration of a pulse that is applied to the control wire. This is called Pulse Coded Modulation. The servo expects to see a pulse every 20 milliseconds (.02 seconds). The length of the pulse will determine how far the motor turns. A 1.5 millisecond pulse, for example, will make the motor turn to the 90-degree position (often called as the neutral position). If the pulse is shorter than 1.5 milliseconds, then the motor will turn the shaft closer to 0 degrees. If the pulse is longer than 1.5 milliseconds, the shaft turns closer to 180 degrees.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Components Required
You will need the following components − 1 × Arduino 1 × Servo Motor 1 × ULN2003 driving IC 1 × 10 KΩ Resistor
Procedure Follow the circuit diagram and make the connections as shown in the image given below.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Code to Note Servo motors have three terminals – power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino. The ground wire is typically black or brown and should be connected to one terminal of ULN2003 IC (10 -16). To protect your Arduino board from damage, you will need some driver IC to do that. Here we have used ULN2003 IC to drive the servo motor. The signal pin is typically yellow or orange and should be connected to Arduino pin number 9.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Connecting the Potentiometer
A voltage divider/potential divider are resistors in a series circuit that scale the output voltage to a particular ratio of the input voltage applied. Following is the circuit diagram −
Vout is the output potential, which depends on the applied input voltage (Vin) and resistors (R1 and R2) in the series. It means that the current flowing through R1 will also flow through R2 without being divided. In the above equation, as the value of R2 changes, the Vout scales accordingly with respect to the input voltage, Vin.
https://www.tutorialspoint.com/arduino/arduino_servo_motor.htm
Typically, a potentiometer is a potential divider, which can scale the output voltage of the circuit based on the value of the variable resistor, which is scaled using the knob. It has three pins: GND, Signal, and +5V as shown in the diagram below −
Result
By changing the pot’s NOP position, servo motor will change its angle.
http://playground.arduino.cc/Learning/SingleServoExample
Now your turn!!. Go to website below and implement each step (donot forget you are using NANO)
Problem 3: Lets make a sudo radar system. Lets assume that the ultrasonic sensor is attached to the top of servo Motor. Make a code which rotate from -179 to 179 degree (when initial position is 0) with 1 degree increment. At each increment, return the distance value (at this practice, lets use “randomly generated value” to emulate the radar system). When the motor reached to 179, it should go-back to -179 and repeat the all process above.
The post Lab Report which will consist of following components (by Tuesday 3/24/2020 ) a) Introduction: Present overall goal of project b) Techniques: Describe all skills and knowledges which are used for each problems (for example, introduce and explain variables, operations, logics and functions which you used) appeared first on Versed Writers.