I want to turn on 2 bulbs using 2 MOSFETs. The problem is that they both turn on when it should turn up just one light.


void setup() {
  pinMode(13, OUTPUT);
  pinMode(7, OUTPUT);

void loop() {

See circuit below:

enter image description here

  • What sort of MOSFETs are they? (part numbers) – Nick Gammon Jul 22 '17 at 23:50

Try adding a delay into your loop. In your code pin 13 will toggle very rapidly, much too fast to see it. For example:

void loop() {
  delay (1000);
  delay (1000);

It doesn't look wired correctly. For an N-channel MOSFET the Source should go to ground, like this:

Low-side driver

| improve this answer | |

The following circuit diagram works perfectly.

Mosfet circuit

| improve this answer | |

i prefer you to use relay to control any ac appliance with arduino it very much safe...enter image description here

Just follow this circuit diagram and use 5v relay in your project it will always work fine.....

| improve this answer | |
  • I fail to see how this can help. OP is not attempting to control an A.C. appliance, the diagram clearly shows that they are D.C. Also, the OP has no button in their circuit, so that is completely superfluous. – Greenonline Jul 18 '18 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.