15
Arduino Basics Lecture 5 BME 372 New Schesser 116

Arduino Basics - web.njit.edujoelsd/electronicsnew/Classnotes/Lecture 5.pdfArduino • Arduino is an open-source hardware and software company1 • Builds single board microcontrollers

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

  • ArduinoBasics

    Lecture5

    BME372NewSchesser 116

  • Overview

    •  Learnhowtouseamicroprocessorsystem/platformdevelopmentboard

    •  ArduinoUNO•  Hardware•  Software•  Projects

    BME372NewSchesser 117

  • Computers•  Whatisacomputer

    o FastNitwitq Performinstructionsveryquicklyq Needstobetoldwhattodo.

    •  Computertypeso Mainframeso Minicomputerso PersonalComputerso Microprocessors

    •  Allhavesimilarhardwareandneedsoftwareorprogramstooperatethem

    BME372NewSchesser 118

  • ComputerHardware•  MainComponentsCircuits

    o  CentralProcessingUnit(s)–CPUq  Thisiswheretheinstructionsareperformed

    o  Memory–RandomAccessMemoryandReadOnlyMemoryq  Thisiswherethedataandprogramthatisrunningisstored

    o  Timer/Clockq  Thisisthehardwarethatcoordinatesthecomputeroperations

    o  Dataandcontrolbusesq  Thisisthedigitalhighwayswheredataandcontrolmessagestransferwithinthe

    computero  InputandOutputinterfaces–I/Oports

    q  Thisisthedigitalhighwaysandconnectionstoenterdataanddisplayresults•  PeripheralEquipment

    o  Keyboardso  Monitorso  DiskDrives

    BME372NewSchesser 119

  • GeneralPurposeComputersVsSpecialPurposeComputersVsMicroprocessors

    •  Generalpurposecomputersaredesignedtohandleavarietyoftasks.

    •  Specialpurposecomputerswhichcanbeprogrammedtoperformadesiredtask.

    •  Ingeneral,amicroprocessorfallsintotheSpecialPurposeComputerclass.

    •  VariousMicroprocessorso  Intel8088o ZilogZ80o Motorola6800o Etc.

    BME372NewSchesser 120

  • MicroprocessorSystemsorPlatforms

    •  Microprocessorscontaincomponentstoafforddevelopmentofcomputerbasedsystems.

    •  Varioustypeso Arduinoo RaspberryPio Etc.

    BME372NewSchesser 121

  • Arduino•  Arduinoisanopen-sourcehardwareandsoftwarecompany1

    •  Buildssingleboardmicrocontrollersandmicrocontrollerkits1

    •  Arduinoboarddesignsuseavarietyofmicroprocessorchipsandcontrollers.1o Unoo MegasimilartotheUnobutbiggerwithmoreI/Oporto  Lilypadusedforwearableprojectso NanosmallerthantheUnoo Etc.1wikipedia.org/wiki/Arduino

    BME372NewSchesser 122

  • ArduinoBoardHardware

    BME372NewSchesser 123

  • ArduinoBoard

    BME372NewSchesser 124

  • ArduinoBoard•  Microprocess

    or:ATmega328P

    •  USBPort:

    ConnecttoComputer

    BME372NewSchesser 125

  • ArduinoBoard•  ResetButton:

    Resetstheprogrambutdoesnotremovetheprogramfrommemory

    •  DCPower:

    ConnecttoexternalDCPowerSource

    BME372NewSchesser 126

  • ArduinoBoard•  DigitalPins:Canbe

    usedasaninputoroutputandcantakeononeoftwovalues:0or5volts.NotethatPins0and1canbeusedforserialcommunications.

    •  AnalogInPins:Used

    asanAnaloginputandcantakeonanyvaluefrom0to5volts.

    •  PowerPins:Provides5volts,3.3voltsandGroundReference

    BME372NewSchesser127

  • ArduinoBoard•  ONLED:When

    illuminatedindicatesthattheArduinoisoperating

    •  RXandTXLEDs:

    IndicatesthattheArduinoisreceiving/transmittingData(e.g.whentheprogramisdownloadedfromthecomputer

    •  LLED:ProgrammableLEDviaDigialpin13

    BME372NewSchesser 128

  • PulseWidthModulation

    •  Someofthedigitalpins(~3,~5,~6,~9,~10,~11)withtildescanoutputaPWMsignal

    BME372NewSchesser 129

  • PulseWidthModulation•  50%DutyCycle•  25%DutyCycle

    •  75%DutyCycle

    •  100%DutyCycle

    BME372NewSchesser 130

    •  PWMisa(approximately)490Hzsquarewavewhereaportion(percentage)ofthesignalishighwhiletheremainderofthesignalislow.

    •  Thepercentageof

    thehighportioniscalledtheDutyCycle.