-
Notifications
You must be signed in to change notification settings - Fork 6
I2C VU Meter
The following example shows the Proof of Concept (POC) for hardware I2c VU Meter. Here is the POC Schematics showing connections between all components of the I2C VU Meter.
The following ingredients were used to cook I2C POC:
-
470 Ohm resistors (20 pieces). Each resistor should be connected between GND and LED output to limit the current (~10 mA) passing through each LED. When all LEDs are on they consume about 100 mA per channel.
-
Module MCP23017 (2 pieces). This module connects to Raspberry Pi using I2C interface and allows to switch on/off 16 TTL devices connected to it. Only 10 outputs were used for the POC. They were connected to the LED array using modules' outputs A0-A7, B0-B1.
-
LED Array (2 pieces). This array has 5 green, 3 yellow and 2 red LEDs. Two arrays are required for the left and right channels. Any array with different number of LEDs (up to 16) or separate LEDs can be used for this purpose as well. The number of LEDs per channel should be defined in the configuration file config.txt in property output.size
-
4-pin connector. This connector soldered to the PCBs (#5) provides I2C connection to Raspberry Pi.
-
PCB with two lines of connected contacts (2 pices). These two PCBs make micro-bus which connects such signals as +5V, GND, SCL, SDA on both MPMCP23017 modules together. Through 4-pin connector (#4) they provide external I2C connection to Raspberry Pi.
-
4.7 kOhm resistor. This resistor should be connected between +5V and A0 address contact on MCPmodule of the left channel. Don't confuse it with A0 output contact. The resistor changes the address of the left channel module from 0x20 (default) to 0x21. This address was selected for POC. Any other address can be specified using address lines A0-A2 and resistors connected to these lines. The address of each channel should be specified in config.txt.
-
PCB for LED Arrays. Any PCB of appropriate size can be used for mounting LCD arrays.
-
10-pin connector (2 pieces). This connector was soldered to the MCP23017 module. That allowed to connect them to the LED arrays pins directly.
The following image shows the POC assembling process.
The next image shows POC in action:
I2C VU Meter can be configured using the following parameters in file config.txt:
[i2c.interface]
port = 1
left.channel.address = 0x21
right.channel.address = 0x20
output.size = 10
update.period = 0.1
- port - I2C port in Raspberry Pi.
- left.channel.address - I2C address for the left channel in hexadecimal format.
- right.channel.address - I2C address for the right channel in hexadecimal format.
- output.size - number of bits per channel transferred to the I2C VU Meter.
- update.period - defines in seconds how often PeppyMeter will send signal to I2C VU Meter.