Using the Wall Switch with Arduino in Lamp

Hello,
i plan to put a Motor in my Ikea Ps 2014 Lamp, but my problem is the power supply.
I want to use my wall switch, but if I switch off the Lamp my Audroino (in the lamp) have no power.

If i switch the light on the motor should turn and after I switch off the light the motor should turn in the other direction.

I don't wabt to use a battery and no rc switch

How can i solve this Problem?

I would have thought that your biggest problem was mechanical.

I don’t see what an Arduino would do in this project.

How about this circuit only replace the batteries with a wall wart.

If i switch the light on the motor should turn and after I switch off the light the motor should turn in the other direction.

You want the motor to move with the power off??? And without a battery or any source of power???

I want an arduino in my lamp.
My lamp has only two wires.
I want to switch with my wall switch the lamp on and off.
If its on move the motor 5 sec
And if its off move the motor 5 sec

That's simply not going to happen without some sort of storage...

You can try a super cap but it's not an easy solution. It would be easier is the lamp had supply all the time and was triggered. Maybe two power supplies? :smiley:

Maybe i can use a diode parallel to the wall switch. But does anyone know if i can use a standard 5v usb power supply (from my mobilephone) if I have only the positiv half wave?

@aggro600 - so what is wrong with the answer in reply #1?

I use a servo motor without limit switch

aggro600:
I use a servo motor without limit switch

Do you know you can only get about 200 degrees of movement with a servo? A continuous servo does not allow you to control an angle.