I’m a new guy to Arduino this summer. However, some family mentioned an interesting and easy project. Basically, when we cook, the smoke detect goes off. So, I’m basically putting an IR receiver connected to the Arduino to turn off the smoke detector. I have the 120v line coming from the ceiling going into the NC of a relay (well, I’ve been using a relay module with which has the diode and transistor in it, I haven’t decided if I’m going to use a relay module or build the relay/diode/transistor getup myself) and the C going to the smoke detector and nothing in the NO (because I want the smoke detector to be on unless we tell it to turn off). And my code is super simple which simply triggers the relay when the IR code is received and waits for 30 minutes and returns the relay to it’s original state. I have questions on the final implementation of this.
I’m unsure of how to power the arduino. Right now, I’m considering just using a 12v 1a wall wart and hooking it straight up to the hot and neutral wires coming from the ceiling with the output of the wall wart going to the vin and gnd pins on arduino. I didn’t know if this was safe or even a good way to go about it. I’ve never made my own power supply, and I don’t want to use batteries because the arduino is either going to be in the ceiling or on top of cabinets 8 feet off the ground.
Also, I didn’t know if I should make this on some perfboard with a arduino pro micro or a arduino nano or simply try using just the atmega328 because it’s not doing anything fancy. Any thoughts? Also, any other advice is welcomed. Thanks.