Use NPN transistor as switch with 5V signal and 8V on collector

HI i want to control DC Motor but when i put 5v signal to the base NPN 2N2222A transistor heats up and collector to emmiter voltage isn’t Higher than 5V. How to make circuit that can switch 0-8V without heat.and also what resistor should i put bettwen 5V and base.

untitled.png

Put your motor between 5V and collector. NPN likes to Sink current to Gnd, while PNP likes to Source current from the supply to the load.
220 ohm resistor should turn the transistor on full into saturation, while limiting Arduino pin current to 25mA.
(5V - 0.7V)/.025A = 172 ohm
Can go up to ~1K and still have transistor on full.

Put your motor between 5V and collector.

I think Crossroads means 8V.

.

Yeah, 5V, 8V, whatever it takes ...

Don’t use emitter-follower for switching, use common-emitter circuit like this:

But more like 150 ohm base resistor if the load is more than 100mA