Ginger Bread House

Similar documents
Lesson 4 RGB LED. Overview. Component Required:

Arduino Lesson 3. RGB LEDs

EP486 Microcontroller Applications

Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8

R,G,B LEDs. Three PWM outputs and three primary colors. Just screams to be made, doesn t it? 220 (red,red,brown) or 330 (orange,orange,brown)

Lecture (04) Arduino Microcontroller Programming and interfacing. By: Dr. Ahmed ElShafee

Bill of Materials: 7-Segment LED Die with Arduino PART NO

Informatics Enlightened Station 1 Sunflower

Character LCDs. Created by lady ada. Last updated on :47:43 AM UTC

Fig. 1 Analog pins of Arduino Mega

This module senses temperature and humidity. Output: Temperature and humidity display on serial monitor.

Building the ChronoDot Calendar Reminder

Lab 3c Fun with your LED cube. ENGR 40M Chuan-Zheng Lee Stanford University 19 May 2017

Measure the value of water flow using water flow sensor and DC water pump 12 V interfacing with Arduino uno

Informatics Enlightened Station 2 Park distance control system

Experiment 0: Hello, micro:bit!

MAKE AN RGB CONTROL KNOB.

Digital 1 Final Project Sequential Digital System - Slot Machine

Introduction. The Clock Hardware. A Unique LED Clock Article by Craig A. Lindley

Theory and Practice of Tangible User Interfaces. Thursday Week 3: Analog Input. week. Sensor 1: Potentiometers. Analog input

Smart Interface Components. Sketching in Hardware 2 24 June 2007 Tod E. Kurt

DAGON Company Leszno Jackowskiego 24 Street tel DAGON Lighting series SPL-3

Preface. If you have any TECHNICAL questions, add a topic under FORUM section on our website and we'll reply as soon as possible.

Computer Architecture and Organization. Electronic Keyboard

DMC550 Technical Reference

Preface. About SunFounder. About Super Kit. Free Support

Video to DVI 1080p Scaler Box - ID# 796

Alice EduPad Board. User s Guide Version /11/2017

"Sophisticated Model Railroad Electronics"

Dynamic Animation Cube Group 1 Joseph Clark Michael Alberts Isaiah Walker Arnold Li

Ch. 1: Audio/Image/Video Fundamentals Multimedia Systems. School of Electrical Engineering and Computer Science Oregon State University

The Infinity Portal Craig A. Lindley 03/16/2011

CM-392-Video to HDMI Scaler Box ID#481

CAR-5N / CAR-5P Video to RGB Converter for CAR display. Operation Manual

DS / /113. Pair (TP) User s Guide

Dust Sensor using GP Y

Model Railway Animation: Part 1, LEDs - Expanded By David King

DA VGA Line Receiver User s Guide

Part (A) Controlling 7-Segment Displays with Pushbuttons. Part (B) Controlling 7-Segment Displays with the PIC

CT-DMX-300 LED Controller

Calibrating the timecode signal input

Workshop III: Analog and Sensors

Using Sliders with the 4201-B Lighting Controller Application Note June 26, 2008

This guide gives details of the effects available on the FX selection DMX channels 15 and 17 in the MAC Aura.

LinTronic. TableTop series. Hardware version 6. Updated

Azatrax Model Railroad Track Signal Control - Single Track

VGA, Audio & RS-232 Serial with IR Pass-Thru over Single CAT5 /RJ45 Extender Kit

Connecting an Intel based Macintosh laptop to a TV

Downloads from:

Capstone Experiment Setups & Procedures PHYS 1111L/2211L

Broadcast A/V Division M-LYNX-702 V.3. Dual 7 LCD Display. User Manual

LED DRIVERS. LQC4D-V1 4 channels. User Manual FEATURES

Broadcast A / V Division M-LYNX-702 V.3. Dual 7 LCD Display. User Manual

Description Diagram Page

BLINKIN LED DRIVER USER'S MANUAL. REV UM-0 Copyright 2018 REV Robotics, LLC 1

MAKEVMP502 BASIC LEARNING KIT FOR RASPBERRY PI USER MANUAL

LEAMING INDUSTRIES MTS-4A BTSC STEREO GENERATOR

1x12 VGA & Audio over CAT5 Splitter

Dual PAL or NTSC Video to RGB Converter (One way) with 12V Relay Switch Operation Manual

Video to HDMI Scaler Box

CGA to EGA to VGA Converter (Multi) ID#425

ModelV-LCD70-AFHD. Operating Instructions

INSTALLATION INSTRUCTIONS WIRED REMOTE CONTROL USING TWISTED PAIR AND COAX CABLE U-WRC-U-x

BASCOM-TV. TV Code Features: ICs supported: BASCOM versions:

Owner s guide How to use your new Opalum Furniture Sound System

