D1 Mini / Relay to Control Lamp

I have a D1 mini and a relay that I am going to use to make an old lamp "smart".

The lamp has a power cable which I am going to feed into the relay to switch it off and on but is it possible to power the D1 mini from the power cable before the relay so it is always on?

It would save me having to power the d1 mini seperately.

you would have to use a AC to DC converter that drops the supply voltage down to the D1 mini voltage

Would something like this work?

Consider a "phone charger".

From your question I can conclude that you are a newcomer about electricity and electronics.

ATTENTION !

if your body gets in contact with 110V / 230V you are in severe danger to die !

Your D1 mini will blow up and catch fire if you directly connect it with 110V !
With your minimal knowledge about electricity I highly recommend that you use a

certified high quality

phone-charger in the $10 range
Something like this
https://www.amazon.de/Samsung-EP-TA20EBECGWW-Ladeadapter-Schnellladefunktion-schwarz-Black/dp/B06Y3MW7D4/ref

The Mini AC-DC-Adapter has non isolated contacts.
I'm a bit sorry to say that: With your low knowledge keep away from all electricity higher than 12V

For switching your lamp use this ready to use safety certified switch with low-voltage-input
With this product you are safe and don't have to deal anywere with high voltage

If you think "I don't want to spend that amount of money.
Well re-think:
If you could make a contract with the devil to pay $100 to bring back a person to life that has died because of your un professional manufactured "smart" lamp

I am very very sure you would pay it.

Be proud of a DIY but safe to use smart lamp by using professional products that you combine.

best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.