Connection between I/O pins

Hi all, I have no experience with coding and only understand the very basics of micro-controllers. On my Electron, is there any way to make a script that basically says:
If there is connection is closed between 2 pins, send a text to phone # "Pins are connected"
If the connection is open between 2 pins, send a text to phone # “Pins are not connected”

This application is used as a way for me to know if power has been lost to a remote location, where a relay will open/close connection between 2 pins on the Electron.

Thanks!

Yes, those are easy to accomplish.

You’re going to need to use a 3rd Party SIM to be able to send SMS text messages or interface with a 3rd party app like Twillio or Losant.com as your cloud backend which can handle sending out the SMS text and or email alerts once your conditions are met.

1 Like

First the original question is one of the very basics on these devices.
You’d first setup a pin with pinMode(pin, INPUT_PULLUP) and then read the state of the pin via digitalRead(pin). This will either give you a HIGH signal for the switch towards GND being open or LOW when the switch is closed.

But if you need to ask this question, the other part of your intent - to send text messages - will most likely be well beyond reach IMHO.

1 Like

Thank you RWB for your quick response! I’ll be researching that now!

And thank you for the coding tips ScruffR! I’ve seen it done with a 2G shield on an Arduino Uno, however in the states, 2G is no longer supported by carriers except T-Mobile. I didn’t know if the same application could be done with the Electron.

Again thank you guys for the swift replies!

Link to your Adruino code, that could save you some time.

2 Likes