Internet of Things Student STEM Project Jackson High School. Lesson 2: Arduino and LED

Similar documents
Lesson 3: Arduino. Goals

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

LESSONS Lesson 1. Microcontrollers and SBCs. The Big Idea: Lesson 1: Microcontrollers and SBCs. Background: What, precisely, is computer science?

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Programming 2 Servos. Learn to connect and write code to control two servos.

Arduino Workshop 01. AD32600 Physical Computing Prof. Fabian Winkler Fall 2014

ZX Distance and Gesture Sensor Hookup Guide

Rodni What will yours be?

Arduino Lesson 1. Blink. Created by Simon Monk

1Getting Started SIK BINDER //3

Arduino Setup & Flexing the ExBow

Light Emitting Diode IV Characterization

Internet of Things Student STEM Project Jackson High School. Lesson 3: Arduino Solar Tracker

Using the Pythagorean Theorem to Explore and Measure Topography in 2D/3D Space

iphoto Objective Course Outline

Practical Assignment 1: Arduino interface with Simulink

Coding with Arduino to operate the prosthetic arm

Computer Science/Computer Engineering. Wheeler HS Fall 2018 Foundations of Engineering

Demon Pumpkin APPROXIMATE TIME (EXCLUDING PREPARATION WORK): 1 HOUR PREREQUISITES: PART LIST:

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

APDS-9960 RGB and Gesture Sensor Hookup Guide

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

1 Day Robot Building (MC40A + Aluminum Base) for Edubot 2.0

Mill One V2 Assembly Manual

The USB Brotherlink 4 - or Cartridge Cable

iphoto Getting Started Get to know iphoto and learn how to import and organize your photos, and create a photo slideshow and book.

MILL ONE. Assembly Manual. Manual Illustrated by Gontarz Design Studio

The DesignaKnit USB Brotherlink 5

Remote Rig Control. By Chris Bigelow, VA3ECO

Building Machines that Emulate Humans. Lesson plan and more resources are available at: aka.ms/hackingstem

Build a Mintronics: MintDuino

SCATT BASIC SHOOTER TRAINING SYSTEM USER MANUAL. SCATT company Tel: +7 (499)

Illuminating the Big Picture

The Basics. Introducing PaintShop Pro X4 CHAPTER 1. What s Covered in this Chapter

Endurance R/C Wi-Fi Servo Controller 2 Instructions

Saturday Academy Program

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

INA169 Breakout Board Hookup Guide

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Lead Screw Upgrade. How to upgrade your ROBO R1 to the new Lead Screw Upgrade Pack. Written By: Harrison Team RoBo 3D

TWEAK THE ARDUINO LOGO

1. ASSEMBLING THE PCB 2. FLASH THE ZIP LEDs 3. BUILDING THE WHEELS

Getting Started with the micro:bit

Using the S5U13781R01C100 Shield Graphics Library with Atmel Studio

AS726X NIR/VIS Spectral Sensor Hookup Guide

PIR Motion Detector Experiment. In today s crime infested society, security systems have become a much more

Welcome to Arduino Day 2016

The CO2 Sensor Calibration Kit

FABO ACADEMY X ELECTRONIC DESIGN

SCATT Biathlon shooting trainer User s Manual

Introduction to Turtle Art

Lab 2.4 Arduinos, Resistors, and Circuits

Pulse Width Modulation and

Installation guide. Activate. Install your Broadband. Install your Phone. Install your TV. 1 min. 30 mins

Using the Dragon NaturallyMobile Recorder

M-16DX 16-Channel Digital Mixer

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

MAKEVMA502 BASIC DIY KIT WITH ATMEGA2560 FOR ARDUINO USER MANUAL

VBRC 5. Radio Communicator. Installer Manual

VMA205 WIFI ESP8266 SHIELD

Touch Potentiometer Hookup Guide

