Wednesday 11/10
Kris Camp leads the BloxBots workshop!
Due: Monday, 11/15
You will use the skills from class to create your own WelcomeBot! Take what you've learned/made from the BloxBots Workshop and combine it with the Arduino Lab. Your WelcomeBot should be interactive and respond when someone comes close to it.
the input for the bot should use the distance sensor from the Arduino Lab
if you don't want to use the breadboard, ask Audrey for some jumper cables that can directly attach to the sensor
the output for the bot can be
LED(s)
[optional] other components - you can explore the other components that came in your Arduino kit or ask Audrey for other ideas
NOTE: because the distance sensor requires a 5V power source, you should use the Arduino Uno and not the SquareWear (which can only provide 3.3V)
Requirements
Document your process on your web site, including successes and failures encountered along the way. There should be:
pictures of your design and steps that you took when creating the project
the woodworking components of the bot "body"
a circuit sketch that shows how components are attached to pins on the Arduino "brain"
a final video or collection of photos that demonstrates the final product
a reflection on the project and how it relates to the topics of belongingness (which can intersect with self-efficacy, mindset and active listening)
you can choose to write the reflection (2-3 paragraphs) or record it as video/audio (1-3 minutes)
challenge yourself to step back and think about any parallels you can draw to your learning journey at large, using these prompts:
have there been courses or co-curricular activities that you have embraced or turned away from because you felt a stronger or weaker sense of belongingness?
looking back, did messages from the environment play a role?
if you were to revisit a decision to embrace or turn away from a course/activity, what would you tell your former self?
Try to make the code work on your own, but if it doesn't... this sketch will cause pin 13 to go HIGH when something is close to the distance sensor:
// set up the range finder, HC-SR04
int rangeTriggerPin = 2;
int rangeEchoPin = 3;
long currentDistance; // (cm)
int DISTANCE_THRESHOLD = 15;
int ledPin = 13;
/**
* initialization code, happens once
**/
void setup()
{
// for printing
Serial.begin( 9600 );
// set up the range finder
pinMode(rangeTriggerPin, OUTPUT);
pinMode(rangeEchoPin, INPUT);
pinMode( ledPin, OUTPUT );
}
/**
* loops after setup
**/
void loop()
{
// get current distance
currentDistance = senseCurrentDistance();
// print it out
Serial.println( currentDistance );
if ( currentDistance <= DISTANCE_THRESHOLD )
digitalWrite( ledPin, HIGH );
else
digitalWrite( ledPin, LOW );
// wait a little before next iteration
delay( 200 );
}
/**
* Use the range finder to determine distance to the
* closest object.
**/
long senseCurrentDistance()
{
// The PING is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(rangeTriggerPin, LOW);
delayMicroseconds(2);
digitalWrite(rangeTriggerPin, HIGH);
delayMicroseconds(5);
digitalWrite(rangeTriggerPin, LOW);
// A different pin is used to read the signal from the PING: a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
long duration = pulseIn(rangeEchoPin, HIGH);
return microsecondsToCentimeters( duration );
}
/**
* Determine the distance based on how long it took to echo back.
**/
long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}