NANO I2C IO Expander

Hackster.ioLearning Hardware Community. Projects× Log inSign up ProjectsProjectsChannelsChannelsNewsContestsEventsVideos ×

Embed the widget on your own site

Add the following snippet to your HTML:

NANO I2C IO Expander

An Arduino Nano used as an IO expander on I2C for ESP8266. For example, add 8 digitals IO and 6 analog inputs.

Read up about this project on Hackster.io

NANO I2C IO Expander

Joel Soranzo12 16,794
  • Overview
  • Things
  • Story
  • Schematics
  • Code
  • Credits
  • Comments(2)
Joel SoranzoJoel SoranzoPublished © CC0NANO I2C IO Expander

An Arduino Nano used as an IO expander on I2C for ESP8266. For example, add 8 digitals IO and 6 analog inputs.

IntermediateFull instructions provided2 hours16,794NANO I2C IO Expander

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
  • Buy from Newark
  • Buy from CPC
Breadboard (generic)
Breadboard (generic)
not necessary but useful to test the result.
×1
  • Buy from Newark
  • Buy from SparkFun
Wemos D1 Mini
Espressif Wemos D1 Mini
As I2C host controleur
×1
LED (generic)
LED (generic)
to test digital output
×1
  • Buy from Newark
  • Buy from SparkFun
Resistor 330 ohm
Resistor 330 ohm
To protect the LED
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

In my Fablab, we are working on the design of a four-channel programmable electrical power strip. We have built it around an ESP8266, and we need to measure four analog signals to calculate power consumption on each channel.

The ESP8266 has only one analog input, so we decided to add an ADC on the I2C bus of the ESP. We start to search for a breakout board with such component. We have found some reference as Adafruit ADS1115 or some with an MCP4725, for example. I often use Arduino Nano on my project and I thought it might be interesting to use a Nano V3 as an I2C slave to provide some analog inputs plus some supplementary digital I/O. This little board is very cheap, especially on the Chinese market place. So I searched on the web to find a existing library that can do this job (I am little lazy) and I didn't find it so I do it myself!

I provide here the result of this work.

Read more

Schematics

Fritzing schematic

Very simple ! Don't show led or other controlled io components.

Code

The github of the project

Provide all you need, source code of course for the nano and large amount of documentation. It also contain a ARDUINO library to use in the esp or other host. I tested it with an ARDUINO 2560

Credits

Joel Soranzo

Joel Soranzo

1 project • 2 followersI am an electronic hardware engineer ! I am French. Fabmanager of a FabLab near Paris. I develop on ARDUINO, ESP8266, Raspberry pi, Teensy, Follow ContactContact

Comments

Related channels and tags
  • Arduino
  • Espressif
  • adc
  • esp
  • i2c

Tag » Arduino I2c Io Expander Code