Input devices¶
This is a copy of the Guillem’s class notes. You can find the latest version here
Input devices #1 [Guillem]¶
Core ideas¶
- Why we need sensors
- Neurons, I/O and Bio indicators
- Sensing the environment
- Close loop systems
- Inferring metrics
- Bike speed from counting wheel turns
- Water tank distance from distance from above
- Composed sensors
- Radar: emitter (output) and receiver (input) working in sync
- Complex post processing: Compur vision
- From a list of colors (pixel matrix) to meaningful data (i.e. object location based in color tracking)
How to choose and use a sensor¶
The section is aimed at INPUTS (sensors) but many concepts work also for OUTPUTS (motors, LEDs)
- How to choose sensor?
- Integrated circuits, breakout boards, and off-the-shelf devices
- IC Component
- Adafruit IMU Breakout
- Wii Nunchuck (check in Wallapop, Cash converters, Ebay…)
- Integrated circuits, breakout boards, and off-the-shelf devices
- How to wire a sensor?
- We will always look for well documented sensors learn.sparkfun.com, learn.adafruit.com
- Download the EAGLES from the Breakout boards to help you, example
- Electronic recipes
- How to code for a sensor?
- Fab Academy sensors
- Sensor interfaces:
- Is it on? DigitalRead
- What’s the voltage? Analog to Digital Converter AnalogRead
- How many times on? Pulses
- Tell me soDigital Communication: Serial / UART, SPI, I2C :warning: We will always use an specific sensor library implementing the comunication
Input devices #2 [Guillem]¶
Playing with your Hello Board¶
- [Code Examples] https://github.com/fablabbcn/arduino-workshops/tree/master/Hello%2044
When the ATtiny is not enough: Other microcontrollers!¶
The ATtiny can do amazing things but will require us to optimize the code to an uncessary level when we just want a protoype…
-
- Example board: HelloBoard
- FLASH 4KB
- RAM 256B
- Pro: Digital and Analog Inputs and Outputs
- Con: No Hardware I2C or Serial
-
- Example board: HelloBoard
- FLASH 8KB
- RAM 256B
- Pro: Digital and Analog Inputs and Outputs
- Con: No Hardware I2C or Serial
-
- Example board: FabDuino
- FLASH 32KB
- RAM 2KB
- Pro: Hardware I2C, Serial and SPI
- Con: No USB Hardware (requires an FTDI)
-
- Example board: Adafruit Feather M0
- FLASH 256KB
- RAM 32KB
- Pro: Multiple I2C, SPIs, Serial and full speed USB
- Con: No WIFI or Bluetooth
-
- Example board: ESP32 Feather Board
- FLASH 4MB
- RAM 520KB
- Pro: WIFI and Bluetooth
- Con: No USB Hardware (requires an FTDI)