Detect open loop/circuit

Hi All,

I'm setting up a detection loop. The loop is a simple 5V circuit between the Arduino Uno GND and 5V pins.
Included in this circuit is a LED and resistor to give a visual indication of a closed circuit.

If the circuit would be interrupted the LED would not light up anymore. Now that wasn't so hard.....

What I would like to do is the detect a HIGH/LOW transition on one of the digital pins.
Most likely I will need a 10k resistor in between.

Is the figure below correct? Or am I failing somewhere?

Best regards,
LVX

If you need to build it, swap the spot of the switch. Move the switch between the led and GND, skip the resistor and enable the pull up's in the Arduino (pinMode(pin, INPUT_PULLUP); )

Thank you for your advice Septillion.

I changed the layout. Now in Eagle, works better....

<>
Would this be feasible now?

Regards,
LVX.

What I would like to do is the detect a HIGH/LOW transition on one of the digital pins.

That is nothing to do with hardware it is a pure software function.

Keep track of the last state of the switch with a variable, act on an edge when the current state is not the last state.

Maybe wrongly explained, but I'm making the PCB for this concept. So most definitely this is hardware.

Maybe wrongly explained,

I can only answered what you asked.
A hardware way of detecting edges is by using an edge triggered D-type or JK - flop flop.

I won't offer any views on the wiring in case I get it wrong.

If the switches work on a human timescale, just poll them in a FOR loop

If that risks missing changes then you could use pin change interrupts to detect changes in the switches.

...R

@Lvx_xvl thank you for editing vital information infront of my two replies. It makes it look like I was ignoring your problem.

Just to let you know I will be ignoring you from now on, you xxxx