Open Source Electronics for Laboratory Physics Chapter 1
Open Source Electronics for Laboratory Physics Chapter 1: Open Source Electronics Dr. John Liu Saint Cloud State University, MN, USA zliu@stcloudstate. edu AAPT workshop W 03 July 26, 2014
Agenda �CH 1: Introduction to open source electronics �CH 2: Basics of programming �CH 3: Sensors �CH 4: Open source physics laboratory platform �CH 5: Apparatus developed with OSPL �CH 6: Opportunities, ideas, limitations � 10 minutes at the end of each hour for breaks and soldering practice
Challenge! Learn laboratory physics skills in 40 hours! Restrictions: • You can’t use your current knowledge level. Start at level 1. • You can only practice your skills at 2 hours a week. • Your hours are fixed, you show up whether you like it or not. • If you get stuck, or you come unprepared, you can’t pause. • If you made a mistake, fix it within the 2 hour limit, hurry! • There is only one instructor, your clock ticks while you wait for an answer. • You can try to ask other students but they are just as busy. • Next week you spend 2 hours on a different topic. • Good luck! You will need it sometimes.
CH 1: Open source electronics Electronics here represents circuit board designs Designers release design files under public licenses Global online forums support new and experienced users Dramatically reduce cost on lab data acquisition systems Users may modify designs to meet their needs Dramatically expand sensor selections 3 -axis accelerometer, 3 -axis magnetic sensor, 3 -axis gyroscope, barometer Paid $13, requires 4 wires.
Why open source electronics? �Very low cost to use and flexible to modify �Many compatible hardware and expanding �Active learning communities exist �Many learning materials already exist, providing basis for creating teaching and learning content �Some educational institutions have already started using open source electronics in teaching
What about closed source? �Proprietary designs are not released to the public and products are very expensive. �There is no way to modify the design or learn from existing designs. �Little to no community support. �End users have minimal influence in the design and future directions of the products they use. �Why did you change all the plugs? !
Example open source electronics �Arduino: microcontroller development platform �Beagle board, Raspberry pi: open source single-board GNU/Linux computer �Open source physics laboratory platform: lab data acquisition system based on Arduino �Rep. Rap: open source 3 D printer �Openmoko: open source mobile phone
Arduino �Arduino is the most recognized open-source physical computing platform for artists and DIY hobbyists �Arduino can interface with many types of sensors �Arduino can control many actuators �Arduino uses open source C/C++ (AVR GCC) �Arduino has a massive online support forum �There are numerous learning materials online �Arduino is used by many educational institutions
People use arduino to make: �Interactive art pieces, museum interactive displays �Internet of things (sensors and actuators connected to the internet) �Robots, automated lawn mowers, UAVs, quadracopters �Laser harp, Theremin, MIDI device, talking electronics �Data loggers, reverse geocache boxes, lab and research apparatus �Wearable electronics, 3 D printers, liquor dispensers, automated chicken coop doors, aquaria, bomb props,
Google arduino project:
Arduino Uno $30+ � 16 MHz 8 -bit microcontroller � 2 KB SRAM � 1 KB EEPROM � 32 KB FLASH � 20 total input/output � 6 10 -bit Analog inputs �Serial port via USB �SPI interface (SD card, Wi-Fi, Ethernet etc. ) �I 2 C (real time clock, accelerometer, gyroscope etc. )
Arduino Uno � 16 MIPS for most operations, except for floating point �Stores (in 2 KB SRAM ) up to 1, 000 analog values �Non-volatile storage (1 KB EEPROM) for settings �Program space stores about 3, 000 lines C/C++ code �Connect up to 20 simple digital sensors and actuators � 5 m. V accuracy for up to 6 analog sensors �Serial port via USB (program upload and data logging) �SD card, Wi-Fi, Ethernet etc. �Real time clock, accelerometer, gyroscope etc.
Arduino shields �Sits on top of an arduino �Adds functionality to arduino, such as Ethernet, Wi. Fi, SD card, xbee, real time clock, motor control, display, GPS, GSM, Bluetooth, RFID, MIDI, VGA, TV etc. �Many shields are designed by 3 rd party
EAGLE CAD software �Printed circuit board design software �Arduino boards are many other compatible hardware designed with this software �Free license covers non-commercial use �Many online tutorials to get started �Many existing parts and components libraries to use
Raspberry pi �Very popular single-board GNU/Linux computer �Designed to help kids learn computer and programming �Supports most USB hardware such as flash drive, keyboard, mouse, Wi-Fi adapter, Arduino etc. �Programmed with C/C++, Perl, Ruby, Python etc. �Provides a lot of GNU/Linux software �Decent community support forum �Growing number of projects
People use Raspberry pi to make: �Game consoles, multimedia players, info displays �Internet of things (sensors and actuators connected to the internet) �Robots, automated cars etc. �Portable computers �Data loggers, lab and research apparatus �Liquor dispensers, automated chicken coop doors, aquaria, home automation, hacks and fun stuff
Google raspberry pi project:
Raspberry pi model B $35+ � 700 MHz 32 -bit ARM processor with GPU � 512 MB RAM �USB 2. 0 ports �Ethernet port �SD card slot �HDMI and RCA video outputs �Stereo audio outputs �Display and camera connectors �General purpose digital I/O (3. 3 V) �I 2 C and SPI interfaces (3. 3 V)
Arduino vs. Raspberry pi Arduino UNO Raspberry pi B Crucial difference Real time, no OS Multi-tasking OS Digital I/O MHz Dep. library and programming language Analog input 6 channel 10 -bit Needs extra hardware Processor 16 MHz 8 -bit 700 MHz 32 -bit with GPU RAM 2 KB 512 MB Code space 32 KB SD card and ext. drive Repairs MCU replaceable No replaceable parts Display Extra hardware and very basic HDMI, RCA and display connection Sound Remember classic Nintendo? Stereo audio USB devices Very few devices are supported with extra hardware and libraries USB 2. 0 host ports. Add anything that has ARM-Linux driver Networking Extra hardware, limited HTTP functions Ethernet, HTTP, FTP, Wi-Fi via USB File system Extra hardware and very basic library Linux file system on SD card etc. Remote access Very difficult! It is Linux! Yes!
Open source physics lab �Based on Arduino project (same specification) �Runs Arduino code and compatible with many Arduino hardware and sensors �Rugged design to survive student lab environment �On board micro-SD card slot for data logging �LCD and rotary encoder for easy user interface �No loose wires, exposed circuits, or breadboards �Compatible with Vernier and some PASCO sensors �Compatible with more modern sensors �Twice award winner at AAPT apparatus competition
Capability: �Wired data transfer �Wireless data transfer (Bluetooth) �Elegant enclosure and rugged design �DIN-5 connectors compatible with generic and Vernier analog and digital sensors �Works with countless modern I 2 C sensors. �Standard Firmware �Write your own project code
OSPL 1. 0 AAPT 2012
OSPL 2. 0 1 -2 hr DIN-5 connectors, power barrel, on/off, USB port, Bluetooth (internal) DIN-5 plugs won’t fall off like jumper wires on an Arduino! Enclose AAPT 2013 Apparatus competition award and low cost winner
OSPL 2. 1 �Improved integration with Arduino Nano module instead of separate MCU and USB/TTL module �SD card is integrated on board and ready to use �Surface mount components replaced most thru-hole components for future automated assembly Power barrel, Mini-USB port, DIN-5 ports Micro-SD card, power switch
Arduino vs. OSPL V 2. 1 Arduino UNO OSPL V 2. 1 Crucial difference Jumper wires (weak!) DIN-5 plugs (40 N insertion/extraction force) Digital I/O 20 6 Analog input 6 6 Display Extra hardware and costs 6 pins 16 X 2 display already mounted ready to use Buzzer Extra hardware and costs 1 pin Beep! Included ready to use SD card Extra hardware and costs 4 pins Micro-SD card slot included ready to use Bluetooth Extra hardware Included in the unit User input Extra hardware, rotary encoder costs 3 pins Rotary encoder ready to use I 2 C sensors Use jumper wires DIN-5 plug (channel 2) Robustness Easy to short circuit without enclosure Enclosed in rugged enclosure Battery power Extra hardware, exposed, needs 1 extra pin, resistors and wiring to sense battery level Enclosed with power switch and battery sense on pin A 6 Will it survive students? Probably not for high school or college introductory physics labs Designed for labs
Firmware: �Standard firmware is compatible with Vernier sensors �Many Vernier sensors can be selected from a list. �Sensors not on the list requires a simple conversion. �I 2 C sensors including 3 -axis accelerometer, 3 -axis magnetic sensor, 3 -axis gyroscope, barometer, and a lot more will be included in future firmware release �Use your own sensor is very easy with 4 -5 lines of code
- Slides: 26