Presentation is loading. Please wait.

Presentation is loading. Please wait.

Having fun with code, using Arduino in a middle school CS classroom

Similar presentations


Presentation on theme: "Having fun with code, using Arduino in a middle school CS classroom"— Presentation transcript:

1 Having fun with code, using Arduino in a middle school CS classroom
Michael Cappiello @MSTRCAP Hhselectronics.tumblr.com

2 What is an Arduino? Arduino is an open-source electronics platform based on easy-to-use hardware and software.  Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing. (n.d.). Retrieved April 24, 2017, from

3 Parts of the Arduino UNO R3

4 Models and Applications
All models have: Digital & Analog I/O pins. Regulated 3.3V and/or 5V. Solid state memory Onboard power LED. Can be programmed using Arduino IDE software. Arduino Model Comparisons

5 Shields Vs. Breakouts Breakout boards usually have a smaller form factor. Shields stack right on top of the Arduino using the existing form factor. Breakouts save space, but require a breadboard or additional wiring. Breakouts can be reused with other microcontrollers. Shields use the same voltages and I/O pins as the Arduino model they are designed to fit.

6 What will I need and Where Do I order it from?
Arduino Uno R3 (or compatible model) USB Cable Jumper wires Solderless Breadboard 6V-18V Battery Pack Various Electrical components (resistors, LED’s, etc.) Adafruit Sparkfun Electronic Express Amazon

7 Getting started Download and install Arduino IDE: Go to File>Examples>Basic>Blink Select the appropriate COM port by going to Tools>Port>COM# Arduino/Genuino Uno. Run the code by clicking on the upload icon. If the onboard LED begins to blink, you have successfully programmed your Arduino.

8 Wiring up An LED for “blink” Code

9 “BLINK” Code Structure
// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW Void Setup Void Loop

10 Wiring up a Switch to Arduino

11 Practice Program #2 (digital inputs)
File>Examples>Digital>DigitalInputPullup Wire up an LED between Pin #13 and GND Wire up your limit switch between Pin #2 and GND Upload and Run Task: Modify this code to control two LED’s with one button, one light should be on when the switch is pressed and vice versa when not pressed.

12 Wiring up an analog input to Arduino

13 Practice Program #5 (Analog inputs)
File>Examples>Control>IfStatementConditional Wire up an LED between Pin #13 and GND Wire a 10K Resistor and an LDR (Light Dependent Resistor) between 5V and GND. Connect a wire between these two components and connect to A0 pin. Upload the code and test by covering the LDR with your hand, the LED should turn on/off as the resistance changes. You can see this value expressed as an Analog # by opening up the serial monitor. Task: Modify this code to express the analog value of light using six LED’s (as the resistance increases, the LED’s should light up)

14 Speaker wiring for Arduino

15 Practice Program #3 (Tone and frequency)
Files>Examples>Digital>ToneMultiple Connect a speaker between Pin #6 and GND Upload and run the program. Task: Create a little song using a variety of frequencies and tone durations.

16 Servo wiring for ARDUINO

17 Practice Program #4 (servo motors)
Files>Examples>Servo>Sweep Connect the servo motor to the following pins: Red to 5V Black to GND White to Pin #9 Upload and run. Task: Create a program that toggles two LED’s and moves the servo motor between 45 and 135 degrees when a switch is pressed.

18 Teacher resources/Classroom activities
Circuit on TinkerCAD Arduino-Playground Arduino-Education Five Day Arduino Lesson Plan for LED and Servo Control

19 Research backing Arduino as a viable tool to teach CS
Using Arduino to Enhance Computer Programming Courses Teaching Introductory Programming Concepts: A Comparison of Scratch and Arduino

20 Wrap up Where do I go from here? Where can I find help?
How do I get copies of the resources from this workshop? Questions, comments & concerns.


Download ppt "Having fun with code, using Arduino in a middle school CS classroom"

Similar presentations


Ads by Google