I'm working on a project for a small treasure chest that will open/close, light up, and play sound effects when you walk close to it.
I've prototyped a bit wiring up each of the components one at a time. This is definitely still a work in progress and I'm still a newbie when it comes to electrical engineering so I wouldn't be surprised if I'm doing some stuff wrong.
So one of the things I'm trying to figure out is how to get down to one power switch. At the moment I have one power switch right at the positive terminal out of each battery.
I thought I could add a NPN transistor to the 9v power line in place of the physical slide switch and then place a jumper on the 6v positive terminal right after it's slide switch. The idea being that when I turn on the 5v, the gate pin on the transistor would activate and allow the 9v power through.
I tried wiring this up and found that my voltage on the outer legs of the transistor dropped from ~9v to ~4v. I know there's typically a voltage drop as the higher voltage goes across the transistor, but from what I read that's typically a 0.7v drop, not half the voltage.
Is there something I'm missing or misunderstanding?
Before I hit each of the suggestion bullet points I wanted to post an updated version of the wiring diagram with the theoretic NPN transistor and resistor in it for reference of what I tried before.
Answers to Questions and response to suggestions
Thanks for all of the input so far. Here are responses to each of the suggestions or questions so far:
Why not just use a double pole switch
...you can also use a double pole single throw (DPST) switch...
I didn't actually know those those existed. After that helpful exploration into types of switches I am definitely considering adding one in, but I want to try to go without it for a specific reason that I realize I didn't post earlier. I'm planning on using (still trying to use) a potentiometer that doubles as an on off switch so I have power and volume controlled by one component. Specifically, I'd like to use this:
If the transistor power switch or some other alternative that allows me to use this component doesn't work I'll definitely fall back on a single throw double pole switch. Thanks for that suggestion!
use a DC-DC converter to boost the 6V up to 9V then you only need to switch the 6V.
If you want you can just use one battery and something like this to efficiently provide the other voltage...
I was avoiding using a boost converter because I've read that I should separate power for microcontrollers from motors like servos to avoid the current draw that happens when the motor first kicks on. Is that a concern for servos?
In addition to that, I'm hoping to use this same approach for a slightly larger treasure chest, swapping out the servo for a stepper motor. I know there's going to be more complexity in that circuit (adding in a motor driver at the very least) so I'm starting with this step as a functional prototype.
Hopefully that adds some context on why I wanted to go the transistor route. Does this change any of your answers or suggestions?