On our forum, Tony Goodhew, aka Tonygo2 has been busy with a big I2C project. I2C theoretically supports up to 128 devices connected to a single host. But, how many can you use together in one project? Tony is eager to find out!

💡
I2C (Inter-Integrated Circuit) is a synchronous, serial communication protocol used mainly in low-speed peripherals devices such as the sensors, inputs, and displays used in the project.
CTA Image

A beginner friendly, internet connected mood-light-in-a-bottle that's easy to program using MicroPython or CircuitPython.

Grab a Plasma 2350 W Kit

Tony's I2C project started with a Wireless Plasma Kit and infrared remote kit. He then added four potentiometers, an IO expansion board and an SSD1306 OLED screen. He was keen to have everything controlled by a single, menu driven application and this 128x64 pixel, monochrome screen provides a simple means to do so.

The number of I2C components grew, one by one. Testing each for basic operation before moving on to the next.

This is where Tony hit an issue. He loves big, bright and colourful displays such as Pico Display Pack 2.0, but Plasma 2350 W didn't have enough pins for an SPI device. Tony turned to a bigger board with more GPIO and more power memory, Pico Lipo 2XL W, which has 8MB of PSRAM and 16MB of flash storage. Plasma 2350 W has 520KB of SRAM and 4MB of QSPI flash.

The project grew once more, an old LCD with an I2C backpack provided instructions on the selected device with a little retro-themed charm. The project exchanged the 5m flexible RGB LED wire for a shorter chain of 15 NeoPixels and an additional 16 pixel NeoPixel ring. The project needed a little GPIO expansion, so a Pico Decker was brought into play.

This left the project looking like this.

Helpfully, Tony has listed all of the I2C devices and components used in the project.

  • Dec addr: 10 , Hex addr: 0xa Track Ball Has RGBLED in ball
  • Dec addr: 15 , Hex addr: 0xf Rotary encoder Has RGBLED in knob
  • Dec addr: 24 , Hex addr: 0x18 IO Expander Analog and Digital I/O
  • Dec addr: 33 , Hex addr: 0x21 Qw/ST Pad 10 buttons and 4 white LEDs
  • Dec addr: 35 , Hex addr: 0x23 LTR-559ALS-01 Light sensor
  • Dec addr: 56 , Hex addr: 0x38 AHT20 Temperature & Humidity
  • Dec addr: 60 , Hex addr: 0x3c SSD1306 OLED Display 128x64
  • Dec addr: 100 , Hex addr: 0x64 DF2301QG Offline Voice Recognition Sensor
  • Dec addr: 106 , Hex addr: 0x6a LSM6DS3TR-C Accelerometer & gyroscope
  • Dec addr: 118 , Hex addr: 0x76 BME280 Temperature, pressure, humidity
  • GPIO 0 has 15 NeoPixel RGB string in the skull bottle
  • GPIO 38 has 16 NeoPixel RGBW ring
  • IR Receiver stick on Rx, GPIO 1. Aye Arr IR Remote sends the signals for input.
  • 3 x 10K potentiometers on ADC pins (GPIO 26,27,28)
  • Hanging from the IO Expander: RGB LED, Single RED LED, button and 10K pot
  • 0x27 is LCD2004 on the other I2C bus (GPIO Pins 2 and 3) – 4 rows of 20 characters
  • Display 2.0" SPI 320x240 pixel colour screen
  • All connected to Pico Lipo 2XL W, on a Pico Decker

Before retirement, Tony was a Computer Science teacher, starting in the late 1960s with FORTRAN IV, then various versions of BASIC, Hollerith cards and chain printers on an IBM 1130. Tony taught using Commodore PETs, Ohio Scientific Superboards, BBC computers, ATARI STs and networked PCs before retiring 20 years ago. He now considers himself a "hobby coder" but it is clear to see that Tony takes his hobby very seriously, but still has plenty of fun exploring and tinkering with electronics.

Tony's project is a great example of how I2C devices can be used in a project, and of how to add, test and refine a project in stages, rather than throwing it all together and hoping it works.

The entire project is documented over on the Pimoroni forums, where Tony is also offering all of the code and a friendly conversation.