electronics 101 for software developers

41
Dror Helper [email protected] | @dhelper | http://blog.drorhelper.com Electronics 101 for software developers

Upload: dror-helper

Post on 23-Jan-2017

789 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Electronics 101 for software developers

Dror [email protected] | @dhelper | http://blog.drorhelper.com

Electronics 101 for software developers

Page 2: Electronics 101 for software developers

• Consultant @CodeValue

• Developing software (professionally) since 2002• Clean coder & Test Driven Developer

• OzCode Evangelist

• Blogger: http://blog.drorhelper.com

About.ME

Page 3: Electronics 101 for software developers

???

Page 4: Electronics 101 for software developers

We’re surrounded by itAffect the real worldConnect to your environmentControl cool gadgetsIoT, IoT, IoT!

It’s fun & easy

Why should you care about Electronics?

Page 5: Electronics 101 for software developers

INTRODUCTION TO ELECTRONICS

Page 6: Electronics 101 for software developers

Electricity & water

Page 7: Electronics 101 for software developers

What would happen if we raise one side

V

I

R

Page 8: Electronics 101 for software developers

• Electric potential energy per unit charge• Measured in Volts (V)

Voltage

V V

in

Page 9: Electronics 101 for software developers

• The quantity of charge that flows through the circuit

• Measured in Amperes (A)

Current

Page 10: Electronics 101 for software developers

Resistance

• The difficulty to pass through an electric conductor

• Measured in ohm(Ω)

Page 11: Electronics 101 for software developers

Color 1st 2nd 3rd Multiplier ToleranceBlack 0 0 0 1Brown 1 1 1 10 ±1%Red 2 2 2 100 ±2%Orange 3 3 3 1KYellow 4 4 4 10KGreen 5 5 5 100K ±0.5%Blue 6 6 6 1M ±0.25%Violet 7 7 7 10M ±0.10%Grey 8 8 8 ±0.05%White 9 9 9Gold 0.1 ±5%Silver 0.01 ±10%

Resistor values

220Ω (±5%)

4.7KΩ (±10%)

1KΩ (±1%)

330KΩ (±0.5%)

2 2×10

4 7×100

1 0×100

3 3×10K

Page 12: Electronics 101 for software developers

I X R = V

I currentR ResistanceV Voltage

Ohm Law

I

RV

I

Page 13: Electronics 101 for software developers

Using Ohm law

3ё12V

I = ?

Calculate current in the system Decide which resistor to use

R=? 12V

I = 0.024A

Page 14: Electronics 101 for software developers

The overall amount of work being done in a system in relation to timeMeasured in Watts(W)

Power

𝑃 𝑖𝑛>𝑃𝑎𝑙𝑙𝑜𝑤𝑒𝑑=𝐵𝑂𝑂𝑀 !

Page 15: Electronics 101 for software developers

Parallel circuits

R1=50ё12V R2=200ё

Page 16: Electronics 101 for software developers

Series circuit

R1=50ё

12V

R2=200ё𝐼= 12

200+50 =0 .048 𝐴V2 = ?

𝑉 2=𝐼 ×𝑅2=( 𝑉 𝑠

𝑅1+𝑅2)×𝑅2=

𝑉 𝑠×𝑅2

𝑅1+𝑅2=9 .6𝑉

Page 17: Electronics 101 for software developers

CONNECTING COMPONENTS

Page 18: Electronics 101 for software developers

Introducing the Light Emitted Diode (LED)• Allow current only in one direction• Has two legs – long leg should face

the +

Now let’s make something sparkle

+-

Page 19: Electronics 101 for software developers

1. Keeps components in place2. Connects components

Solderless breadboard

Page 20: Electronics 101 for software developers

Using a breadboardBe organized and eliminate wiring

Never short-circuit

Tip: clip components for better management

Page 21: Electronics 101 for software developers

Adjustable resistorOR

Adjustable voltage divider

The potentiometer

Page 22: Electronics 101 for software developers

Using the potentiometer

R1

V

R2

Page 23: Electronics 101 for software developers

Say hello to my little friend

Page 24: Electronics 101 for software developers

Connecting the right inputs

Page 25: Electronics 101 for software developers

Tips on using the multimeter

Measure Resistance without currentMeasure Voltage in parallelMeasure Current in series

Page 26: Electronics 101 for software developers

On demand break/connect

Push buttons/Switches

Page 27: Electronics 101 for software developers

Using buttons

Page 28: Electronics 101 for software developers

Can you guess what this is?a

b

c

d

e

f

a

g

d

bf

e c

Page 29: Electronics 101 for software developers

HELLO MICRO CONTROLLERS

Page 30: Electronics 101 for software developers

Microcontroller example: Arduino Uno

Page 31: Electronics 101 for software developers

Generic pin on an integrated circuit

Can be controlled by user at run time.

There are digital and analog pins

General purpose Input/Output (GPIO)

Page 32: Electronics 101 for software developers

Digital and analog signals

X = LOW/HIGH

0 ≤ X ≤ Max

Page 33: Electronics 101 for software developers

Using GPIO

Page 34: Electronics 101 for software developers

Using sensors

R2

R1

5v

A0

V2

Page 35: Electronics 101 for software developers

1. Where to connect the GND2. Where to connect Vin and/or Signal3. Maximum Power (V x I) resistance

Tip: try to find circuit schema online

What to look for before connecting a sensor

Page 36: Electronics 101 for software developers

RESOURCESWhere to go from here?

Page 37: Electronics 101 for software developers

How to startBuy a starter kit • Sunfounder• Sparkfun• Seeed• Make• Keyes [insert number here] in 1

Build your own kit• Breadboard, Resistors, LEDs, sensors• Google for ideas• Choose a project and go from there

Page 38: Electronics 101 for software developers

123d Circuits (https://123d.circuits.io)Fritzing (http://fritzing.org/)

Useful (and free) software

Page 39: Electronics 101 for software developers

Books

Ebooks: www.oreilly.com coupon code: TS2016 Print: www.wordery.com

Page 40: Electronics 101 for software developers

Arduino: https://www.arduino.cc/Raspberry PI: https://www.raspberrypi.org/Windows 10 IoT: https://dev.windows.com/en-us/iotMake: http://makezine.com/

Stack Exchange sites:Electrical engineering http://electronics.stackexchange.com/Raspberry PI http://raspberrypi.stackexchange.com/Arduino http://arduino.stackexchange.com/

Additional resources

Page 41: Electronics 101 for software developers

Dror HelperC: 972.05.7668543e: [email protected]: blog.drorhelper.comw: http://www.oz-code.com