13
HACKING MEATSPACE with Arduino and pyFirmata Ches Martin http://chesmart.in | @ches ThaiPy April 2015

Hacking Meatspace with Arduino and pyFirmata

Embed Size (px)

Citation preview

Page 1: Hacking Meatspace with Arduino and pyFirmata

HACKING MEATSPACE with Arduino and pyFirmata

!!!

Ches Martin http://chesmart.in | @ches

ThaiPy April 2015

Page 2: Hacking Meatspace with Arduino and pyFirmata

WHAT IS ARDUINO?

• A microcontroller with I/O on a PCB

• Electronics teaching tool

• Interactive arts & media component

• Embedded systems prototyping environmentBring your Internet of Things buzzwords!

Page 3: Hacking Meatspace with Arduino and pyFirmata
Page 4: Hacking Meatspace with Arduino and pyFirmata

OPEN HARDWARE

• Specifications available to build your own

• Take your prototypes to productionno licenses needed

• Build a prototype, minimize it, design PCB, get it fabricated

• Open source software toolchain

Page 5: Hacking Meatspace with Arduino and pyFirmata

WHAT’S A MICROCONTROLLER?

• Processor with program and data memory onboard in one chip

• Usually runs a single program, no operating system

• Most Arduinos are Atmel AVR family, 8-bit RISC

• Arduino AVR chips also have EEPROMnon-volatile storage, persists across power-offs

Page 6: Hacking Meatspace with Arduino and pyFirmata

HOW DOES ARDUINO COMPARE TO OTHER PLATFORMS?

• Spark, Wiring, etc.AVR & other microcontroller alternatives

• Raspberry Pi, BeagleBone, Intel Edison Single-board computers or microcontroller hybrids

Page 7: Hacking Meatspace with Arduino and pyFirmata

ELECTRONICS FUNDAMENTALS

• General-purpose IO (GPIO), analog & digital pins

• Digital pins generally read or write on/off (high/low) statesSimple two-way sensors like buttons

• Analog reads voltages 0-5V, translated to values 0-1023 (10-bit res. ADC)Continuous sensors, common real-world phenomena

• Pulse Width Modulation Switches on/off thousands of times per sec, simulating wave behavior of analog outputDimming, controlling speed of motors

• i2c (Two-wire Interface or TWI) is a special function Allows connecting network of many sensors/actuatorsCan also network many Arduino boards

Page 8: Hacking Meatspace with Arduino and pyFirmata

DEVELOPING WITH ARDUINO

• Standalone (Embedded) Projects

• Client / Server Projects

Page 9: Hacking Meatspace with Arduino and pyFirmata

STANDALONE PROJECTS

• Arduino language and IDE (C++)

• AVR C and assembly avr-gcc / avr-libc toolchain, LLVM

Page 10: Hacking Meatspace with Arduino and pyFirmata

CLIENT/SERVER PROJECTS

• Processing, Max/MSPInteractive graphics and music environments

• Firmata • A specified serial protocol that has become a

common standard • Client libraries in numerous languages • Firmware can potentially run on other hardware

Page 11: Hacking Meatspace with Arduino and pyFirmata

DEMO TIME!

Page 12: Hacking Meatspace with Arduino and pyFirmata

RESOURCES• Part Sources in Thailand

• http://www.thaieasyelec.com/en/ • http://www.arduino.in.th/ • element14 - http://www.newark.com/ and http://th.element14.com/

• Starter Kits • Official Arduino Kit

• Video tour of Starter Kit projects with founder Massimo Banzi • Fritzing Creator Kit • Adafruit Starter Kit • Sparkfun Inventor’s Kit • Make Starter Kit

• Learning Hubs • https://learn.sparkfun.com/ • https://learn.adafruit.com/ • http://forum.arduino.cc/ and http://www.element14.com/community/groups/arduino • http://wiring.org.co/learning/tutorials/ • http://www.instructables.com/tag/type-id/category-technology/channel-arduino/

Page 13: Hacking Meatspace with Arduino and pyFirmata

RESOURCES• Electronics Fundamentals

• https://learn.sparkfun.com/tutorials/what-is-an-arduino • https://processing.org/tutorials/electronics/ • https://learn.sparkfun.com/tutorials/serial-communication

• Hardware Info and Specs • Atmel AVR on Wikipedia • Atmel official AVR pages - specs, data sheets, etc.

• Software Resources - Libraries, Tools • Explanation of Arduino Build Process • Examples of Arduino Language & Library Usage • AVR LLVM backend • Firmata Spec • Firmata Libraries

• https://github.com/tino/pyFirmata and examples helpful for starting out • http://artoo.io/(Ruby) • http://gobot.io/ (Go) • http://cylonjs.com/ (JavaScript) • https://github.com/rwaldron/johnny-five (JavaScript)

• Fritzing - basic open-source schematic and PCB design • They aim to provide a complete pipeline with PCB fabrication services available

• EAGLE CAD - more advanced but an industry-standard PCB/schematic design package