Top Banner
introduction to Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already!
47

introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Aug 26, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

introduction to Digital ElectronicsInstall the Arduino IDE 1.8.5 on your laptop if you haven’t already!

Page 2: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Electronics can add interactivity!

Any sufficiently advanced technology is indistinguishable from magic- Arthur Clark.

Page 3: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Electronics can add interactivity!

Any sufficiently well executed technology is indistinguishable from magic- in the eyes of kids!

Page 4: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Electronics can be complex

Page 5: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Avoid unnecessary complexity!

Page 6: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

Light BulbBattery+

-

Page 7: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

Light BulbBattery+

- LoadPower Source

Page 8: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

ResistorBattery+

- LoadPower Source

Page 9: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

ResistorBattery+

- LoadPower Source

5v330Ω

V = IRVoltage = Current × Resistance

5 = I • 330Current ≈0.015A

Volts Amps Ohms

Page 10: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-

5v330Ω

Page 11: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-

5v330Ω0v

Page 12: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-

5v330Ω0v

Page 13: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-

5v

330Ω 0v

V1

Vref

V1 - Vref = IR

Page 14: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-

5v330Ω0v

Page 15: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!

+

-330Ω

5v

0v

330Ω5v

0v

Page 16: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Let’s look at a circuit!5v

0v

330Ω

Page 17: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Time for some LIGHT!5v

0v

330ΩLED

Light Emitting Diode

Page 18: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Time for some LIGHT!

LEDLight Emitting Diode+ -

Longer is positive!

+

-

Diodes conducts current primarily in one directionNeeds resistor!

Page 19: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Time for some LIGHT!

LEDLight Emitting Diode+ -

Longer is positive!

Page 20: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!Power Rails

Page 21: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!Power Rails

Page 22: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!Power Rails

Page 23: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!

Page 24: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!

Page 25: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Now in real life!

Momentary Switch

Page 26: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

Modify your circuit

Page 27: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

A closer look…

V2

≈1.4VLED Forward Voltage Drop

V2 - VGND = 1.4V

VGND

VCC (also Vdd, Vhigh)

Voltage Common Collector(usually your power supply!)

Components have rules!≈0Ω

Page 28: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

A closer look…

V2

≈1.4VLED Forward Voltage Drop

V2 = 1.4VVCC - V2 = I • R

VGND

VCC (also Vdd, Vhigh)

Voltage Common Collector(usually your power supply!)

5 - 1.4 = I • 330I ≈ 10 mA

Components have rules!≈0Ω

Page 29: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

A closer look…

I ≈ 10 mA

VGND

VCC

V2

Page 30: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

5v

0v

330Ω

A closer look…

I ≈ 10 mA

5v

0v

I ≈ BIG NUMBER

VGND

VCC

VGND

VCC

V2

≈20mALED Max Current

V = IR

Page 31: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Digital vs Analog CircuitsAnalog CircuitsRange of voltagesUsually requires math!

Digital CircuitsUsually 2 distinct voltages (high & low)5v and 0v (roughly)0110100001101001…

Page 32: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Using your Arduino!

A Microcontroller.. or a small computer!Has inputs and outputs you can control

Teensy

Arduino NanoArduino Uno

Page 33: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Using your Arduino!

+-

Page 34: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Blink!

+-

Page 35: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Blink!

+-

+R

G B

Try making the colors alternate!

-- -

Page 36: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Blink!

+-

+R

G B

Try making the colors alternate!

-- -

+

- - -

Page 37: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Pulse Width Modulation

PWM!

Digital is only 0v or 5v, so how do we get values in between?

LEDs can only be in 2 states- on or off!

PWM to make the LED seem ‘dimmer’

50% Duty Cycle

50% of the time on, 50% of the time off

5v

0v

90% Duty Cycle

90% of the time on, 10% of the time off

5v

0v

Page 38: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

PWM

Pins marked ~ can use PWM

Page 39: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Servo and Moving Parts

Rotary actuator that allows for precise control of linear position

Arduino friendly!

Built-in Library

GND

SIGNAL (Pin 6)POWER (5V)

Page 40: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Button Inputs

Arduino

Digital Pin 8

Big resistor!> 1kΩ

What does the Arduino sense when it’s not connected to GND?

Value is floating!

Pull up resistor!

5v

Page 41: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Button Inputs

Arduino

Digital Pin 8

5v

Page 42: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Button Inputs

Arduino

Digital Pin 8

Page 43: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Button Inputs

Arduino

Digital Pin 8

Page 44: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

LED stripsA strip of LEDs

Page 45: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

Individually Addressable LED strips!Objectively pretty neat!

Integrated Circuit & I2C communication

ws2812 RGB LED

Run on 5v and can be controlled with an Arduino!

Watch out for current! Each color ~ 15mA, total 50mA on ‘white’.

Arduino max current ~1A

Page 46: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

To be Continued…Electronics Part II!

Communication

Wireless

Perf boards

Soldering

And more!

Take anything you’d like to keep with you (you can use these on your toys/sketch models)

Page 47: introduction to Digital Electronicsweb.mit.edu/2.00b/www/lectures/electronics1.pdf · Digital Electronics Install the Arduino IDE 1.8.5 on your laptop if you haven’t already! Electronics

introduction to Digital Electronics