All the leds in this table are controlled by 1 Arduino Due. Using 12+4 digital pins and 2 analog input pins. The 12 digital pins are used to control the 74HC595 shift register chips
- 4x Clock pin
- 4x Latch pin
- 4x Data pin
- 4x digital inputs
- 2x analog outputs
The other pins are used for reading the data using the 74HC4067 16-channel analog multiplexer/demultiplexer chip.
We connected the leds by wiring al the rows and columns together. A small example is shown below. But we did this with 13 rows and 19 columns using 5 shift registers. 3 For the anode (+) and 2 for the cathode (-). We did this for the red panel and the blue panel; a total of 10 shift registers. By refreshing the leds really fast and using this multiplexing technique, it is possible to create different images on the panels.
To control the leds under the cups, we used the same shift registers. We didn’t use the multiplexing technique here because the leds only need to be turned on or off.
But, how can we ‘see’ if there a cup is placed on the table? For this, we used the 74HC4067 16-channel analog multiplexer/demultiplexer. This chip has 4 digital input pins and 1 analog output pin. The digital pins are used to set the correct reading pin. 1010 Is equal to pin 10. Reading the analog output pin, will give you the value of pin 10 on the chip.
We have used infrared sensors next to an infrared led (TCRT5000) to detect a cup. On startup we read the 'default' value of the sensors. When this value changes there is a cup added on top of the sensor.