One Shot, Two Shot, Red Shot, Blue Shot. Build Instructions

USER MANUAL. VP-435 Component / UXGA HDMI Scaler MODEL: P/N: Rev 13

LT-300 LED Controller

AC334A. VGA-Video Ultimate BLACK BOX Remote Control. Back Panel View. Side View MOUSE DC IN BLACK BOX ZOOM/FREEZE POWER

SparkFun Inventor's Kit for micro:bit Experiment Guide

Paranormal Devices Built By Bill Chappell. For some weird reason people think I only build things that talk!

Assembly and Operating Instructions for HiViz.com Kits

Multimedia Systems Video I (Basics of Analog and Digital Video) Mahdi Amiri April 2011 Sharif University of Technology

Prototyping & Engineering Electronics Kits Magic Mandala Kit Guide

JS007WQK HEAVY DUTY WIRELESS REVERSING KIT 7 LCD DIGITAL QUAD RECORDING MONITOR with WATERPROOF CCD CAMERA

INSTALLATION INSTRUCTIONS WIRED REMOTE CONTROL USING COAX CABLE U-WRC-C

XTENDEX Series. ST-C6DVI(A)-300 ST-C6DVI(A)-IR FOOT DVI VIDEO, AUDIO AND IR EXTENDER Installation and Operation Manual

Linsn TS802 LED Card,SD802D LED Control Card

IBM Enhanced Color Display. Personal Computer. Hardware Reference Library _.-

Chapter Medical Table of Contents

RGB-3400-X RGB SEQUENCER / 3-CHANNEL UNIVERSAL LED DIMMER

Rfid Based Attendance System

ENGR 40M Project 3b: Programming the LED cube

Instructions when using for the first time 1. Installation (3) 2. Using the Televiewer (4)

Video to PC/HD Scaler Box. Operation Manual

Assignment #3: Piezo Cake

Objectives: Learn how LED displays work Be able to output your name on the display

MATLAB & Image Processing (Summer Training Program) 4 Weeks/ 30 Days

Signal processing circuit for 1-D PSD

CCD-TR57/TR67/TR87/TR413PK/TR414PK/ TR917/TR940/TR940PK

EL-4KHDBT-TXRX-70-E-ARC-IRS

9/23/2014. Andrew Costin, Tom Syster, Ryan Cramer Advisor: Professor Hack Instructor: Professor Lin May 5 th, 2014

4, 8, 16 Port VGA and Audio Extender / Splitter with Audio over Single CAT5

Video Streamer Modifications

MSS-CASCADE User Manual

TECHNICAL SUPPORT , or FD151CV-LP Installation and Operation Manual 15.1 Low Profile LCD

Technology Control Technology

USER MANUAL. VP-427 HDBaseT to HDMI Receiver/Scaler MODEL: P/N: Rev 5

Operating Instructions

Wireless Multi-Format input Transmitter to HDMI Receiver Box ID # 718

Transcription:

