:: Interfacing with Hardware ::
These topics cover the hardware and software setup required to connect an Arduino device with a variety of electronic parts, chips and devices. A related topic not covered under this section is the shield, boards that plug directly into an Arduino's pin layout. Information on the creation and use of specific shields belongs in that section. Information on shields in general and their creation belongs here.
Navigation
Output
Examples and information for specific output devices and peripherals: How to connect and wire up devices and code to drive them.
Visual
- Camera Control - Controlling Cameras
- LED Lights and Displays
- LCDs
- Lighting Control
- OLED
- Some code samples to control output to a small surface-mount OLED with basic hardware-level graphics functions
- Video Output
- MicroVGA Library for MicroVGA-TEXT devices, allowing Arduino to display on a VGA (LCD/CRT) monitor or a television and read keystrokes from a PS/2 keyboard.
- SID-emulator The shield contains an emulator of the audio chip in a Commodore 64. The systems allows you to create original 8-bit video and sounds programmed and controlled via the Arduino board.
- Bitmap picture display on a graphics shield
- Picaso Library for interfacing with 4D Picaso devices (including the 4D uVGA Picaso MD1)
- IR Remote Output
- IR remote library to control Sony, NEC, RC5, and RC6 devices.
Audio
- µC Hobby Arduino Sound Tutorial
- Part 1: various strategies to generating sound.
- Part 2: "hello world", simple tone generation.
- Part 3: playing a melody.
- Tone Generation Libraries
- Arduino Tone Library: A library that can be used to generate tones in the background using timers while your Arduino does other things.
- Realtime audio processing
- Synthesizers and sound generation
- MIDI
- Audio Device and Module Control
- SID
- SID-emulator The shield contains an emulator of the graphics/audio chip in a Commodore 64. The systems allows you to create original 8-bit sounds programmed and controlled via the Arduino board.
- Vintage Gameboy and SNES -like sound using Yamaha chips (YM294, YM2149)
- Gakken SX-150
Physical/Mechanical
- Motor Control
- Bipolar Stepper Motor from Floppy Drives
- Using the stepper motors from old Floppy Drives PL15S-020 bipolar stepper motors Code Link, using no external chips.
- Solenoids
- Servos
- Robot Kits
- Other
Electrical / High Power
- Relays
- Schematic for driving DC relays using a transistor connected to an Arduino pin.
- Schematic for driving 5V DC relays using an optical coupler and a transistor connected to an Arduino pin, which is protected by the optical coupler. Based on the schematic above.
- Voltage Boosters
- A simple regulated DC-DC booster for up to 60V 1/4W. It uses no special ICs, just basic components and two pins from the Arduino.
Multiplexing
Input
Examples and information on specific input devices and peripherals: How to connect and wire up devices and code to get data from them.
Visual/IR
- Light Sensors
- IR Reflectance/Line Sensors
- Library for connecting your Arduino or Orangutan to Pololu QTR reflectance sensors, which can be used for line following, edge detection, or close-proximity obstacle detection/ranging.
- Video
Audio
- Microphones
- Example of how to connect a piezo as a blow sensor, can also be used to read vibrations or as a touch sensor.
- Example of how to connect a electret microphone.
- MIDI
Mechanical
- Switches and Buttons
- Debounce: a library to debounce switches.
- SoftwareDebounce: a simple software input debounce algorithm.
- Buttons: a simple library to use hardware debounced buttons, handling one shot and hold.
- HoldButton: a code that makes a single button able to call different functions depending upon how long it it is held.
- Button: simple hardware abstraction library
- AnalogButtons: a library to connect more than 1 switch to a single Analgue pin, using different voltage dividing resisters for each switch. Provides register callback functions or over-riding Button class methods to communicate a button press action. Supports configurable holding down of a Button.
- AdvButton: Advanced, yet simple to use, library for registering user input with buttons. Provides an event based interface.
- Encoders
- Potentiometers
Input Devices
- Joysticks / Gamepads
- Mouse
- Read data from a PS2 mouse. Useful if you want to use the encoders from an old mouse in a robot or other device. PS2 mouse interface
- PS2 Mouse Library - An updated version of the above library that adds support for scroll wheel mice and easier sketch integration.
- Read out the surface movements directly from an optical mouse sensor. English tutorial and library
- Keyboard/Keypads
Capacitive Sensing
Pressure Sensing
- SCP1000: Code to read the SCP1000 barometric pressure/temperature sensor, which uses the SPI interface.
Ardustat: Galvanostat/Potentiostat
- Ardustat: Schematics and code to build an electrochemical characterization devices using an Arduino.
Distance Sensing
- URM37 Ultrasonic Distance Measurement Library by Miles Burton
Slot Detectors
Environmental
- Temperature
- KTY 81-* KTY (NTC) Tempertaure sensor with Arduino
- Dallas Temperature Control Library. A very simple library to interface with the DS18B20, DS18S20 or DS1820 IC.
- A simple lookup table method of getting Celcius numbers from a 10k thermistor. Code & calculating spreadsheet here: thermistor
- Reading a thermistor using an equation instead of a lookup table. thermistor2
- Single line of code to read thermistor from 1C to 44C: thermistor3
- There are also ways to access the excellent Dallas 1-Wire temperature sensors.OneWire
- Extremely easy-to-use Arduino library for the Sensirion SHT1x temperature and humidity sensor, which also calculates the dew point (sensor available at nuelectronics).
- Simple Library to interface a Maxim MAX6675 Thermocouple to Digital Temp Converter. (Google Code
- Reading from SMT16030 digital temperature sensors
- LM75A i2c temperature library
- Microchip MCP9700A Temperature Sensor Library -40C to +125C for $0.36US!
- See also Visual / Light Sensor
- See also Dallas One-Wire Interface
Tagging / Labeling
- RFID
- Barcode
- You can hook up a bar code scanner (which simulates a keyboard) or a keyboard to the arduino. See bar code scanner
Location
- Compass
- HMC6352 I2C Compass Sensor - Read heading from a compass sensor, using the Wire library. Here's the sketch: Learning.hmc6352
- Forum posting on controlling the HMC6352 with the Wire library.
- Parallax HM55B Compass Sensor - get angle to North here is all you need: HM55B
- GPS
- Arduino code for parsing data from the EM-406 GPS module, by bigengineer.
- How to connect a Parallax GPS module to the Arduino, and read its $GPRMC string. Tutorial translated from Igor González Martín's original Spanish tutorial. This allows you to get date, heading, latitude and longitude from the GPS module.
- GPS library for Arduino/Wiring by Maarten Lamers is a library for decoding (NMEA) data from any GPS receiver. It extracts all information types, such as speed, direction, location. Supports $GPRMC and all possible sentence types. Includes example programs and routines for calculating distances and directions over Earth's surface. NOTE: this library does not work on 1K Arduinos: Duemilanova, etc.
- TinyGPS, a new GPS/NMEA parser by Mikal Hart is a resource stingy library for decoding (NMEA) data from any GPS receiver. It extracts speed, direction, location, course, date, and time, but consumes only about 100 bytes of RAM.
- Acoustic.GPS A GPS homebrew "GPS" system that uses sound to determine distance to three known points using off the shelf components.
Motion
- Accelerometers
- Compass
- Using CMPS03 compass module on Arduino connected through I2C - Manuals
Electrical / High Power
Time
Touch screen
Multiplexing
Shift Registers
ADC/DAC
Storage
Various options for storing data from your Arduino board.
Built-In EEPROM
- The EEPROM library give you access to 512 bytes of non-volatile memory (that is, it retains its value when you turn the board off).
Built-In Flash
- Mikal Hart's Flash library allows you to easily store strings, arrays, and tables in read-only memory without the hassle and complexity of learning PROGMEM programming.
USB Memory Stick
DataFlash Memory
I2C EEPROM
SD / MMC Card
Spi RAM
Communication
Information on communication protocols often used to talk with other devices. Please refer to Interfacing with Software for information on linking with various PC based applications. This listing may contain cross-listings with device type listings above.
Serial
- Simple Soft Serial, No library http://www.arduino.cc/en/Tutorial/SoftwareSerial
- SimpleTX configuration USART SimpleTX
- See also InterfacingWithSoftware - Specifically interfacing Arduino as a Linux TTY
- NewSoftSerial - Mikal Hart's replacement for SoftwareSerial -- derived from ladyada's AFSoftSerial.
- Communication through files - A really quick and easy way to communicate with any software of your choice.
- Messenger: Send, receive and parse characters, integers and lists. It is the new SimpleMessageSystem.
- CmdMessenger: A small extension of Messenger above.
- SimpleMessageSystem: Send, receive and parse characters, integers and lists between Arduino and Max/Msp or Pure Data
- General purpose program to control most Arduino functions via serial communication with a computer- reads state on dig & analog input pins and sends data to the output pins
- How to pass large multi-byte values between two Arduinos, or shields. If Serial.Print doesn't do the job, try these functions to bit shift multiple bytes together to reconstruct integers or floats
- A standalone printFloat function with no library imports
- Modbus RTU Master/Slave implementation of the functions read holding registers and preset multiple registers (function codes 3 and 16 respectively).
- ModbusMaster: This is an Arduino library for communicating with Modbus slaves over RS232/485 (via RTU protocol). Discrete functions 0x01 - Read Coils, 0x02 - Read Discrete Inputs, 0x05 - Write Single Coil, 0x0F - Write Multiple Coils and register functions 0x03 - Read Holding Registers, 0x04 - Read Input Registers, 0x06 - Write Single Register, 0x10 - Write Multiple Registers, 0x16 - Mask Write Register, and 0x17 - Read Write Multiple Registers implemented. Project is hosted at Google Code.
- The MuxShield collects serial output from up to 5 slaves vis software and sends it out to the serial hardware port.
- SerialControl remotely controls Arduinos (usable in a XBee peer2peer network!)
- iPodSerial Library to interact with iPods over serial through their dock connector. Supports Simple Remote and Advanced Remote modes.
SPI
PWM
uM-FPU V3.1 Floating Point Coprocessor
- Fpu library for using the uM-FPU V3.1 Floating Point Coprocessor.
2B
- 2B is a simple protocol used to receive and send messages to Arduino
PS2
Phones
HDMI-CEC
- HDMI CEC Library communication with HDMI CEC capable devices (TV, DVD, Receivers, BR) : power on/power off/input selector.
Ethernet
- GumboLabs write-up on how to get the best out of the Ethernet shiled. Also explains connecting to a Rails app. Arduino Ethernet Shield and Rails.
- The "official" Arduino Ethernet Shield uses the w5100 chip from WizNet.
- Arduino Ethernet Library by gkaindl enabling DHCP, DNS and Bonjour on Arduino
- Here is a blog describing how to connect to an internet chat server using the Arduino and a Lantronix ethernet module.
- Nuelectronics has developed an Ethernet shield for the Arduino with schematic, open-source ethershield library and webserver demo using Microchip's ENC28J60 SPI ethernet controller. The open-source TCP/IP stack is in arduino library format, easy to use and available for downloading.
- Adafruit XPort/Ethernet shield - How to connect a Lantronix XPort to an Arduino, includes schematic & library. Examples of reading POP email, webserver, sending & receiving twitters...
- a Web Server example, made using an Ethernet Shield.
- the Webduino library, a modular web server for the Arduino Ethernet Shield and AdaFruit shield using the Wiznet module that can be integrated into your sketches. It comes with several examples.
- RADIUS Client, Classes for creating, sending and receiving RADIUS requests as per RFC 2187 and 2188. For ArduinoMega and Ethernet shield.
- MQTT Client, provides a client for doing simple publish/subscribe messaging with a server that supports MQTT v3. For the Arduino Ethernet Shield. For more information about MQTT, visit http://mqtt.org.
WiFi
- AsyncLabs has a WiFi shield for the Arduino using ZeroG Wireless's ZG2100 WiFi device. It comes with a WiShield library which includes the driver source code, a TCP/IP stack and a bunch of sample sketches demonstrating the use of the Arduino as a web server and a web client. More information about using the sketches can be found on the AsyncLabs wiki page.
Flash / Flex
I2C / TWI
Dallas One-Wire Interface
MIDI
MIDI Library
MIDI-out (sending midi data to another device)
MIDI-in (receiving and interpreting midi data with an Arduino)
Wireless
- Bluetooth
- Wireless communication with Cell phone and Arduino board using bluetooth, by Bakalski Page http://www.microcontroller-bg.com/btterm This is a bluetooth cell phone terminal software (like HyperTerminal but for Cell phones)
- A Tutorial on setting up Arduino BT on Mac OS X Tiger
- How to set up the BT ON Windows XP with an external BT adapter.
- If you have the rare need to reprogram your BlueGiga module, here's a tutorial on how to build adapter.
- ZigBee / XBee
- Nordic Nrf2401
- A wireless communication library for using the small, fast and bi-directional Nordic's Nrf2401 radio transceiver.
- Nordic Nrf24L01
- A simple library for the nRF24L01(+).
- PCR-1000
- A icom PCR-1000 controlled by a Arduino- here
- EasyRadio
- Connect Arduino to the EasyRadio transceiver module, diagrams by Jens Wunderling.
- VirtualWire
- Interface Arduino to low cost RF wireless modules to provide high performance transmitters, receivers and transceivers for data. Circuit diagrams and documentation and download instructions here.
- HT12E
- HT12E is a 12-bit encoder IC suited for remote control applications. The serial stream generated by this IC can be transmitted via RF or infrared to an Arduino running a specific decoding library available at this source.
- X10 Wireless
- Arduino interface to the CM17A "FireCracker". The CM17A is a "serial" dongle that sends RF signals to X10 receivers which in turn send signals down the house wiring to control lights and appliances. Documentation and code here.
- X10 Receiver
- Infrared
- HomeEasy
- HopeRF
- Interface Arduino to HopeRF 433MHZ serial transceivers and other 'transparent' serial RF transceivers. Includes classes for node addressed, unreliable and reliable datagrams. Circuit diagrams, documentation and download instructions here.
- HopeRF RF12
- The RFM12/RFM12B/RFM12BP modules for the 433/868/915 MHz frequency bands are connected via SPI. There's a driver for it here.
General
Arduino-related stuff that doesn't quite fit anywhere else.