Electric vent cover

So I'm making an electronic vent cover. I want it to utilize a servo. I want to have a switch that directly gives and cuts the battery power from the Arduino. So when I turn the switch on, it will give power to the board and make the servo turn 180° and then stop, then i can turn it off and when i turn it on again, i want it to do the same thing, is this possible? Any help would be greatly appreciated! Thanks!

0 to 90° would be open/close.


In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
Use the </> icon from the ‘reply menu’ to attach the copied sketch.

Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.

Oh yeah, I mean 90°. I am very new to arduino, so I don't know much at all, I was wondering if someone could help me by providing a schematic and code.

What is this for ?


Tell us exactly what is to happen:

  • power switch ON
  • the servo closes the vent
  • power switch OFF
  • power switch ON
  • the servo opens the vent

You get the idea.

Ok so
Power switch on: Servo moves 90° which opens the vent
Power switch off
Power switch on: Servo moves 90° in the same direction which closes the vent
Power switch off
And so on

Like this, but with a servo instead of a stepper moter.

This needs to be expanded.

What battery will you be using ?

A servo goes from 0° thru to 180°

At power off the servo will stay at its position.

When does the servo go to 0° ?

I am just connecting it to a 9v battery.
It would actually need to move 22.5° each time i believe

Oh, so a servo couldn't stop at 22 and a half degrees?

Yes, i would want it to stay at its new position

I would use a stepper motor, but the one i have is so weak.

A normal servo can be positioned anywhere from 0 thru 180°.

When it is powered off, the servo stays where it is.

When you power up again you need to once again position the servo.

Ok, so it would need to be able to move 22.5°, stay at that position and then when i turn it on again, it would need to move 22.5° again from the new position.

Maybe thats not possible

What stepper do you have ?

What servo do you have ?

A PP3 9v battery does not have much capacity, AA batteries are a better choice.


Ahh okay

Do you have the ULN2003 driver board with that stepping motor ?

Why are you wanting to make this project ?

Yes, i have the driver board that came with it, i had it set up like the schematic i sent you... its a vent cover for my room

In that schematic, you have 5v from the Arduino powering the stepper.

An Arduino cannot power a stepper.

4 AA batteries (6v) will power that stepper quite nicely.

If you want the vent to move 22.5° CW every time the Arduino power is turned on, that stepper should work.

Ok, so same schematic, but just use 4 AA?