Skip to content

Hussam Talks Tech

Welcome to my Electronics Blog!

Menu
  • Home
  • About
Menu

IO uHat for the Raspberry Pi Zero 2W

Posted on 06.11.202507.11.2025 by halherta

In this blog entry, I will introduce my IO uHat for the Raspberry Pi Zero 2W. This particular uHat provides:

  • The MCP23017 I2C GPIO expander, providing an additional 16 general-purpose input output pins (GPIOs)
  • The MCP3208 SPI ADC; providing an 8 channel, 12-bit analog-to-digital convertor (ADC)

The IO uHat also hosts an I2C EEPROM as per the uHat specification. The configuration of this EEPROM will be covered in a future entry.

The schematic is shown below:

IO uHat Schematic

Both the GPIO expander and ADC chips are powered from the +3.3V rail. This means the GPIO expander can only accept +3.3V signals as an input. The ADC’s reference voltage is also set to +3.3V.

The IO uHat was designed to be easy to hand-solder, utilizing SOIC packages for all the ICs and larger 1206 packages for the resistors and capacitors. The layout for IO uHat is shown below:

IO uHat layout

When probing the I2C bus on the Raspberry Pi Zero 2W, I was successfully able to detect the GPIO expander with an address of 0x20:

‘i2cdetect’ command successfully detects the MCP23017 chip

I also wrote two Python classes that control the MCP23017’s GPIOs and perform ADC conversions with the MCP3208. A demo program is also available in the GitHub repository.

io uHat Demo setup

The demo program reads the incoming analog voltage from the potentiometer wiper pin and turns on a proportional number of LEDs on the bargraph. So when the potentiometer wiper voltage is at 0V, all 10 LEDs are OFF. When the potentiometer wiper voltage is at 3.3V, all 10 LEDs are ON, and so on.

As usual, my IO uHat KiCad design files are all freely available on my GitHub repository. I’m planning to write a few more blog entries about this board, so stay tuned!

IO uHat board

Category: Electronics, KiCad, Linux, Python, Raspberry Pi

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
November 2025
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
« Oct    

Archives

  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025

Categories

  • C and C++
  • Electronics
  • ESP32
  • KiCad
  • Linux
  • Micropython
  • Python
  • Raspberry Pi
  • Uncategorized
© 2025 Hussam Talks Tech | Powered by Minimalist Blog WordPress Theme