i am trying to control my motor speed using npn and push button, simply i want to control the speed by clicking on the button so its start with speed 1 and second press -> speed 2 and so on
i stimulated the circuit on tinkercad and working as expected but when trying it on my IDE and UNO the code uploaded successfully but the motor not start even
make sure the battery can drive the motor when connected directly to the motor
make sure the motor works when driven thru the transistor with the base of the transistor connected to the + battery thru the resistor
buttons are typically connected between the pin and ground, the pin configured as INPUT_PULLUP to use the internal pullup resistor which pulls the pin HIGH and when pressed, the button pulls the pin LOW.
loops executes 1000s of times a sec. when it detects a button press, Speed_Level will be incremented 1000s /sec
why not try just turning the output pin on when the button is pressed
after re check i found an wire not in its place, i correct the connection but the motor is rotating with one speed whenever i pressed the button and do not stop!
It would be much better if you posted an annotated schematic. My parts do not look like the ones in your picture. Also You know that thing called File 13 (trash can) put your 9V battery there and get something decent such as a power supply or several AA batteries in a pack.
after make sure the pin 2 is not connected to 5v and add 1k to the base and pin 8 the problem still running
when i can the power supply the motor start running in one level and do not stop