Advice 1: How to connect the module reed switch for Arduino

The name "reed" comes from the phrase "tight contact". And that explains his device. In fact, the reed switch is two open (or closed) a contact located in a vacuum flask that change their status to the opposite when exposed to a magnetic field. Reed - a very popular sensors used in many tasks. This control of opening/closing doors, a variety of counters, alarms, counters, speed, etc. Let's connect the reed switch to an Arduino and see how it works.
Module with reed
You will need
  • - Arduino;
  • - module with a reed switch or just the switch;
  • - the permanent magnet;
  • computer.
Connect the module with a reed switch to the Arduino via the above scheme. Powered from 5 V or 3.3 V. the Signal connect to digital pin D2.
Module with reed switch contains a variable resistor of 10 ohms. This resistor can be set the switching threshold of the reed switch and thus to adjust the sensitivity. The module contains a comparator LM393 to exclude false positives of the magnetic sensor.
Connection diagram module reed switch for Arduino
Write a sketch of the processing operation of the reed switch. Everything is simple. Specify the number of the pin to which you connected the module output is "2" and turn it to "wiretap". Activate pull up resistor on the leg of "2". Set pin 13 as an output. Included in the work of the serial port at 9600 baud. And then every 20 msec, read the testimony of reed, and outputs the value to the port. If the reed open - displays "1" if closed - displays "0".
In addition, the led on the 13th leg of the Arduino lights up, while the closed contacts of the reed switch. Note the inversion of the read sensor signal.
Sketch for processing the actuation of the reed switch
Connect the power to Arduino. On the module will light up the led indicating the power module.
Now going to offer the reed switch permanent magnet the reed switch contacts will close and the led lights up showing the actuation of the reed switch. Again, remove the magnet, the reed switch opens and the led goes out. If we turn on the port monitor, you will see the actuation of the reed switch in the form of zeros among the flow units when the contact is open.
Actuation of the reed switch
Let's connect separately the reed switch to the Arduino. Everything is very simple. The reed switch is connected similarly to the connection of resistor of 10 ohms. The program will remain the same.
Turn the power on, hold the magnet to the reed switch - led on the Arduino lights up, while the closed contacts of the reed switch.
Wiring diagram for the reed switch to the Arduino

Advice 2: How to connect led

If you want to upgrade your computer with some fancy "chips", the easiest way to use LEDs – they are simple, cheap and do not require any special skills and tricks. The led can decorate your workspace to give it more lighting, and just to lighten the mood. To connect your led, follow our step-by-step instructions.
How to connect led
You will need
  • 1. LEDs
  • 2. soldering iron and all that is needed to work with it
  • 3. resistors that will reduce voltage and amperage from a power source
  • 4. connectors required to connect LEDs to PC
  • 5. tester to check the voltage
  • 6. wire cutters to strip wires
  • 7. heat shrink tube
Before you begin, make sure that you have all the necessary tools and devices for work.
Connection connector 4-pin molex.First, let's see how to connect the led connector to the 4-pin molex. This is a fairly common connector in the computer, so it is quite possible that your computer it is. This connector contains four contacts:1. +12V (yellow wire)
2. +5 V (red wire)
3. Two ground (black)Choose where you want to connect the diodes to 12 or 5 volts. Connector acquire or remove old unwanted devices. Tester check if the selected contacts, identify where the diode is positive, and where negative contacts.
Wire strip pliers, solder the resistor to the positive pin of the connector. Connection close shrinking. To the second contact of the resistor solder the positive contact of the led. Close the soldering heat-shrink tubing. Take the negative terminal of the led and solder it to terminal "earth" connector.
Connect the led to the power and check if it works.
Connection cable USBМожно to connect the led to the cable with a USB connector. Such cables have two types, but the fundamental difference in the course of the work they have, so find any unnecessary cable and proceed.USB cable is four pins, two of which transmit data one contact is ground, and one transfers the stress. That's up to him then you need to connect the led. Tester check the voltage and determine the positive and negative pole of the diode.With wire cutters, strip the wires that transmit voltage. Solder the resistor to the positive terminal, place spikes, close shrinking. To the second contact of the resistor attach the positive contact of the led and cover the spikes. The negative terminal of the diode solder to the terminal "earth", cover the spikes are shrinking. Connect the USB cable to the computer and check if it works.
Is the advice useful?