Milli Developer Kit Reference Application Published on Silver Spring Networks STAGE (

Getting Started Guide

// Parts of a Multimeter

3.5 hour Drawing Machines Workshop

Application Note. Communication between arduino and IMU Software capturing the data

Downloading a ROBOTC Sample Program

Servomotor Control with Arduino Integrated Development Environment. Application Notes. Bingyang Wu Mar 27, Introduction

Getting Started Guide

Lab 5: Arduino Uno Microcontroller Innovation Fellows Program Bootcamp Prof. Steven S. Saliterman

Internet of Things with Arduino and the CC3000

PWM P108. Programming Instructions v 3.2 PWM Controller Software

Arduino An Introduction

Getting started with the SparkFun Inventor's Kit for Google's Science Journal App

Designing in the context of an assembly

Vinyl Cutter Instruction Manual

Peek-a-BOO Kit JAMECO PART NO / / Experience Level: Beginner Time Required: 1+ hour

Ribcage Installation. Part 2 - Assembly. Back-Bone V1.06

Micro Wizard Instructions K1 KIT ASSEMBLY INSTRUCTIONS With Remote Start Switch

Apple Photos Quick Start Guide

Juego Operación para Makey Makey

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters

MAKEBLOCK MUSIC ROBOT KIT V2.0

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Adafruit 16-channel PWM/Servo Shield

PSoC and Arduino Calculator

Warehouse Instruction Guide

Assembly Instructions for the 1.5 Watt Amplifier Kit

Installation guide. Activate. Install your TV. Uninstall. 1 min 10 mins. 30 mins

BMW E39/E53 Android Touch Screen Radio Installation Instructions

Scanner Parts. Scanner Specifications. General. Mechanical. Epson Perfection V200 Photo. P Power/ ] Start button Status light. { Copy button.

LED + Servo 2 devices, 1 Arduino

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

The DesignaKnit USB E6000 Link 1 & 2

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Transcription:

Internet of Things Student STEM Project Jackson High School Lesson 2: Arduino and LED

Lesson 2: Arduino and LED Time to complete Lesson 60-minute class period Learning objectives Students learn about Arduino and other microcontrollers and the functionalities they provide. Students learn about the Arduino IDE installation, configuration, and basic programming. Students get hands on experience with the microcontroller to further examine how they interface with various sensors and modules Students learn about how to use and control LEDs Students learn how to sound reactive led strips working with Arduino Uno and sound sensor for music 21st century technical skills gained through this activity Electronic Circuit Design - Microcontrollers Computer Programming LED sensor Sound sensor Credits! Code and tutorial based on the great open source lib & example code at: https://github.com/hansjny/natural-nerd/tree/master/arduino/soundsread2 http://fastled.io/ Introduction In this lesson, learn how to flash an LED strip to the beat of music using a small sound sensor, transistor and an external power source. This lesson will show you how to use open source libraries for Arduino. We will use the FastLED library for programming addressable LED strips and pixels such as WS2810, WS2811, and WS2812B. It will be reacting on the surrounding sound and music and will be playing like a visualizer. In this build we ll make a good looking light that dances to all sounds and music, using simple components and some basic Arduino programming.

Project 1: LED Strip Step 1: Parts List Below you will see the parts that are included in your project kit. Lay these parts out in your workspace and ensure that all pieces are present!

Step 2: Assembly First, take the brown film off the back of the LED strip and attach it to the cylinder in a spiral shape as shown. Do this by sticking the end of the strip with the connections to the bottom of the cylinder, then rolling the cylinder and sticking the strip higher and higher until you reach the top of the cylinder and run out of LED strip. The large blue board in our kit is called the Arduino UNO. The UNO is one of many Arduino microcontrollers, all of which can carry out numerous functionalities. Now, we will connect our Arduino with the LED strip and apply power!

Notice the three jumper wires coming off the LED strip. Follow the wires back behind the black plastic joint, and you will notice red, green, and white cables. Using those colors, follow the above diagram and table to wire the LED strip to the Arduino. Do not connect the red jumper wire to VIN until Steps 3 and 4 are complete!

Step 3: The Code Your next task is done on the computer. First, grab the file that contains our code! You will be instructed on where to go to get this file. Next, open up your web browser and go to https://www.arduino.cc. From here, click on the Software tab at the top of the screen You will be brought to the download screen, where you will pick your preferred download for your system and install! Once the Arduino IDE (Integrated Developmental Environment) is installed on your system, load it up! Once you have the IDE running, go to file on the top tab, and click open (or simply press Ctrl + O.) Open up the code file you downloaded earlier, and you will notice the first line reads

#include "FastLED.h" FastLED.h is a library, or a file that provides our code with an extra functionality, in this case, more control over our particular set of LED s. While we can see the library in our code, we need to install the library for our code to run properly. Click on Sketch on the toolbar at the top of the IDE, go to Include Library, and then click Manage Libraries. When the Library Manager appears, search for FastLED.h in the search bar. FastLED by Daniel Garcia should appear. Click on the library and you will see the install button. Click the install button and you will install the latest library.

Step 4: Running the Program Now we are ready to run our first program! First, use the USB cable to connect the Arduino to your computer. Next, you need to select a COM port so that the IDE knows where to upload the code. Go to the Tools tab on the toolbar, select the option that says Port, then click on the bottom port on the Serial ports list. This can be a port of any number. For this example, the port was COM4. Let s test the upload! Click on the arrow pointing right in the top left of the IDE. This will compile our code and attempt to upload it to the Arduino. If the upload takes a long time and/or fails, try to switch the COM port to one of the others on the list. When the correct COM port is selected, the code will compile and upload to the Arduino board. The bottom green bar of the IDE will say Done Uploading once upload is completed. Unplug the USB cable from the Arduino, but keep the cable itself in the computer (we will need it for the next projects.)

Step 5: Putting it all Together Lastly, we have to apply power so that our Arduino can process the code and our LEDs can light up! You can now connect the red wire to VIN from Step 2 Now find a power outlet, and connect the 5V 3A Barrel Jack Power Supply to the power outlet. If you were successful, you will see the LEDs change color as they move up and down the cylinder.

Project 2: Sound-Sensor Module Step 1: The Code Setup and Run Since we have the Arduino IDE set up and running, our next project will require some altered code to be put into the IDE. You will be instructed once again on where you can get the file containing the code. Once you have the file, open it in the IDE following the same method as in Step 2 of Project 1. Upon opening the code, you will see that FastLED.h is once again included as a library. We already installed this library in the last project, so there is no need to reinstall. Your COM port should remain as it was. Step 2: Wiring With Project 1 complete, we already have most of the parts needed for Project 2 in place! For now, remove the power supply and the red jumper wire connecting the LED strip power to the microcontroller. Now plug the Arduino back into your computer! We are going to upload our new code to the board, so click the arrow pointing right in the top left of the IDE, and make sure that all of our code compiles and is sent over to the Arduino successfully. Now unplug the Arduino from the computer and rewire the red jumper wire, ensuring the correct connection of the LED strip (reference Project 1 if you need help placing the cables back in their correct spots.) Now we will make our addition to the first project s setup. This is the sound-sensor module. In this project, the component that will be able to pick up sound and send it to the Arduino, where this sound will be (in a way) converted to light on the LEDs. You will notice three jumper wires coming off of the module, these will be connected to the Arduino using the labels on the module itself. Using the above diagram and chart, add the sound-sensor module to your Arduino. Once everything is wired up, re-plug the power supply to the Screw-Terminal Barrel Jack Plug on the LED strip. If you were

successful, you should be able to notice that with more sound, the more LEDs light up. To adjust the sensitivity, obtain a small screwdriver and insert it into the cross on the blue box of the sound-sensor module. Now turn clockwise or counter clockwise to change how sensitive the module reacts to sound. Lesson 2: Modifications! If you are finished with the projects before the time is up, feel free to browse this section for help modifying the codes to add a bit of personal touch to your projects! Project 1: LEDS.setBrightness(125); Project 2: o This line of code pertains to the brightness of the LEDs. The minimum brightness is 0, and the maximum brightness is 255. It is not recommended to keep the LEDs on 255 for a long period of time. Change the numbers to whatever you would like to see changes in the brightness! float fade_scale = 1.2; o This line of code refers to the speed that the LEDs fade to black if they are not relit. Make some small changes to this value and you will notice that the LEDs will stay lit longer or fade quicker.

Jackson High School STEM IoT LESSON 2 MICROCONTROLLER & LED PROJECT KIT CONTENTS/CHECKLIST [x1] Arduino UNO Microcontroller The Arduino UNO microcontroller is the primary brain of the circuit, it is programmed to tell the LEDs and Sound Sensor what to do. [x1] USB Type-B Cable [Blue] This cable is to connect the Arduino UNO microcontroller to the Computer s USB Port. [x1] 30 COUNT LED 5V RGBW Strip [White] This is the LED strip that we will be lighting up and working with. It is different than cheaper SINGLE LED strips in that it contains all 3 LED colors (R, G, B) so that we can combine them into different colors made from them. [x1] Sound-Sensor Module [Small Blue Circuit Board] This sound-sensor module picks up a music source that is placed against it (such as your phone s speaker) and sends that info to the LED strip to light up based on the music. [x1] 5V 3A Barrel Jack Power Supply This provides the required current for the microcontroller & LED strip. [x1] Screw-Terminal Barrel Jack Plug [Black/Green] This plug-piece allows us to connect the barrel-jack power supply to the Arduino circuit to power the Arduino & LED Strip. [x6] Breadboard Wires (Colors may vary) These wires are used to connect all of the pieces of our circuit together. [x1] Cardboard Cylinder Tube This is the cardboard cylinder that the LED strip will be wrapped around.