Ardusat Space Kits in the Classroom
Resources
Why Arduino platform?
Real-world STEM application
Space Kit contents
Let s get started!!
Activity1BasicBlink & Activity2MorseCode
Activity3LuminTSL2561
Activity4A_TMP102
Activity4B_TMP102
Activity5GyroAccel9DOF
1 CA STEM Symposium October 30, 2015, Anaheim Convention Center Ardusat Space Kits in the Classroom Getting Acquainted with Arduino IDE & Sensors Hardware/Software Setup: Go to codebender.cc on Chrome browser (online code editor and Arduino IDE), this eliminates need to download and install Arduino software (perfect for Chromebooks) Login: TBA Password: TBA Connect Arduino UNO to computer/chromebook using USB cable Activity1BasicBlink 1. Insert one green (or red) LED into Arduino UNO with long leg in pin 13 and short leg in GND as seen in the picture below. 2. Open sketch called Activity1BasicBlink located in codebender dashboard by clicking on it. Read the lines of code in this sketch. 3. Upload sketch to Arduino UNO by pressing [Run on Arduino] button. Observe how LED turns on for 1 sec and off for 1 sec as specified in the code.
2 4. In the sketch change the value of the two delay( ) functions to make the LED blink as indicated in the chart below. Upload the sketch by pressing [Run on Arduino] button and observe the LED. Complete chart below. (NOTE: 1000 means 1000 millisecond or 1 second) Pattern of blinking Delay values Describe in words how blinking differs from default. On for 1 sec, Off for 1sec (default) On for 0.5 sec, Off for 0.5 sec On for 2 sec, Off for 0.2 sec On for 0.6 sec, Off for 1.8 sec On for 1 sec, Off for sec delay(1000), delay(1000) Not applicable Make LED appear to be continuously on but it s actually blinking at too fast a rate for our eyes to detect
3 Activity2MorseCode 1. Insert one green (or red) LED into Arduino UNO with long leg in pin 13 and short leg in GND as seen in the picture below. 2. Go back to codebender dashboard by clicking the codebender logo at the top left. Open sketch called Activity2MorseCode located in codebender dashboard by clicking on it. 3. Upload sketch to Arduino UNO by pressing [Run on Arduino] button. 4. Open serial monitor window by clicking [Serial Monitor] button located at top right. 5. Click [Connect] in the serial monitor window and select [Newline] from drop down menu. 6. Type a character in the blank text box and hit Send. Observe the LED flash the Morse code for that character, and also displays it in the serial monitor window. Refer to MORSE CODE CHART given below.
4 7. Type a 2 letter word in the serial monitor window and hit Send, have your group members guess your word by decoding the flashing LED using the MORSE CODE CHART (below), each person takes turns typing a word. LED flashing pattern use dots/dashes for short/long like MORSE CODE CHART given 2 letter word guess Did you guess the right word? MORSE CODE CHART 8. Now type a 2 digit number in the serial monitor window and hit Send, have your group members guess your number by decoding the flashing LED using the MORSE CODE CHART, each person takes turns typing a number. LED flashing pattern use dots/dashes for short/long like MORSE CODE CHART 2 digit number guess Did you guess the right number?
5 Activity3LuminTSL2561 1. Wire up the TSL2561 Luminosity Sensor to the breadboard and Arduino as shown in the picture below or follow this chart. Arduino > GND (black wire) > Luminosity Sensor TSL2561 GND 3.3V (red wire) > VCC A5 (green wire) > SCL A4 (blue wire) > SDA 2. Go back to codebender dashboard by clicking the codebender logo at the top left. Open sketch called Activity3LuminTSL2561 located in codebender dashboard by clicking on it. 3. If not already done, change the delay( ) value from 250 (0.25sec) to 1000 (1sec) in the very last line of code line #137. 4. Upload sketch to Arduino UNO by pressing [Run on Arduino] button. 5. Open serial monitor window by clicking [Serial Monitor] button and click [Connect] to see the lux being recorded.
6 6. Record the lux under different conditions in this chart. Lux values fluctuate easily so record the median number. Condition Lux Room lights on as normal Hand covering sensor Flashlight pointing 90 degree straight down on sensor Flashlight pointing at 45 degree angle down on sensor Room lights off
7 Activity4A_TMP102 1. Using the jumper wires, wire up the TMP102 Temperature Sensor to the breadboard and Arduino as shown in the picture below or follow this chart. Arduino > GND (black wire) > Temp Sensor TMP102 GND 3.3V (red wire) > VCC A5 (green wire) > SCL A4 (blue wire) > SDA GND (black wire) > ADD0 2. Go back to codebender dashboard by clicking the codebender logo at the top left. Open sketch called Activity4A_TMP102 located in codebender dashboard by clicking on it. 3. Upload sketch to Arduino UNO by pressing [Run on Arduino] button.
8 4. Open serial monitor window and click [Connect] to see the temperature being recorded, record the temperatures under different conditions in the chart. Wait for temp to stabilize for 5 straight readings. Action Temperature Celsius Nothing baseline temperature in room Breathe on the sensor with your breath (highest temp reached) Place index finger on sensor Place entire palm of hand on sensor Place hot or cold pack near sensor (if available)
9 Activity 4B_TMP102 1. With the Temp Sensor TMP102 already wired up, insert one green (or red) LED into Arduino UNO with long leg in pin 13 and short leg in GND 2. Go back to codebender dashboard by clicking the codebender logo at the top left. Open sketch called Activity4B_TMP102 located in codebender dashboard by clicking on it. 3. Look at the code lines 23 30. What will happen when the temperature is greater than 85 F? (circle one) a. LED will turn off b. LED will flash c. LED will turn on d. none of these 4. Upload sketch to Arduino UNO by pressing [Run on Arduino] button. 5. Open serial monitor window, then click [Connect] to see temperatures being recorded. Warm up your hands and touch sensor to make the temperature go above 85 F. What happens to LED? (circle one) a. LED turns off b. LED flashes c. LED turns on d. LED explodes 6. Make one modification to the code to make the LED turn on when the temperature is below 85 F and turn off when above 85 F. Test it out by uploading your modified code by pressing [Run on Arduino] button. Does it behave as expected? What modification was made? 7. Put the code back to its original state. Make a second different modification to the code to make the LED turn on when the temperature is below 85 F and turn off when above 85 F. Test it out by uploading your modified code by pressing [Run on Arduino] button. Does it behave as expected? What modification was made this time? 8. Put code back to its original state. Add lines of code to the original code to make the LED blink when the temperature is greater than 85 F and turn off when below 85 F. (HINT: Refer back to sketch Activity1BasicBlink) Did it work? What had to be done to the code? Write the new lines of code you added here.
10 If it didn t work, open sketch called Activity4B_TMP102withBlink and run it. THIS PAGE INTENTIONALLY LEFT BLANK
11 Activity5GyroAccel9DOF 1. Wire up the 9DOF sensor to the breadboard and Arduino as shown in the picture. 2. Go back to codebender dashboard by clicking the codebender logo at the top left. Open sketch called Activity5GyroAccel9DOF located in codebender dashboard by clicking on it. 3. Upload sketch to Arduino UNO by pressing [Run on Arduino] button. 4. Open serial monitor window by clicking [Serial Monitor] button, set baud rate to 115200 (instead of usual 9600), and click [Connect] to see the data being recorded. 5. Make the following movements to the sensor by moving the breadboard, which type of motion gets affected the most? Action Which type of motion is affected most? (roll, pitch, or heading) Rotating the sensor in a circular motion when it s resting flat on the table Tilting one short side of sensor up at an angle while the opposite end stays on table Tilting one long side of sensor up at an angle while the
12 other side stays on table THIS PAGE INTENTIONALLY LEFT BLANK
13 Workshop Feedback Survey: http://goo.gl/forms/w7zpfucbwg (case sensitive) Self Test 1. A written piece of code in Arduino IDE is called a. 2. Different sensors collect real time or delayed (circle one) data when they are connected to an Arduino and programmed with a piece of code. 3. The window allows data collected to be seen directly in real time, it also allows the user to determine if the code is working. 4. The time interval at which each data point is recorded is controlled by using the function. 5. When an airplane is taking off from the ground, pitch or roll (circle one) is the type of motion that is most affected. 6. When an airplane makes a U turn in mid air, pitch or roll (circle one) is the type of motion that is most affected. 7. Rate your knowledge and understanding of Arduino and sensors before doing this activity: 0 1 2 3 4 5 8. Rate your knowledge and understanding of Arduino and sensors AFTER doing this activity: 0 1 2 3 4 5 9. Propose one useful real life application for any of the sensors used in these activities.