Party @ Ginger Bread House After hundreds of years of listening to Christmas Jingles while working on Santa s toy sweatshop the Elves decided to break with tradition and throw a techno-rave party. But of course they don t want to end on the unemployment office, thought times to be and Elf, so they decided to put a sensor in the garden to know when Santa is coming For this exercise we will use the Sharp IR sensor and the Wave Shield, and of course a Ginger Bread house. Let s start learning about the Wave Shield Wave Shield Adding quality audio to an electronic project is surprisingly difficult. People tend to end up either using low-quality ISD chips (you might get 8Khz sampling rate for 30seconds out of these, if you're lucky!) or mucking around with trying to control a CD or MP3 player. Volume can be controlled with the onboard thumbwheel potentiometer. Can play any uncompressed 22KHz, 12bit, mono Wave (.wav) files of any size. While it isn t CD quality, it is certainly good enough to play music, have spoken word, or audio effects. Output is mono, into L and R channels, standard 3.5mm headphone jack and a connection for a speaker that is switched on when the headphones are unplugged. Files are read off of FAT16 formatted SD/MMC card. Included library makes playing audio easy. FIRST STEP, FORMATTING THE SD CARD If you bought an SD card, chances are it's already pre-formatted with a FAT file system. However you may have problems with how the factory formats the card, or if it's an old cart it needs to be reformatted. The Arduino SD library we use supports both FAT16 and FAT32 filesystems. If you have a very small SD card, say 8-32 Megabytes you might find it is formatted FAT12 which isn't supported. You'll have to reformat these cards. Either way, it's always a good idea to format the card before using, even if it's new! Note that formatting will erase the card so save anything you want first. Don t worry, I ll provide the card in the right format.

SECOND STEP, CONVERT THE FILES Again, I already put the Sound files in the right format for you, 22KHz, 12bit, mono Wave (.wav) THIRD STEP, DOWNLOAD THE LIBRARY Go to https://code.google.com/p/wavehc/downloads/list and download the latest library (wavehc20110919.zip ) or get it from www.federicomuelas.com/sva/nov_4_class. Install it on your arduino Library folder. FOURTH STEP, TRY THE ARDUINO WAVE Go ahead and open the daphc example from the WaveHC Submenu. Or download the code step_4.ino from Fede s web page. This code should play the two files we have on the card. Now that we know the Wave shield is working let s incorporate the SHARP IR sensor INFRARED PROXIMITY SENSOR - SHARP GP2Y0A21YK The Sharp GP2Y0A21YK is an Infrared proximity Sensor. It shines a beam of IR light from an LED, and measures the intensity of light that is bounced back using an infrared sensor. If you stare at the IR emitter, you can see one of the LEDs glowing slightly red as some of the IR falls into the visiblelight spectrum. Because the GP2Y0A21YK is sensing the intensity of its reflected IR light, the sensor outputs near 0V when nothing is in front of it (approx. > 3ft), and ramps up as an object comes near. At about 4in, the reading from the Arduino is about 630.

FIFTH STEP: FIRST, CONNECTING THE SENSOR (use the Jumpers Attached to the Wave Shield) Red wire: Arduino 5V Black Wire: Arduino Ground Yellow Wire: Analog in A0 Once you connect the sensor to the Arduino read it as any analog sensor with analogread() function. SIXTH STEP: Upload the following code, open the serial monitor and find the range for the Sharp sensor. Write down the range you are getting from the IR sensor. You can download the code step_6.ino from Fede s web page. CODE: int sensorpin = A0; int sensorvalue = 0; void setup() { Serial.begin (9600); void loop() { sensorvalue = analogread(sensorpin); Serial.println (sensorvalue); delay (300); Let s incorporate the RGB LED at this point RGB LEDS RGB LEDs are in essence, three LEDs of different colors in ONE. The idea here is to change individually the brightness of each LED (R G B) so you can achieve any color on the visible color spectrum; therefore you want to use PWM pins. RGB LEDs contain red, green and blue emitters, generally using a four-wire connection with one common lead (anode or cathode). These LEDs can have either common positive or common negative leads. Common cathode Vs. Common Anode The different between common cathode and common anode RGB LEDs is pretty much the direction of the three LEDs.

What means that in order to operate a common cathode RGB LED you have to individually provide power to each LED (by turning the Arduino pins (HIGH). For common cathode RGB LED you need to provide Ground (Arduino Pins LOW) Connect the hardware as follows -Red LED (first lead) to pin 6 (PWM) via the 120 ohms resistor. -Common cathode (second lead) to Arduino Ground. -Green LED (third lead) to pin 9 via the 120 ohms resistor. -Blue LED (Fourth and last lead) to pin 11 via the 120 ohms resistor. EIGHTH STEP: WRITE AND UPLOAD THE RGB LED CODE SEVENTH STEP: CONNECTING THE RGB LED Write the code below and upload the program to your Arduino and try it out. This is the lighting effect for the party!! You can download the code below from Fede s web page. Code for the PARTY MODE: int ledcolor = 0; int a = 50; //this sets how long the stays one color for int red = 6; //this sets the red led pin int green = 9; //this sets the green led pin int blue = 11; //this sets the blue led pin void setup() { //this sets the output pins pinmode(red, OUTPUT); pinmode(green, OUTPUT); pinmode(blue, OUTPUT); void loop() { int ledcolor = random(7); //this randomly selects a number between 0 and 6 switch (ledcolor) { case 0: //if ledcolor equals 0 then the led will turn red analogwrite(red, 204); case 1: //if ledcolor equals 1 then the led will turn green case 2: //if ledcolor equals 2 then the led will turn blue case 3: //if ledcolor equals 3 then the led will turn yellow analogwrite(red, 160);

case 4: //if ledcolor equals 4 then the led will turn cyan analogwrite(red, 168); case 5: //if ledcolor equals 5 then the led will turn magenta case 6: //if ledcolor equals 6 then the led will turn white analogwrite(red, 100); Code for the GOOD ELF MODE: int red = 6; //this sets the red led pin int green = 9; //this sets the green led pin int blue = 11; //this sets the blue led pin void setup() { //this sets the output pins pinmode(red, OUTPUT); pinmode(green, OUTPUT); pinmode(blue, OUTPUT); void loop() { analogwrite(red, 204); analogwrite(blue, 50); analogwrite(green, 50); NINTH AND FINAL STEP; PUTTING ALL TOGETHER At this point we know that the Wave Shield the Sharp IR sensor and the RGB LED are working property, let s go ahead and put everything together so when someone is close to the gingerbread house the party stops and the elves start singing jiggles and turn the strobe light off. Use the codes from steps 4, 6 and 8 (both) as a reference Oh don t forget to build the ginger bread house!!!