the last great hardware show
TRANSCRIPT
The Last Great Hardware Show
or Actually - I wasn’t supposed
to be here…
By Dave Appleton
Held at the NUS School of Computing
room /dev/tty.usbserial-A4013057
@COM1:
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
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…
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?
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.
Basic Electronics
• OHMS LAWCurrent / Voltage / Resistance
• This is key to EVERYTHING
100 Ohm
5V
0V
5/100A =
50 mA
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
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.
Using an Arduino
VcVcc (5v)
VbVin
All of this is…
Very interesting - explains why we can use transistors to amplify current or voltage…
but it’s textbook stuff
And we all know
m
Vbig
0vSimple motor control using
Arduino (PWM) and transistor
Tachometer Project by
Hassan Mohammad a student in Egypt
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 ?
LED Curves
Vcc
R
LED
0v
~1.8V
LED Curves
Implications
Vcc
R
LED
0v
LED
0v
Vcc
R
LED
0v
R
LED
0v
Vcc
R
LED
5v
TTL Logic Gate
Vcc
R
LED
0v
Should we do this? or This?
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
For TTL you SINK
Vcc
R
LED
5v
TTL Logic Gate
Vcc
R
LED
0v
OK
END OF PART I
HOW CAN YOU GET STARTED ?
What to Buy and What to do…
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.
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
Web Based JukeBox
• Server written in Go
• Uses Gstreamer library for the sound - everything else is simple.
Hardware on the Pi
• Two simple demos to turn on and off an LED
• One in Python
• One from the command line ! NO CODE !
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)
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
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