i am trying to do almost exactly the same thing. Instead of the Arduino i am using a Wemos D1 (ESP) which is powered from a 3,7V lithium battery (charged by a solar panel)
After turning on with a magnet. The reed switch stays on. It doesn’t turn OFF any more.
What i tried:
- I already tried three different reed switches
- Moved to another place to avoid magnetic interference
- I had the reed switch between batter (+) and Wemos (5V)
- I had the reed switch between battery (-) and Wemos (GND)
The behavior doesn’t change. Sometimes the reed switch turns off when i flick it. But only sometimes.
These are the specs of my reed switches:
Total length: 44.7MM
Glass length: 14.2MM
Electric shock load: 10W
Maximum switching voltage: 100 VDC/VAC
Maximum switching current: 0.5A
Electric shock capacitor: 0.7PF
Operating temperature range: -60~ +155 degrees
Maximum humidity: 98% (max)
Maximum working frequency: 100HZ
Startup value: 10-15
Release value: 5
Contact resistance: 100m ohm
It drives me crazy. Any thoughts?
P.S.: When i use the reed switch without connected to the circuit. It works fine.