Download presentation
Presentation is loading. Please wait.
Published byGriffin Snow Modified over 8 years ago
1
Computers are Free (Well, really really cheap) Paul Lourd WB2JVB GNARC May 2016
2
Agenda Microcontrollers vs Single Board Computers Arduino Raspberry Pi And the Kangaroo
3
Why have hams taken to this? 1 – Hams love to tinker with new things, especially things with a low entry price! 2 – It requires programming (which many hams have done at one time or another) 3 – Electronics knowledge is usually required. Simple concepts to us, like Ohms’s law, voltage, current, resistors, caps, etc are foreign to many people.
4
What can you do with Arduinos or Raspberry Pis? 4 Jasper – Voice Controller powered by Rpi https://jasperproject.github.iohttps://jasperproject.github.io LED Cube - http://www.instructables.com/id/Led-Cube-8x8x8/http://www.instructables.com/id/Led-Cube-8x8x8/ Flamethrower Jack-O-Lantern - http://www.instructables.com/id/Flamethrowing-Jack-O-Lantern/http://www.instructables.com/id/Flamethrowing-Jack-O-Lantern/ Arduino RC- Lawnmower http://www.instructables.com/id/Arduino-RC-Lawnmower/http://www.instructables.com/id/Arduino-RC-Lawnmower/ Fermentation Monitoring - https://www.sparkfun.com/tutorials/131https://www.sparkfun.com/tutorials/131 Raspberry Eye - https://hackaday.io/project/865-raspberry-eyehttps://hackaday.io/project/865-raspberry-eye
5
Single-Board Computer vs Microcontroller What is the difference? 5 Microcontrollers Single-board Computers
6
Single-Board Computer vs Microcontroller Single-board computer Lots of processing power Has operating system (Linux, Android, Windows 10) Multitask Video Connection USB, Networking, etc But, it also has GPIO pins (connect/control things!) Microcontroller Devoted to having GPIO pins Low memory, slow processor Low power, quick boot Single Task Cheap and Reliable 6
7
Arduino UnoRasp Pi 3 Processor Speed16 Mhz1.2 Ghz + Onboard Storage32 KbFlash, SD cards ~Gb Memory (RAM)2 Kb~ 1 Gb Power Consumption 12 mA (2200 mAh battery -> 183hr) 500 mA+ (2200 mAh battery-> 4.4 hr) Reboot Time<1 sec~ Multiple seconds Other FeaturesOperating system Extendable Storage WIFI/USB/BT Connection Single-Board Computer vs Microcontroller
8
8 USB 7-12 v 3 v GRD 5 v Analog Input Pins Digital Input/Output Pins Pins with ~ are PWM [Analog Output] GRD Transmitter/Receiver Serial Connection
9
Did I Say Cheap?
10
But Buy a Real One
11
So now what? Do hams ever buy anything they don’t really need? So what are you going to build? Blinkie lights get boring Many sample projects on the net are silly (Flamethrowing Pumpkin) Find something you need to do In my case, it was model train stuff
12
Controlling Lego train with IR LED Problem: Train uses batteries - show is on all day – need to pause trains (See video now) Solution: Use Arduino to run trains on a schedule Choices: Use a servo to turn the orange wheel, or generate the IR directly
13
I Found the LEGO IR protocol
15
Libraries to the Rescue (don’t reinvent the wheel) The Arduino community is very active, and there are libraries for almost anything you can think of: Servo control Stepper motor RF applications LCD Display I2C protocol GPS etc. And of course, there was some nut who wrote the Lego Protocol !! lego.SingleOutput(0, PWM_FWD4, BLUE, CH1) Sets the engine on Blue/Channel 1 to speed 4 On to the Demo…..
16
Arduino daughter boards (“Shields”) Additional functionality is added with hardware shields: Wifi, Ethernet, Bluetooth, TFT displays, GPS, Motors, Sound/Music Designed to “snap on”
17
Getting started Think of a project other than blinking LEDs! Buy a kit from: www.adafruit.com or www.sparkfun.com www.adafruit.com www.sparkfun.com You will get a breadboard, lots of components and jumpers Run through the tutorials and examples Review some coding examples if you are not a coder. It is not hard, but it is precise Read a book! $85
18
Microcontrollers – Many Choices 18 Beetle Texax Instruments LaunchPad Pinguino PIC32 Ruggeduino Gamebuino Advice for newbies: Stick with the Arduino Freescale Freedom Teensy Nanode
19
Raspberry Pi As we have discussed, it’s a full blown (small) computer running Linux distribution called Rasbian (based on Debian) Some other operating systems as well, like stripped Win 10 You can use it for controlling things, like GPIO pins, but it might be overkill Or keep in the shack to leave web pages running (weather, spotting, etc). New Pi 3 has lots more connectivity. No longer requires USB hubs to get things done 1.2 Gig processor and 1gig RAM, HDMI, WiFi, BT, CSI Cam port, 10/100 LAN Micro CD card for the OS and storage (issues with corruption) And still painful to use for anything heavy. Audio and video not the best for streaming.
21
Interfacing Options GPIO (General Purpose Input/Output) GPIO GPIO pins can be configured to be input or output GPIO pins can be enabled/disabled Input values are readable (typically high=1, low=0) SPI (Serial Peripheral Interface) SPI A synchronous serial data link, that operates in full duplex mode It is used for short distance, single master communication, for example in embedded systems, sensors, and SD cards SCLK / MOSI / MISO / SS Serial Clock (output from master) Master Output, Slave Input (output from master) Master Input, Slave Output (output from slave) Slave Select (active low, output from master) I 2 C (Inter-Integrated Circuit) I 2 C I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL)
22
Prototyping Aids
23
All sorts of ways to measure your environment SensorApprox Price TMP36 Temperature Sensor£1.50 BMP180 Temperature & Pressure£8 Triple Axis Accelerometer£7-20 Adafruit Ultimate GPS Breakout£34 Digital Light / Luminosity / Lux Sensor£8 Passive IR Motion Sensor£7 IR Distance Sensor (10-80cm)£10 IR Receiver£2
24
Programming is with Python import RPi.GPIO as GPIO import time # blinking function def blink(pin): GPIO.output(pin,GPIO.HIGH) time.sleep(1) GPIO.output(pin,GPIO.LOW) time.sleep(1) return # Use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # Set up GPIO output channel GPIO.setup(7, GPIO.OUT) # Blink GPIO17 10 times for i in range(0,10): blink(7) GPIO.cleanup()
25
Too many examples, here is a cool one def ModifyWatering(): print "\nLast rain from forecast timestamp: " + str(lastRain) print "Current Time: " + str(time.time()) print "Days since last rain: " + str((time.time() - lastRain)/86400 ) print "Seconds since last rain: " + str(time.time() - lastRain) print "Days disabled in seconds: " + str(daysDisabled * 86400) print "Has NOT rained within daysDisabled range: " + str(time.time() - lastRain >= daysDisabled * 86400) if(rainForecasted == False and time.time() - lastRain >= daysDisabled * 86400): print "Hasn't rained in a while, and not expected to rain. Watering enabled." GPIO.output(7,False) ## Turn off relay switch, enable watering GPIO.output(13,True) ## Turn on green light GPIO.output(15,False) ## Turn off red light else: GPIO.output(7,True) ## Turn on relay switch, disable watering GPIO.output(13,False) ## Turn off green light GPIO.output(15,True) ## Turn on red light if(rainForecasted): print "Rain is forecasted, or raining today. Watering Disabled" else: print "Rain not in forecast, but it has rained recently. Watering Disabled"
26
There are others – Same Concept Beaglebone Black Beaglebone Black Processor1GHZ Flash Memory 2GB 8-bit eMMC on-board storage RAM512MB DDR3 Other Features Open Hardware Architecture 1x USB port 92x GPIO pins Price (approx, USD)$45.00 26 http://beagleboard.org/
27
The Best Deal Going for a “Utility PC” Full Windows 10 computer. - USB WIFI Bluetooth HDMI 2 gig memory 32 gig SSD Micro SD slot - $99 when in stock at NewEgg $139 at Amazon - No learning UNIX, everything runs on it! - But not for controlling devices – no GPIO pins
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.