The title of this post is misleading, as with the use of an isolated wall adapter 220V -> 3.3V the RPI will have no mains connection.
Although the proposed solution is a complicated way to achieve the desired function (google -> control plug -> isolated wall adapter 3.3V -> RPI GPIO -> some code on the RPI -> show message) it can be a quick solution as controlling a plug already works.
Having this solution implemented, then OP has time to look for a google api to IOT on RPi which makes the detour unnecessary.
Personally I would add an optoisolator between the 3.3V output of the wall adapter and the GPIO input. Example "SparkFun Opto-isolator Breakout". This would also allow to use a 5V wall adapter.
Although the proposed solution is a complicated way to achieve the desired function (google -> control plug -> isolated wall adapter 3.3V -> RPI GPIO -> some code on the RPI -> show message) it can be a quick solution as controlling a plug already works.
Having this solution implemented, then OP has time to look for a google api to IOT on RPi which makes the detour unnecessary.
Personally I would add an optoisolator between the 3.3V output of the wall adapter and the GPIO input. Example "SparkFun Opto-isolator Breakout". This would also allow to use a 5V wall adapter.
Statistics: Posted by ghp — Fri Sep 06, 2024 4:32 am