Does it works the same way?
Exactly the same way.But!Mike's answer was for a manually operated, normally open switch.If the switch is going to be closed (with the magnet) most of the time, it will be useless as the battery will quickly go flat.
If the switch is going to be closed (with the magnet) most of the time, it will be useless as the battery will quickly go flat.
won't it be dangerous is someone cut the wires between the reed switch and the opt and inserted it into electric outlet or any power outlet with high voltage and current while there is battery in between which might cause explosion??
3rd is it better to roll around the opt and thr wires connecting to it an electric isolator tape to protect the surroundings incase it got fried or any bad case scenarios happened or it might cause problems in the long run?
4th is it better to wire the wires directly to the opt or I can use breadboard?
5th i am using 9v battery cuz AA battery holder wasn't available in the nearest elec. Shop so how i can calculate resistance needed for the opt when using the 9v battery?
Yes that could happen but we are talking about isolating the Arduino here. It could be equally as dangerous if someone doused your front door with gasoline and set fire to it. That is much more likely than your high tech bandits rewiring things. So far you haven't given us any justification as to why you think this is even a remote possibility.
Seems I am seeking something hard to be done or impossible. I really care about the uino not to be harmed as well as the place of course and I want some cheap solution that won't cost more than the uino itself but idk it's seems bit complicated to achieve such thing.
but what I am doing is I try to connect a door switch to the uino but as I need to be 100 percent secure that the uino won't be destroyed if someone intentionally cut wires of the switch and insert it in 220v electric outlet for sake to destroy the project