Interfacing two devices using transistors
When you use transistors in this way, a series resistor must be included in the base line. 10k would be a good guess.

A transistor used this way sort-of works as a switch, but only in one direction. The emitter must be negative side (connected to the ground or - lead of the batetries). Your diagram does not show if this is the case, or whether you were even aware of this issue.