WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. ·...
Transcript of WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. ·...
![Page 1: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/1.jpg)
WIZnet Wiki & Forumhttp://wizwiki.nethttps://forum.wiznet.iohttp://wiznetacademy.com/
마스터 부제목 스타일 편집
Ricky
![Page 2: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/2.jpg)
목차
≫1교시 : 오픈 소스가 가져온 변화
≫2교시 : 아두이노, 오픈 소스 하드웨어의 선구자
≫3교시 : 아두이노 맛보기
![Page 3: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/3.jpg)
오픈 소스 운동이 가져온 변화
![Page 4: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/4.jpg)
아두이노, 오픈 소스 하드웨어의 선구자
![Page 5: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/5.jpg)
아두이노 맛보기
![Page 6: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/6.jpg)
아두이노 장치
≫아두이노 보드와 쉴드
Edward Blog - http://openstory.tistory.com/
![Page 7: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/7.jpg)
What is Arduino Product?
≫Arduino Uno
• Input Voltage(recommended): 7 ~ 12V• Operation Voltage: 5V• Flash Memory: 32KB(ATmega328P), 0.5KB bootloader• SRAM: 2KB(ATmega328P)• EEPROM: 1KB(ATmega328P)• Digital I/O Pins: 14ea (of which 6 provide PWM output)• Analog Input Pins: 6ea (10-bit ADC channels)
![Page 8: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/8.jpg)
Arduino Board
≫Arduino MEGA 2560
• Input Voltage(recommended): 7 ~ 12V• Operation Voltage: 5V• Flash Memory: 256KB(ATmega2560), 8KB bootloader• SRAM: 8KB(ATmega2560)• EEPROM: 4KB(ATmega2560)• Digital I/O Pins: 54ea (of which 15 provide PWM
output)• Analog Input Pins: 16ea (10-bit ADC channels)
![Page 9: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/9.jpg)
Arduino Board
≫WizArduino MEGA WiFi
WiFi Features•Single band 2.4GHz IEEE 802.11b/g/n•Serial Interface : UART•UART Max Baud : 921600 bps•Soft AP : Enough memory retention, Wi-Fi Security (WEP, WPA/WPA2PSK), L2 Switching•OTA(Over The Air F/W Upgrading)•더 자세한 내용은 WizFi310 WiKi page를 참고 하세요.
Hardware Features•Microcontroller : ATmega2560•Operating Voltage : 5V•Digital I/O Pins : 20 (of which 12 provide PWM output)•Analog Input Pins : 6•DC Current per I/O Pin : 20 mA•DC Current for 3.3V Pin : 50 mA•Flash Memory : 256 KB of which 8 KB used by bootloader•SRAM : 8 KB•EEPROM : 4 KB•Clock Speed : 16 MHz•PCB Size : 53 x 68.5mm
![Page 10: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/10.jpg)
Arduino Board
≫Pinout
전원
Analog Input
Digital I/O
I2C
![Page 11: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/11.jpg)
응용사례
![Page 12: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/12.jpg)
스마트 도어락
≫https://www.youtube.com/watch?v=soF_zPvPCYg
![Page 13: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/13.jpg)
에어컨 제어 / 모니터링
![Page 14: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/14.jpg)
스마트 식물 기르기
![Page 15: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/15.jpg)
스마트 주차 관리
![Page 16: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/16.jpg)
큐브 로봇
≫https://www.youtube.com/watch?v=ixTddQQ2Hs4
![Page 17: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/17.jpg)
창문 청소 로봇
≫https://www.youtube.com/watch?v=whQHL2SjYao
![Page 18: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/18.jpg)
아두이노 실습
![Page 19: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/19.jpg)
Arduino IDE
≫Arduino IDE 다운로드 및 설치
![Page 20: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/20.jpg)
Arduino IDE 기능
≫Library
![Page 21: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/21.jpg)
Arduino IDE 기능
≫Serial Window
![Page 22: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/22.jpg)
Arduino Sketch 구성
≫setup()과 loop()
![Page 23: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/23.jpg)
Arduino IDE
≫Serial 장치 드라이버 설치
• Arduino는 IDE를 설치하면 내부에 자체적으로 Driver를 제공한다.
• 보통은 Arduino IDE 설치 후 Arduino를 연결하면 아래 그림과 같이 Serial Port가 연결된다.
다음과 같이 Arduino Mega 2560COM Port가 연결된 것을 확인할 수 있다.
![Page 24: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/24.jpg)
≫Serial 장치 드라이버 설치1) 만약 COM Port가 나오지 않으면 아래와 같은 방법으로 해결.
마우스 우 클릭하여“드라이버 소프트웨어 업데이트"클릭
C:\Program Files (x86)\Arduino\drivers 경로를선택한 뒤 다음(N)을 누르면 드라이버 설치된다.
2
1 3
4
![Page 25: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/25.jpg)
GPIO
≫GPIO(General Purpose Input Output) 란
• 입출력(I/O)포트와 GPIO(General purpose in/output)은 동일한 의미로써, MCU의 I/O 핀을 입력 핀으로(input)만들거나, 출력 핀으로(output)을 만들 수 있다.
• GPIO는 다음과 같이 3가지 동작 상태를 나타낼 수 있다.– 입력(input): 아두이노(MCU) 입장에서 외부로 부터 ‘1’ or ‘0’의 값을 받는 것을 말한다. ex) Switch– 출력(output): 아두이노(MCU)가 외부로 ‘1’ or ‘0’을 주는 것을 말한다. Ex) LED– High-Z(하이임피던스): ‘1’, ’0’ 둘 다 아닌 상태를 말한다. 그래서 아두이노(MCU) 입장에서 상대방의 출력
을 받으면 그 상태 그대로 설정이 된다. 즉, 상대방이 High(1)을 주면 MCU도 High가 되고, 상대방이Low(0)을 주면 MCU도 Low가 되는 상태이다.
![Page 26: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/26.jpg)
GPIO
≫LED 란?
• 한 쪽 방향으로만 전기 에너지(전류)가 흐르는 반도체 소자를 다이오드라 한다.• 이러한 다이오드 중 흐르는 전기 에너지를 빛 에너지로 변환 하는 것을 발광 다이오드, LED(Light Emitting Diode)라 한다.
• LED는 2개의 전극 단자로 구성되어 있으며, 각 단자는 극성을 가지고 있다.• 이때 아두이노 메가의 공급전압은 5V이며, 통상 LED는 1.6V ~ 2.0V와 10mA를 소비한다. (Datasheet에 명기되어 있음)• 따라서 옴의 법칙으로 계산하면, R=V/I , V=IR , I=V/R (옴의 법칙)• MEGA LED 계산: (5.0V-2.0V) / 0.01A = 300R• WizArduino LED 계산: (3.3V-2.0V) / 0.01A = 130R • “통상적으로 330R을 사용한다. 여기서 무조건 330R을 사용하는 것은 아니다. • 470R, 1K 저항을 사용해도 LED불은 점등한다. 다만, 빛의 밝기가 다를 뿐이다.”
전류가 흐르는 방향
![Page 27: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/27.jpg)
GPIO
≫LED 실습
330R
옴의법칙
R = I = = ×
![Page 28: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/28.jpg)
GPIO
≫LED 실습
옴의 법칙
R = I = = × 330R
![Page 29: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/29.jpg)
GPIO
≫LED 실습
![Page 30: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/30.jpg)
GPIO
보드 설정하기1
포트 설정하기2
(주의사항: 포트에 체크가 되어있어야 한다.)
![Page 31: WIZnetWiki & Forumwiznetacademy.com/files/attach/note/4212_4215/Arduino.pdf · 2018. 1. 24. · ArduinoBoard ≫WizArduinoMEGA WiFi WiFiFeatures •Singleband2.4GHz IEEE 802.11b/g/n](https://reader035.fdocument.pub/reader035/viewer/2022081411/60b041425574ed2eae23b167/html5/thumbnails/31.jpg)
GPIO
예제파일 실행
3
업로드 하기4
(주의사항: 업로드가 안되면포트 & 보드 세팅 다시 확인)