Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.

Slides:



Advertisements
Similar presentations
Introduction to Arduino Programming January MER-421:Mechatronic System Design.
Advertisements

Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
Intro to Programming and Microcontrollers. Activity Group into pairs and sit back-to-back. Pick one person who is going to draw. The other person will.
Introduction to Sensor Technology Week Four Adam Taylor
Working with Arduino: Lesson #2: Variable, Photo, and Force Sensitive Resistors EGN1007.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
DataInputFrom Digital PinsUsing an On/OFF button to control an LEDFrom Analog Pins Reading light intensity using a photocell and turning an LED on and.
Basic Circuits – Lab 2 Arduino and Sensors
Tele-presence – Connecting Two Processing Platforms via Internet Controlling the Screen based on Distant User Input ServerClient 1.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Youn-Hee Han, Chan-Myung Kim {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi. Objectives 1. Control the rotation of standard servo motor  A standard servo motor is limited in its rotation.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Good LED Circuit 5V0 GND. What Voltage Does Meter See? Answer: 5 V.
Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
Robootika lahenduste esitlus Raul Liinev Martin Ligema Siim Suu Martin Tõnne.
Serial Communication. mouseX from computer to arduino processing sends a single byte of data arduino reads each byte arduino uses value to set light brightness.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
Line following tips photoresistors positioned near floor photoresistor circuits © 2011 LWTL faculty team living with the lab.
Ubiquitous Computing Practice ( Humidity Sensor ) Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
Welcome to Processing Who does not have access to digital camera?
ME 120: User-defined functions: average analog input reading Arduino Programming – Part 5: User-defined functions ME 120 Mechanical and Materials Engineering.
Microcontroller basics Embedded systems for mortals.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
LAB1 TYWU. Devices Dip Switch (4 Switches) Triple Output LED (RGB) –Common Cathode.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Pulse-Width Modulation: Simulating variable DC output
Session 6 John Wolf (WolfDenElectronics.com). Objectives – We’ll Learn  Code to Voice  PIR sensors – motion detection  Quadrature Encoders  Audio.
ME 120: Arduino PWM Breathing LED Code: Implementation on Arduino ME 120 Mechanical and Materials Engineering Portland State University
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
ME 120: Photoresistors and Arduino Programming Arduino Programming Case Study: Photoresistor Measurements ME 120 Mechanical and Materials Engineering Portland.
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Hacking on Arduino George Patterson
physical computing .2 – Day 3
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
Week 6: Style and Peripherals
Manual for Arduino Kit v1.0
Wireless Cue Light Project
Tele-presence – Connecting Two Processing Platforms via Internet
Line Following Tips photoresistor circuits
Control the color and brightness of an RGB LED with a Potentiometer
3.2 Serial Communication Part 2
3.1 Serial Communication Part 1
Analog Input through POT
Lecture 7: Functions Revisited / Analogue Signals
IoT Programming the Particle Photon.
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Using Photoresistors with an Arduino
Line Following Tips photoresistor circuit
Last of the LED’s and Arduino
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
UNIT 5 Analog signals.
Arduino UMBC IEEE Sekar Kulandaivel
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
CTY SAR FCPS Alexander Velikanov
Presentation transcript:

Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology Ubiquitous Computing Practice (Photo Resistor)

/ 24 Introduction PhotoResistor LED 밝기 조절 Processing 를 이용한 Graph 2 Contents

/ 24 PhotoResistor ( Cadmium sulfide or Light dependent resistor ) 빛의 세기에 따라 저항 값이 변하는 센서이다 3 Introduction

/ 244 Introduction

/ 245 Introduction

/ 246 Introduction

/ 247 Introduction

/ 24 PHOTO RESISTOR 8

/ 249 Photo resistor

/ 2410 schematic

/ 2411 Result

/ 24 Functions analogRead(pin) – analog pin 에서 int (0~1023) 반환 analogWrite(pin, val) – val(0~255) 값 출력 Serial begin(baud) – bits per second  ex)9600, print(val) – 시리얼 통신 이용 val 출력  Serial.print(78) gives "78" print(val, format) – val 을 원하는 format 에 맞춰 출력  Serial.print(78, BIN) gives " " 12 Reference

/ 24 Math map(value, fromLow, fromHigh, toLow, toHigh)  Value 현재 값의 범위 fromLow ~ fromHigh  변경하고 싶은 값의 범위 toLow, toHigh  ex) int val = analogRead(0); val = map(val, 0, 1023, 0, 255); constrain(inputVal, lowRange, highRange)  inputVal 값이 lowRange ~ highRange 사이의 값이면 inputVal 반환  inputVal 값이 lowRange 값 보다 작으면 lowRange 값 반환  inputVal 값이 highRange 값 보다 크면 highRange 값 반환 13 Reference

/ 2414 센서의 analog 값 출력 Sketch int photocellPin = 0; int photocellReading; void setup(void) { Serial.begin(9600); // bit per second. } void loop(void) { photocellReading = analogRead(photocellPin); Serial.print("Analog reading = "); Serial.println(photocellReading); delay(1000); }

/ 24 LED 밝기 조절 15

/ 2416 LED 밝기 조절

/ 2417 schematic

/ 2418 LED 밝기 조절 Sketch int lightPin = 0; int ledPin = 11; void setup() { pinMode(ledPin, OUTPUT); } void loop() { int lightLevel = analogRead(lightPin); lightLevel = 1023 – lightLevel; lightLevel = map(lightLevel, 0, 1023, 0, 255); lightLevel = constrain(lightLevel, 0, 255); analogWrite(ledPin, lightLevel); }

/ 24 PROCESSING 를 이용한 GRAPH Processing 을 이용하여 Graph 를 출력하기 19

/ 2420 Arduino board

/ 2421 Arduino - Sketch int lightPin = 0; void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(lightPin)); delay(100); }

/ 2422 Processing - Sketch import processing.serial.*; Serial myPort; // The serial port int xPos = 1; // horizontal position of the graph void setup () { size(400, 300); println(Serial.list()); myPort = new Serial(this, Serial.list()[1], 9600); myPort.bufferUntil('\n'); background(0); } void draw () { }

/ 2423 Processing - Sketch void serialEvent (Serial myPort) { String inString = myPort.readStringUntil('\n'); if (inString != null) { inString = trim(inString); float inByte = float(inString); inByte = map(inByte, 0, 1023, 0, height); stroke(127,34,255); line(xPos, height, xPos, height - inByte); if (xPos >= width) { xPos = 0; background(0); } else { xPos++; }

/ 2424 Result