The LEGO Grand Piano 21323 is a great model, full of clever details and impressive engineering.

Gianni had already done a excellent job before, I just continued to improve and reduce the size of the whole module, with some minor adjustments.

Optical Reflective Object Sensor

You can use QRE1113/QRE1114 with analog or digital methods and Arduino codes here.

Normally we use the following connections, but the number of ESP’s GPIO is limited, if we have 25 keys need to drive, we need 25 GPIOs to read the analog then.

Analog Connection
Analog Connection

Gianni used the matrix method to make the number of GPIOs needed lesser, only need 15 GPIOs. And only one sensor is being powered at the same time, which will save more battery power.

  • 15 for sensors
  • 1 for DAC (Digital To Analog Converter)
  • 1 for amplifier enable (because some noise here when set i2s)

Why don’t use ESP8266

We need at least 17 GPIO, but ESP8266 only 8 are available. Although we don’t need to use the BLE for now.