iot section 1th
TRANSCRIPT
![Page 1: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/1.jpg)
Microcontroller (Arduino uno) lab 1
An introduction
![Page 2: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/2.jpg)
Good news 4 teaching assistant this year500 L.E prize for top ten best idea for projectsPure practical sections 6 boards will be available at the lap to be used Complete with sensors Be careful with the lap tools protect them as
yours
![Page 3: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/3.jpg)
Grades distribution 20 lab10 final lab exam 12 lab sessions + final lab exam in total 13 labs
![Page 4: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/4.jpg)
What is a microcontroller Small computer System on a chip (SoC)Contains processor memory storage input and outputs Contains digital and also analog inputs Communication means like wifi bluetooth or radio frequency (internet )Need very low power consumptionVery low cost Typical application iots application
![Page 5: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/5.jpg)
Arduino uno Open source project HW / SWIt is used to digital devices that interact with the environment Contains analog and also digital inputs Can receive measurement from the environment and react to them Can be used to control other devices It uses a custom version of c and c++ programing languageWrite a code on ide on your computer and then put them on the chip And you are ready to go Cross platform linux mac and window
![Page 6: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/6.jpg)
Hardware overview
![Page 7: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/7.jpg)
Important notes about arduino uno USP input to put the code into the chip6 analog inputs pins values 0 -25514 digital inputs / outputs pins high or low 0 or 1 Clock speed 16 MHz
![Page 8: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/8.jpg)
Important terminology Sketch mean program in arduino community Pin is either input or output connected to button input or to led lamp outputDigital is either low or high zero or one Analog is either 0 - 255 variables
![Page 9: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/9.jpg)
Arduino uno
![Page 10: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/10.jpg)
Sensors examples Measure distance It is using ultrasonic Like bats sensing the prey
![Page 11: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/11.jpg)
Sensors examples continue It is used to start reaction To any inputs
![Page 12: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/12.jpg)
Sensors examples continueIt is used to sense the level of water on earth Can be used to save water in agriculture
![Page 13: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/13.jpg)
Sensors examples continue
![Page 14: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/14.jpg)
So we have chip and input what about outputs
![Page 15: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/15.jpg)
Outputs continue
![Page 16: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/16.jpg)
Important sensors that we will use in the future
![Page 17: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/17.jpg)
Breadboard
![Page 18: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/18.jpg)
Breadboard continue We need to build some complicated project and chips Makes organizing very easy compared to plugging inputs and outputs directly
into the the board
![Page 19: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/19.jpg)
Inputs & outputs Inputs is something that board read from the environment or the userExample temperature from the environment & push a button from user Output reaction from the board as a results of an inputsA blink of the led or a message on the lcd screen
![Page 20: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/20.jpg)
You can connect sensors and actuators, and program your Arduino to control them
![Page 21: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/21.jpg)
First program We will use the built in program in the arduino ide File -> examples -> 01 Basics -> Blink File -> example contains many pre made sketches that you can use right
away It is like standing on the shoulders of the giants
![Page 22: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/22.jpg)
![Page 23: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/23.jpg)
First program Plug the chip into the laptop or computer using usb portThen you will see a led light labels L blinking once every two second This was your first program easy right ? Why this program is preinstalled on the board To make sure it is working fine
![Page 24: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/24.jpg)
First program bit by bit Code consisted of two main parts First part in setup for thing that we want to do once like initialization Second part is loop things that are repeated more than once hence loop pinMode(pinNumber , INPUT / OUTPUT) Pin number is the number of the pin you use Second parameter is the input or output the pin more you wantDigitalWrite (pin you want to write to , value High or Low)Delay(milliseconds) stop the loop temporarily
![Page 25: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/25.jpg)
Notes on arduino programing You can define variables like int , float etc You can use variables to name your sensors and actuators INPUT , OUTPUT , HIGH , LOW all of them are constants
![Page 26: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/26.jpg)
Second program modify the first program Change delay from 1000 to 200Delay is the time between each blank of the built in led light Each 1000 = 1 second 200 = second ⅕Click upload then the program will be uploaded to board
![Page 27: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/27.jpg)
Home workWatch the video series on the YouTube Tutorial Download arduino ide from the link Arduino
![Page 28: iot section 1th](https://reader036.vdocuments.net/reader036/viewer/2022062503/586f8e161a28ab54768b710d/html5/thumbnails/28.jpg)
Thank you