Make the following connections between the parts and your microcontroller:
- The red wires represent 12 Volts positive power lines
- The black wires are at 0 Volts (Ground - also sometimes called negative)
- The yellow wire is the PIR sensor signal wire connected to the A2 pin
- The white wire is the Stemma Relay signal wire coming from the A3 pin
- The red and white striped/banded wire represents 3.3 Volts, used to power the low side of the relay.
- The speaker component in the diagram represents the 12 Volt horn.
Wiring
The wiring for this project is straightforward. The horn comes with two wires and has no polarity (polarity means one end expects to be positively charged and the other negative, a bit like the earth’s magnetic poles/polarity). This means it doesn't matter which wire we choose for ground or 12 volts, as long as one is on each the horn will work.
Relay and Horn Wiring
Take one wire that will come from the Horn (yellow in this photo) and attach it to the screw terminal for Ground/Negative (marked with a minus sign).
Take the other wire from the horn (red in this photo) and connect it to the middle hole on the relay (marked common). Use a screwdriver to depress the tab and allow the wire to be inserted and gripped.
Obtain another "spare" wire similar in diameter to the one supplied with the horn. If you don't have one spare then you can cut the supplied horn wire into two smaller wires.
Connect the "spare" wire to the DC jack screw terminal (marked with a plus for positive).
Attach the other end to the relay by inserting it into the hole marked NO (NO on relays means normally open, so the internal switch/wire connection is broken or open. NC means normally closed so the internal switch/wire is connected and electricity can flow).
Take your Stemma cable and connect one end to the relay. If you're using a board with Stemma connectors then connect the other end to the board and skip to the PIR step.
The black wire at the other end of the Stemma cable should be connected to the ground (marked GND) on the Metro-S2.
Any of the board's ground pins will be acceptable.
Connect the red wire (marked with Red and White banding in the circuit diagram) of the Stemma cable to one of your board's 3.3 volt pins (marked 3v3), or a 5 volt pin if you only have them available.
Finally, connect the remaining signal wire (white in the photo) of the Stemma cable to A3 on the Metro-S2 board.
PIR Sensor Wiring
The PIR sensor has a 3-pin header with the middle pin usually as a signal, double check the silkscreen printing next to the 3-pin header on your sensor.
Connect a Female/Male Extension jumper wire between the Ground on the board and the Ground on the PIR sensor (marked GND).
Connect another jumper wire between the VCC pin on the Board (the positive power pins on the Metro-S2) and the VCC on the PIR sensor (marked +5V).
Lastly connect the signal wire (yellow in image) between the middle pin (marked OUT) on the sensor and the A2 pin on the Metro-S2.
Lastly, connect the Horn to the wire coming from the relay, and the wire coming from the DC Jack.
Text editor powered by tinymce.