the last great hardware show

30
The Last Great Hardware Show or Actually - I wasn’t supposed to be here… By Dave Appleton

Upload: dave-appleton

Post on 13-Jul-2015

82 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: The Last Great Hardware Show

The Last Great Hardware Show

or Actually - I wasn’t supposed

to be here…

By Dave Appleton

Page 2: The Last Great Hardware Show

Held at the NUS School of Computing

room /dev/tty.usbserial-A4013057

@COM1:

Page 3: The Last Great Hardware Show

Who Am I

• Dave Appleton

• Wrote my first program in 1968

• Research and Development since 1980

• Working in Singapore startups since 1986

• Living in the twilight zone…….

• Hobby : getting people interested in new things

Page 4: The Last Great Hardware Show

What I am going to do

• Tell long winded stories

• Make a few really bad jokes

• Talk fast about what you are going to see

• Hope you don’t notice when it fails to work…

Page 5: The Last Great Hardware Show

What The Heck?

• Some Basic Electronics

• Using Cheap Stuff to build REAL Equipment(and learning something along the way).

• Making Some Noise….

• How can YOU get started?

Page 6: The Last Great Hardware Show

Leading up to this

• 2011 - met Michael Cheng @ Hackerspace, started conducting Arduino classes

• 2012 - first GeekCamp - Arduino Controlled Racing Cars - Only hardware talk

• 2013 - met Adnan, GeekCamp - Raspberry Pi and Raspy Juice - Two hardware talks

• 2014 - lots of new groups, Makerspaces etc. Many Hardware talks by people who do a lot more than I do.

Page 7: The Last Great Hardware Show

Basic Electronics

• OHMS LAWCurrent / Voltage / Resistance

• This is key to EVERYTHING

100 Ohm

5V

0V

5/100A =

50 mA

Page 8: The Last Great Hardware Show

Basic Power

• POWER = V x I = 5 x 50 / 1000= 0.25 W

• V x I = I x R x I = V x V / R

100 Ohm

5V

0V

5/100A =

50 mA

Page 9: The Last Great Hardware Show

Yeah - OK - Why

• We are going to build a curve tracer and use it to look at some stuff we use without thinking about it.

• Then (hopefully) we will understand what we are doing and stop making some basic mistakes.

Page 10: The Last Great Hardware Show

The curve tracer

ioblocks.blogspot.com

Page 11: The Last Great Hardware Show

Using an Arduino

VcVcc (5v)

VbVin

Page 12: The Last Great Hardware Show

All of this is…

Very interesting - explains why we can use transistors to amplify current or voltage…

but it’s textbook stuff

Page 13: The Last Great Hardware Show

And we all know

m

Vbig

0vSimple motor control using

Arduino (PWM) and transistor

Page 14: The Last Great Hardware Show

Tachometer Project by

Hassan Mohammad a student in Egypt

Page 15: The Last Great Hardware Show

LED……• A typical LED takes a current and lights up. For a

while it gets brighter as you apply more current but then it burns out. You control the resistance using a resistor. How does it work?

Vcc

R

LED

0v

~1V

If LED needs 20 mA Vcc = 5v,

R = 4v/(20mA) = 200 ohms

WHY 1 v ?

Page 16: The Last Great Hardware Show

LED Curves

Vcc

R

LED

0v

~1.8V

Page 17: The Last Great Hardware Show

LED Curves

Page 18: The Last Great Hardware Show

Implications

Vcc

R

LED

0v

LED

0v

Vcc

R

LED

0v

R

LED

0v

Page 19: The Last Great Hardware Show

Vcc

R

LED

5v

TTL Logic Gate

Vcc

R

LED

0v

Should we do this? or This?

Page 20: The Last Great Hardware Show

TTL GATE OUTPUTYou can test gates either powered on or off

LSTTL specifications : VOH > 2.4v VOL < 0.4v IOH < 16 uA IOH > 16 mA

If you source too much current you will not keep your voltage and you may damage the gate

Page 21: The Last Great Hardware Show

For TTL you SINK

Vcc

R

LED

5v

TTL Logic Gate

Vcc

R

LED

0v

OK

Page 22: The Last Great Hardware Show

END OF PART I

Page 23: The Last Great Hardware Show

HOW CAN YOU GET STARTED ?

What to Buy and What to do…

Page 24: The Last Great Hardware Show

Too Old To Start?

• Yeah, I know you are in your thirties and it is really hard learning new stuff at that age and all that.

• My Dad got his first computer at 73 years of age back in 1986. It ran CP/M and he used it regularly.

Page 25: The Last Great Hardware Show

Raspberry Pi

• The Raspberry Pi is a REAL Computer that runs linux but is very cheap. You can run almost all your favourite programming languages AND do hardware….

• Two demos to be shown.

• A kinda cheapo web based juke box

• Really simple starter for Hardware on the Pi

Page 26: The Last Great Hardware Show

Web Based JukeBox

• Server written in Go

• Uses Gstreamer library for the sound - everything else is simple.

Page 27: The Last Great Hardware Show

Hardware on the Pi

• Two simple demos to turn on and off an LED

• One in Python

• One from the command line ! NO CODE !

Page 28: The Last Great Hardware Show

GPIO in python

# LED on Pin 18 of Pi Connector

$ sudo python

>>> import RPi.GPIO as GPIO

>>> GPIO.setup(18, GPIO.OUT)

>>> GPIO.output(18, True)

>>> GPIO.output(18, False)

Page 29: The Last Great Hardware Show

GPIO without code!

# LED on Pin 18 of Pi Connector

sudo sucd /sys/class/gpio echo 18 > export cd gpio18echo out > direction echo 1 > value echo 0 > value

Page 30: The Last Great Hardware Show

So….

• What is stopping you?

• Raspberry Pi & Arduino available in many places including Element14 and 12Geeks

• Loads of Tutorials

• User GroupsHackerspace

Makerspace

Singapore Arduino Group

Raspberry Pi & Co

Arduino for Beginners

..and more