If you wield a hot soldering and solder quickly, there’s no harm in
soldering directly to the pins. On the relay module the wires go
directly into the screw terminals. For how the detectors modules
are interconnected see [7]. The red and black wires carry +5V
and ground respectively to the modules and the gray wire car-
ries the signal between the two modules.
Reading the LEDs
Both the sensor and the relay module have surface-mount
red LEDs on them. When the sensor detects an object, the
LED lights up. Similarly when a logic low signal appears on the
relay module’s input pin, it’s LED lights up and the relay pulls in
(which you can hear).
These LEDs are handy for troubleshooting, but the likelihood
of having to troubleshoot this circuit is low. The potentiom-
eter on the sensor board adjusts the detection range, turning
the screw clockwise increases the range. At maximum range a
white index card is detected at about an inch and a blackened
card is detected at about half an inch.
The LED in the source is an infrared LED and, therefore, not
visible when powered; but if you want to see the LED light up,
look at it with your cell phone’s camera or your digital camera;
most of their sensors can ‘see’ in the infrared.
Connecting and testing the modules
The output of the relay will go to your signal system; either as a
switch closure on detection (the normally open contacts) or as
a switch opening on detection (the normally closed contacts).
Since the relay module has a hefty 10-amp relay, this set-up
can also be used for automation as it can switch track current