I’m building a project to use a GemmaM0 to turn on/off a sound bar when the TV is turned on and the Sound Bar is on/off. So I’ve got two inputs on the GemmaM0, one from TV, one from Sound Bar, going through a pair of voltage dividors (1.2k + 1.2k) to make sure the inputs don’t see more than approx 2.3V from the 5V coming out of each device’s USB port. The Gemma then uses an IR LED to send power toggle commands to the Sound Bar to turn it on or off, depending on whether the TV is on or off. Works pretty darn well except for a couple of minor problems.
The first problem I have with my bread board test unit is that if the Gemma is not powered by it’s 5V USB input, the TV and Sound Bar seem to back-feed power into the Gemma and it gets confused, seeming to power up into a wierd half-state.
So when I designed an actual PCB using KiCAD, based off the GemmaM0 breadboard layout, I added in a pair of transistors to the input path from the two 5V sources, so that they would only be enabled when the 3v3 pin on the Gemma was enabled. The schematic below will make it clearer what I was trying to do:
But for some reason, I’m always seeing approximately 1.2V on the input pin, no matter whether or not I have 5V on the input pin. So I must have done something totally wrong in my layout, but I’m not sure what. And here’s a shot of my PCB layout, sorry it’s a bit crowded. The whole idea is to make it all fit into a GemmaM0 footprint so I can stack them with standoffs to make it look really nice.
So my questions are:
- Is there a better way to pull all inputs to 0V until the GemmaM0 is powered up and ready to read the inputs?
- Do you see anything wrong in my schematic for how I’m doing this? Right now I use the 3v3 pad for turning on/off my input transistors (the bottom two in the schematic).
- Should I be instead just using Diodes to clamp down the inputs to the range I want? I basically just want a binary signal whether there is 5V coming in on the two inputs from the TV and SoundBar, and I figured transistors made the most sense.
- Should I have put a resistor inline with the Base of the two input Transistors to limit the current there? When I put a 1.2k resistor in there, it dropped the voltage in my new breadboard test setup, but didn’t seem to make any other difference. But I admit I didn’t measure the current through it.
Any suggestions would be appreciated! And I’ll be happy to share my KiCAD PCB base of the GemmaM0 layout if others wanted to use that as a template for other projects.