r/ArduinoProjects • u/AccomplishedLaugh285 • Jul 07 '23
Project Transistors with PWM
Hey! I have a question about this electrical circuit design.
The light bulb is supposed to be oscillating in terms of brightness, but it isn't. I tested the code on a pre-existing circuit and it seemed to work there, but not in this circuit design. I am using a MOSFET transistor because it is supposed to be PWM. Is there something wrong with my actual circuit design? I tried changing the analogWrite value too for the brightness and it appears to be the same still. I am not sure if it is properly connected to the right transistor pin at 9.
Thanks yall!

1
u/Switchen Jul 08 '23
Is this a circuit diagram based off a physical setup or a simulator? You have the positive lead of the battery connected to ground.
2
u/dedokta Jul 08 '23
Your battery seems to be backwards, but what model mosfet are you using? THere's a basic standard pinout, but they can vary, so it's best to check the actual part.
You might also want a drop down resistor on the mosfet input to ensure it's not picking up stray currents. A 10k resistor between the gate and ground should do it.