IOT FILE Final
IOT FILE Final
IOT FILE Final
C. Theory:-
Ourtopsellerisbackwitharevision,the8051UltraDevelopmentboardhasgot a revision
with enhanced features. A onboard USB to serial converter to connect directly to your
laptop/computer,wehavedoneawaywiththeRS232.Alsotheboard ismorespaciouswithclear division
among various peripherals.We have designed this 8051 kit, so that a beginner can gradually build up
from basics like LED blinking up to standard peripherals and communication
protocolswithouthavingtochangeboards.WeareshippingaUSBAT89Sseriesprogrammerwith this
board, for easy programming. The entire kit is very affordable and we have solid 22 video
tutorialstohelpyougetstartedfromarchitecturetointerfacingalltheon-boardperipherals
Contents:
1. 8051 Development Board with following Modules, ICs andInterfaces
It is 8-bit microcontroller, means MC 8051 can Read, Write and Process 8 bitdata.
Thisismostlyusedmicrocontrollerintherobotics,homeapplianceslikemp3player,
washing machines, electronic iron and industries. Mostly used blocks in the
architecture of 8051 are asfollows:
• 4KBROM
In 8051, 4KB read only memory (ROM) is available for program storage.This is used for
permanent data storage. Or the data which is not changed during the processing like the
program or algorithm for specific applications.
• SerialPort
TherearetwopinsavailableforserialcommunicationTXDandRXD.NormallyTXDis
usedfortransmittingserialdatawhichisinSBUFregister,RXDisusedforreceivingthe
serialdata.
• Input OutputPorts
TherearefourinputoutputportsavailableP0,P1,P2,P3.Eachportis8bitwideand
hasspecialfunctionregisterP0,P1,P2,P3whicharebitaddressablemeanseachbitcanbe
setorresetbytheBitinstructions(SETBforhigh,CLRforlow)independently.Port2can be used
as I/O port as well as higher order address bus A8 to A15. Port 3 also have dual
functionsitcanbeworkedasI/OaswellaseachpinofP3hasspecificfunction
P3.0—RXD—SerialI/PforAsynchronouscommunication
SerialO/Pforsynchronouscommunication.
P3.1 — TXD — Serial data transmit.
P3.2 — INT0— External Interrupt 0.
P3.3 — INT1 — External Interrupt 1.
P3.4—T0—Clockinputforcounter0.
P3.5—T1—Clockinputforcounter1.
P3.6—WR—Signalforwritingtoexternalmemory.
P3.7—RD—Signalforreadingfromexternalmemory.
MC8051has128byteRandomAccessmemoryfordatastorage.Randomaccess
Memoryisnonvolatilememory.DuringexecutionforstoringthedatatheRAM
isused.RAMconsistsoftheregisterbanks,stackfortemporarydatastorage.
Normallymicrocontrollerhas256byteRAMinwhich128byteisusedforuserspace which
is normally Register banks andstack.
We know that 128 byte = 27byte
• Timers andCounters
In MC8051, two timer pins are available TO and TI, by these timers we can
givethedelayofparticulartimeifweusetheseintimermode.Wecancountexternal
pulsesatthesepinsifweusethesepinsincountermode.16bitstimersareavailable.
Means we can generate delay between OOOOH toFFFFH.
IfwewanttoloadTOwith16bitdatathenwecanloadseparatelower8bitinTL0and higher 8
bit in TH0. In the same way for T1. TMOD, TCON registers are used for controlling
timeroperation.
A real time clock is basically just like a watch - it runs on a battery and keeps time for you even
when there is a power outage! Using an RTC, you can keep track of long timelines, even if you
reprogram your microcontroller or disconnect it from USB or a power plug.
DS1307(64x8SerialReal-TimeClock)
DESCRIPION
The DS1307 Serial Real-Time Clock is a low-power, full binary-coded decimal (BCD)
clock/calendarplus56bytesofNVSRAM.Addressanddataaretransferredseriallyviaa2-wire, bi-
directionalbus.Theclock/calendarprovidesseconds,minutes,hours,day,date,month,andyear
information. The end of the month date is automatically adjusted for months with fewer than 31
days,includingcorrectionsforleapyear.Theclockoperatesineitherthe24-houror12-hourformat
withAM/PMindicator.TheDS1307hasabuilt-inpowersensecircuitthatdetectspowerfailures and
automatically switches to the batterysupply.
AT24C16
Features
• Low-voltageandStandard-voltageOperation—2.7(cc=2.7Vto5.5V)—1.8(Vcc=1.8Vto5.5V)
•Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K),1024 x 8 (8K) or 2048 x 8 (16K)
•Two-wire Serial Interface
•Schmitt Trigger, Filtered Inputs for Noise Suppression
•Bidirectiona1 Data Transfer Protocol
•100 kHz (1.8V) and 400 kHz (2.7V, 5V) Compatibility
•Write Protect Pin for Hardware Data Protection
•8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes
•Partia1 Page Writes Allowed
•Self-timed Write Cycle (5 ms max)
•High-reliability
—Endurance: 1 Million WriteCycles
—Data Retention: 100Year.
CR2032 battery
A CR2032 battery is a button cell lithium battery
rated at 3.0 volts. It is commonly used in
computers as a CMOS battery, calculators,
remote controls, scientific instruments, wireless
doorbells, watches, and other small devices
RELAY
Arelayisanelectromagneticswitchoperatedbyarelativelysmallelectriccurrentthatcanturnon or off a
much larger electric current. The heart of a relay is an electromagnet (a coil of wire that becomes a
temporary magnet when electricity flows throughit).
D. Procedure:-
General Procedures for Keilp Vision 5:-
2. DoubleClickontheiconKeilpVision5presentonthedesktop.
5. Go to the project menu & click on New p Vision project after this Create New Project window will appear on
desktop write the New Project Name SelectICAT89S52 OKYES.
6. Go to target 1 & then source group, Right click on there & click on the option “Add Files to the Group ‘Source
Group 1’”.
8. ProgrameditingwindowwillappearondesktopwithNewFileName.
10. Right click Target 1, go to the Option for Target ‘Target 1’ or (Alt+F7) Option for Target ‘Target 1’ window
will appear on desktop click on output & tick on Create HEX File option and thenOK.
11. Now click on “Translate current file”, “Build Target” and “Rebuilt all targetfiles”.
After performing all these steps the chip will be configured through Xplore Flash.
2. SelectUSBasp.http://www.fischI.de/usbasp/inappearwindowondesktop.
3. NowselectAT89S52/AT89C51microcontrollerinappearwindowondesktop.
4. NowselectHexFiletoburninchipthroughbrowseoptionFlashandopen.
5. NowpressGoXploreFlashprogramwillburnwith5-6Seconds.
E. Observation: Write/ Plot Your Own With Observation Table (IfRequired).
G. Conclusions:
Theadditionoftwo8-bitnumbersisperformedusingAT8051UltraDevelopmentKitwhere
sum is 8 — bit result display on LEDS in Binary form.
H. Precautions:
Objectives: Student should get the knowledge of Intel Galileo Board and different types of LED
Outcomes: Student will be Write program using Arduino IDE for Blink LED
Apparatus Used -
1. IntelR GalileoBoard
2. Micro SDCard
3. SD CardReader
4. +5V Power adapter
5. USB to SerialCable
6. Micro USBCable
Theory:-GalileoisamicrocontrollerboardbasedontheIntelsQuarkSoCX1000Application Processor,a32-
bitIntelPentium-classsystemonachip(datasheet).It’sthefirstboardbasedon Intels architecture designed to
be hardware and software pin-compatible with Arduino shields designed for the Uno R3. Digital pins 0
to 13 (and the adjacent AREF and GND pins), Analog
inputs0to5,thepowerheader,ICSPheader,andtheUARTportpins(0and1),areallinthesame
locationsasontheArduinoUnoR3.ThisisalsoknownastheArduino1.0pinout.
Galileoisdesignedtosupportshieldsthatoperateateither3.3Vor5V.Thecoreoperatingvoltage
ofGalileois3.3V.However,ajumperontheboardenablesvoltagetranslationto5VattheI/Opins. This
provides support for 5V Uno shields and is the default behavior. By switching the jumper
position,thevoltagetranslationcanbedisabledtoprovide3.3VoperationattheFOpins.
Procedure:
1. Connecta5VpowersupplytotheGalileo.(TheUSBportalonecannotsupplyenoughpowerto run
theGalileo.)
2. Connectamicro-BUSBcablefromtheGalileo’sUSBClientporttoanavailableUSB socket
on yourcomputer.
3. Uponconnectingtheboard,Windowswillautomaticallyattempttoinstallthedriverand,
unsurprisingly, it will fail. We’ll have to manually install thedriver.
4. OpenuptheDeviceManager.(EitherStart>Run>devmgmt.msc,orgototheControl Panel,
select System and click DeviceManager.)
5. LocatetheGadget Serialv2.4device,undertheOtherdevicestree.Right-clickthatand
selectUpd‹ite Driver Software...
1. On the first window that pops up, click Browse my computer for driver software. Andon
thenextpageselecti3rowSe...andnavigatetothehardware\arduino\x86\toolsfolderwithin your
Arduino Galileo software installation. Then clickNext.
2. ClickInstallonthenextWindowsSecuritywindowthatpopsup.And,afteranumberof Loading-
bar-scrolls,theinstallationshouldcompleteandyoushouldbegreetedwithaWindows has successfully
updated your driver softwarewindow.
3. LookbackattheDeviceManager,underthePortstreenow.Thereshouldbeanentry
forGalileo(COM#).RememberwhichCOM#yourGalileoisassigned,it’llbeimportant for Arduino
sketchuploading.
Uploading Blink
Asalways,thefirstprogramtobeuploadedtoaboardisthe“Hello,world”ofmicrocontrollers- Blink.
To open the Blink example, go to the File >Examples >01.Basics >Blink.
/* Blink
TurnsonanLEDonforonesecond,thenoff for one
second, repeatedly.*/
//Pin13hasanLEDconnectedonmostArduino boards.
// give it a name:
int led = 13;
//thesetuproutinerunsoncewhenyoupress reset:
void setup() {
//initializethedigitalpinasanoutput.
pinMode(led,OUTPUT);
MakesuretheSerialPortandBoardselectionsarestillcorrect.CompilerssupportedareGCCand
ICC.ThenclicktheUploadbutton.UploadButtonwillCompileandrunthecode.
Aftertheuploadcompletes,youshouldseeatiny,greenLEDblinkingonandoffeverysecond. This LED
is connected to pin 13 of theGalileo.
Result :- Compilation and Installation of Arduino IDE & Drivers is done and process understood.
Conclusion:-
Targetboardofsuchtypescanbeusedinlowcos
tsystemdesignsusingveryless
amountofcomponents
Experiment 3
1. Inthefiletypedrop-downlist,select*.*soyoucanseeallfiles,regardlessoffileextension.
2. Navigatetoandselectthe.directfilethatyouextractedearlier,thenclickOpen.
3. FromtheDevicedrop-downlist,selectthedevicedriveofyourmicroSDcard.
Caution:Besuretoselectthecorrectdevicedrive,asthedriveletterforyourcardmaybe
differentonyoursystem.Selectingthewrongdrivelettercouldresultinerasingyourdataon the
wrongdrive.
4. ClickWrite,thenwaitforthewriteprocesstofinish.Pleasebepatient,asthismaytakeupto 5minutes.
5. Aftercompletingthewriteprocess,clickExittocloseWin32DiskImager.Ejectandremove the
micro SD card from your cardreader.
6. YoucannowinsertthecardintothemicroSDcardslotonyourIntelGalileoboard.Whenyou
powerupyourboard,theboardautomaticallybootsusingtheimageonthecard.
5. Plug the other end of the FTDI cable in to a USB port on yourcomputer.
1. Assemblethewirelesscardwiththealuminumplate,tohelpkeepthewirelesscardinplaceon the
board.
2. Connect the antennas to the wirelesscard.
1. InsertwirelesscardintheminiPCIExpressslot.Oncethewirelesscardisinsertedintothe
MiniPCIExpressslot,pressthewirelesscardgentlytowardstheboarduntilitlocksinplace.
To enable Wi-Fi
connmanct1>enable wifi
To scan Wi-Fi connmanct1+
scan wifi
Type“pinggoogle.com”intheshelltoseeifIntelRoGalileoGen2isalready connected
tointernet.
IoT Lab (IT-705)
EXPERIMENT No. :04
Aim: - To study of IoT Data Logging using Beaglebone Black and Thingspeak.
Apparatus Used -
1. BeagleboneBlack
2. USBcable
3. Breadboard
4. Light DependentResistor(LDR)
5. 10KResistor
6. PC with internet connection and Puttyinstalled.
7. Latest Debian distribution of Linuxinstalled.
Theory:-TheBeagleBoneBlackisuniqueinthatithasquiteafewpinsthatareavailableoneasyto
usepinheaders,aswellasbeingafairlypowerfullittlesystem.Thereare2x46pinsavailable(well, not all of
them are, but we’ll get to that later) touse.
Some of the functionality that is available:
1. 7 AnalogPins
2. 65 Digital Pins at3.3V
3. 2xI2C
4. 2xSPI
5. 2x CANBus
6. 4Timers
7. 4xUART
8. 8xPWM
9. A/DConverter
Setting up Thingspeak
Thingspeakisafreeonlinecloudservicethatletsit’suserstocreatedatachannelswhichtheycanconnect
withtheirdeviceswiththeuniqueAPIKeygeneratedwitheachchannel.Theconnecteddevicejustneedto
sendanHTTPPOSTrequestalongwiththeAPIkeyandthedatatoupdatethedatachannels.Don’tworryif
itlookstoocomplicated. Let’smakeitsimple.
CreateaThingspeakaccountbyclickingongettingstarted.Nowyouwillbeaskedtoregisteryourselfwith thingspeak.
After you are registered you will be with a screen like this.
Now click on the "New Channel" button. You will have a form like this.
AfterfillinguptheNameyoucansavethechannelbyclickingon"SaveChannel".Ihavegivensomeextra
parametersforunderstandingbutitisnotmandatory.
Nowyouwillgetawindowlikethis.Inthiswindowyoucavisualizeyourchannelfeed.Ifyouwanttotweak
yourwindoworaddsomemorechartsyouarefreetocheckoutthedocumentations.Fornowwewill proceed with
the basicwindow.
Now Click on the "API Key" tab to open a window like this
now follow the wiring diagram as shown below
NowstartupyourBeagleboneBlackandLoginwithyourIDandpassword.ConnectyourBBBto theinternet.
Open Putty
Software Requirement: IBM Watson loT Platform cloud-hosted service, Cloud Foundry apps, A
smartphone.
Theory:-
HowyoucansendsensordatathatisgeneratedbyyoursmartphonetotheIBMWatsonIoT Platformcloud-
hostedservice,andthencreateCloudFoundryappsontheIBMCloudthatprocess,
visualize,andstorethedata.Lastly,itshowsyouhowtocreateanAndroidapplicationforasmartphone. Here is an
overview of thearchitecture:
Procedure:
Enteranameforyourapplication.Becausethisnameisalsousedasthehostname,itmustbe
uniquewithintheIBMCloud,forexample,“iot“.Forexample,Imightuseiottutorialdaniel.
Click Create.
After your app is created, in the left pane, click Overview. Notice that your app contains two
connections, one to a Cloudant NoSQL database and another to an Internet of Things
Platform service.
Add a device that will send MQTT messages to the Watson IoT Platform
IntheOverviewviewofyourapp,underConnections,clicktheInternetofThingsPlatformservice,
namedsomethinglikeiot<_yourname=”name”>-iotf-serviceiot<yourname>-iotf-service.
Adevicetypeisagroupofdevicesthatsharecharacteristics;forexample,theymightprovidethe
samesensordata.Inourcase,thedevicetypenamemustbe“Android”(thisdevicetypenameis required
by the app that you will uselater).
1. Click Next.
Apageisdisplayedwhereyoucanentermetadataaboutthedevicetype,suchasaserialnumberormodel.
Youdon’tneedtospecifythisinformationforthisdemo.JustclickDone
1.ClickRegisterDevices.EnterthedeviceID.ThedeviceIDcanbe,forexample,theMACaddressof
yoursmartphone.However,itmustbeuniquewithinyourorganizationonly.Therefore,youmight
enter,asIdidhere,somethinglike“-----------------”.
ClickNext.Apageisdisplayedwhereyoucouldentermetadataaboutthe
device. Leave it blank, and clickNext.
Click Next.
Provideavaluefortheauthenticationtoken.Rememberthisvalueforlater. Then,
clickNext.
ClickDone.
Click Next. A page is displayed where you could enter metadata about the device. Leave it blank,
and click Next.
Provide a value for the authentication token. Remember this value for later. Then, click Next.
Click Back.
Now you are ready to send MQTT messages from a device to the IBM Watson IoT Platform.
1. Onyourphone,gotoSettings>Security.UnderDeviceAdministration,enableUnknownsources.
Nowyoucaninstall.apkfilesfromoutsideofGooglePlay.
2. Openthebrowseronyourphone,andenterthisURL:
Verify that messages are being sent from your smartphone to the Watson loT Platform
1. Backonyourcomputer,opentheIBMWatsonIoTPlatformpageforyourorganizationagain(see the
start of).
2. Intheleftmenu,clickDevices.YourAndroiddeviceisdisplayed.
On the Node-RED page for your IoT app, click Co to your Node-RED flow editor.
The editor opens, containing a sample flow.
Using the drag-and-drop features of this editor, you can plug together a flow of
messages. Although you can create your own flow here, we will import the code
below. But first, select all existing nodes, and delete them by pressing the Delete
key.
1. Download the following code (as a long single line of code) as a textfile
(nodeRedCode . cxc) FOlTlGitHub.
In the Node-RED editor, press Ctrl-I to open the Import Nodes dialog. Paste the
code, and click Import.
ClickDeployinthefloweditor.Theflowisdeployedandshouldbeactive immediately.
Move your smartphone around; flip and tilt it. The background color of the app
on your phone should now change colors, depending on the orientation of the z-
axis.