I’m currently building a 12v circuit with a relay to turn on my amp using the 12v port when I start playing music through volumio. I checked both the logic and the eletric signals. The logic is fine, as I checked it using gpio readall command (when I stop or pause music for more than 10 seconds, it turns off the signal on GPIO #17). But as it turns out, it keeps a voltage of .150 volts between the ground signal and the GPIO #17 pin. This .150 voltage apparently is enough for my relay to understand that the signal is still “on”, and the amp keeps on all the time.
Has anyone been through it or have a hint of what to do in this case?
I just wanted to finally share my solution for this problem.
While slowly looking for more than a year into this issue, I found out that the 5 volts VCC voltage is not enough to drive the 12v trigger because of the limited current out of the pins (yes, the 12 volts trigger is the maximum voltage, not the minimum). Also, the original problem here was solved with a TP31C transistor and a 1,2kohms resistor.
I asked Claude 3.7 Sonnet to refine my explanation of the solution, here it is:
This circuit allows a Raspberry Pi running Volumio to automatically turn on an amplifier when music starts playing and turn it off when music stops, using the amplifier’s 12V trigger input.
Components Used
Raspberry Pi running Volumio OS
TIP31C NPN power transistor
1.2kΩ resistor
5V relay module
USB cable (cut open to access power wires)
3.5mm mono jack cable (to connect to amplifier’s 12V trigger input)
Ensure the relay module is a 5V type (most common ones are)
Double-check the TIP31C pinout (E-B-C from left to right when looking at the flat side)
Verify which wire in the USB cable is +5V (typically red) and GND (typically black)
This solution can be implemented on a small breadboard and housed inside your Volumio enclosure
This solution is elegant because it uses the USB port’s higher current capability while still being controlled by the low-current GPIO pin, solving the problem without needing a separate power supply.