Security Wire/Cable - Send Alert

Hi,

I need please some guidance on a project.

I need to build a kind of device that can detect when some events occur, and then send different alerts when those events happen.

Esp8266 will be used in this project and will supply power to the wire.

There will be two types of alerts (two scenarios):
1 - when the wire is cut
2 - when the wire is disconnected from the joiner connector

Questions:
1 - for the alert 1, should go for the approach if the current is interrupted, send alert?
2 - for the alert 2, what kind of joiner connector could I use so that ESP866 can detect if the connector has been desattached?

I put here a diagram to illustrate the idea.

Thank you in advance for any kind of help.

For current flow you need a source, sink and detector. An optocoupler can be used for the detector, with the current through the input (LED) and the output (transistor) to an input pin. Add a current limiting resistor to the LED circuit, and a pullup resistor to the input pin.

Thank you for answering, but even though I researched all the components you suggested, I didn't understand the context and the idea.

I will keep trying, LOL.

If I understand your diagram, I can think of a couple of ways to accomplish this. First, how long is the loop? A few feet or a few miles- makes a huge difference in the solution.

Assuming a short loop length, you could use a stereo phone jack and plug. In the napkin drawing below, you would use a stereo jack and plug. Connect the tip connector to Vcc, Configure GPIO2 and GPIO2 as inputs. (You didn't say which ESP board you are using, so GPIO1, and2 are generic.

When the plug is inserted, then GPIO1 and GPIO2 would see Vcc (High)
When the plug is out, GPIO1 and GPIO2 are low.
If the plug is in and the loop is cut, then GPIO1 is High and GPIO2 is low.

State GPIO1 GPIO2

1 1 1 Plug is in, loop is complete
2 0 0 Plug is out, loop is unknown
3 1 0 Plug is in, loop is broken