clickButton Library for MCP23017

I had some issues with our implementation of the click detection on the smartswitch. While searching for a better solution I stumbled accross the arduino clickButton library which is already ported to the photon.

Unfortunately the clickButton library is only working with photon/arduino pins and is not supporting a MCP23017 port extender which is used by the smartswitch. To fix this issue I modified the library for the use of an MCP23017.

The sources are on github:

SmartSwitch v2 with Particle Photon


Spark renamed themselve to Particle and released a updated version of the Spark Core: the Particle Photon. Additionally they published a desktop IDE called Particle Dev.

To support the Particle Photon and the Particle Dev I removed the firmware part of our smartswitch code. You can find the result on github.


Additionally I refactored the buttons and the case of the smartswitch since the button pad is not as usable as expected. I replaced the button pad with some push buttons and the WS2812s LEDs with a neopixel ring.

SmartSwitch with Spark Core

During the wintersemester 2014/2015 Phil and I developed a SmartSwitch with a Spark.Core in “Embedded Systems”.

The goal was to develop an input device which can control local network components without the need to pull your smartphone out of your pocket by pressing a button. We implemented the neccessary software to process the button clicks and trigger HTTP requests in the local network. Additionally we produced a custom PCB. The project is open source and open hardware.

We published the project on  where it was on the Top Projects on February:

To increase the inputs we use a MCP23017 Port-Expander which is connected to the Spark in the following way:

When pressing a button connected to the MCP23017 an interrup on the Spark Core is triggered.

While developing we had some problems with the interrupts on the MCP23017 and figured out that the MCP Interrupt Register must be read to recognize interrupts correct. That means after the initialization of the MCP and after the interrupt occurred it must be cleared with mcp.readGPIOAB().  (see our post: