Magnetic Contact Sensor + Boron

Hi,
Yup you are absolutely right wire length and fact that is just 3.3V (Boron GPIO are not 5V tolerant !!!) can be a little headache.
I’ll use optocoupler in this circuit and try ( personalty I’m not sure if this boosters work but is worth to try for $8 :slight_smile: ) DC/DC booster
to pull up a little (eg: to 12V) the voltage for reed switches. I’know this is Boron project and probably you would like to save energy
consumption as much as possible, but you will use booster just to power up the LED inside the optocoupler which shouldn’t consume too much energy (just couple mA). Thanks to the higher voltage, even if you gonna get some voltage droop, on long wires the circuit should be still stable and work fine. Also the optocoupler will provide you safe separation between your boron and reed switches.
here is some theory about optocouplers:

https://www.electronics-tutorials.ws/blog/optocoupler.html

and here is the DC/DC booster which can do the job:

Also if you don’t want to over complicate the things and you have direct 12V DC available regarding to this post you can power the Boron on VUSB pin directly from 12V and then use the same power supply for reed switches and optocoupler circuit.

Here is some drawing :

Hope this help.
Best regards

1 Like