CE432-1 Robotics II 2021
Fall
Lab 6
Name: Mychael Garcia Email:
mhgarcia@fortlewis.edu
Materials:
Arduino UNO 2X
Analog Joystick
Open-Smart 2.4 GHz transceiver
USB data/power cabel
Breadboard
Jumperwires (M to M, M to F)
NEMA17 stepper motor
A4988 Motor controler
HC-SR04 ultrasonic module
MPU6050 a three-axis accelerometer and gyroscope
Rotary encoder
Sensors and Actuators: For this project
we were given multiple sensors/sinarios and tasked with using an
Arduino UNO to control and get readings from them. The first one was to
create an ultrasonic distance measuring device. Second was to create a
simple pulse detector, the arduino would recive a signal and repete the
signal a given taime later. Third, was to use a gyroscope and buzzer to
create a vibration detector. Fourth was using the wireless signal
transducers, joystic, and stepper motor to control the speed of the
motors rotation. Lastly, we were given a rotary encoder and devolped a
code that could determin which way the nob was rotating.
Task 1: For
this task we need to explain the benifits of a full-bridge strain gauge
and how the sensitivity changes between a quarter-bridge, half-bridge,
and full-bridge.
Task 2: Using
the Arduino UNO and a HC-SR04 ultrasonic module we created a device
that could measure distances in inches and centimeters and print them
to the serial monitor.
Task 3: For this task we developed a simple pulse detector. The Arduino would recivea
5V pulse from a signal generator and would wait 800us to send a
response that would last for 400us. This was varified using an
oscilloscope to record the original functions input and the Arduinos
response.
Task 4: This
task required the use of an MPU6050, a three-axis accelerometer and
three-axis gyroscope. The MPU6050 was set up to react to small
vibrations, this would be caused by someone hitting the tabel it was
currently sitting on. If this change exceeded a threshold the attached
Arduino would send a signal out to a small buzzer which was used as an
audible sound for the triggered event.
Task 5: For
the final task we gave the Arduino that was reciveng the information an
additional task, to control the direction and speed of a stepper motor.
This was done by the use of a simple if statement, if the recived value
was a given amount away from the joysticks idel state (arround 500) the
motor would turn in a given direction. As the value got further away
from this state (closer to 0 or 1023) the rotational speed would
increase.
Task 6: For
the final task we were to use a simple rotary encoder and devope a code
that could determine if the dial was spinning clockwise or
counterclockwise and count the ticks/rotation steps. For every
rotation, the output would be displayed to the serial monitor. Using
this you could keep track of how far the dial has been turned past its
initial location and how many complete rotations it has completed.
Conclusion: This
tutorial was very good in understanding how some simple sensors
work/opperate and how to code them in. Using the stepper motor
the only issue I had was figuring out a way to make the joystics movemt
corespond to a speed. I solved this by using two functions, (one for
clockwise and one for counter clockwise) delay=-7*joystick_input+7950,
delay=-7.5*joystic_input+590. These functions would output a number
that would work as the delay time between stepper motor steps/pulses. ---------------------------------------------------------------------------------------------------- END