Switches in Arduino / Relays

I wanted to add a switch to the gadget so I could easily switch the machine On and Off. I made assumptions about how a switch/button worked, and when I wired it, it did not work.

Relay

How Arduino Digital Inputs work

Arduino digital input pins can read two signals, High and Low. These input pins are really useful when you want to use buttons and switches. But the process is a bit more complicated than simply wiring it to the digital input pin. In fact, we need to use a resistor.

The reason for that is that the digital input pin needs to be able to clearly differentiate a High from a Low signal. When you simply wire a button to a digital input pin, the button will not have a particular state. For the Arduino reading the signal, it is neither On nor Off. To rectify this problem, we use a very large resistor and connect it to the ground.

circuit diagram

The resistor in this case acts as a pull-down resistor.

My failure to understand was probably why I caused a short-circuit in my Arduino nano as I mentioned in the previous learning.

Old Notes

A beginners guide to relays, contactors, and solenoids to automate anything; (#083)

Regular switches handle the full force of the current, the switch moves a metal tab which is what allows you to connect and disconnect the 2 wires.

Implications: As power needs go up, the size of wire and the size of the switch have to go up.

→ Will need super long cable = $

Relays = low power circuits controlling high power circuits.

relays are electro-magnetic switches.

The key for the vehicle is to control a relay to turn on the motor that requires hundreds of amps.

What’s an electromagnet?

When current runs through a wire, there is a magnetic field created.

Then, these things can pick up metal.

We use electromagnets to pick up cars.

Contactors are similar to relays.

Contactors are designed to handle much higher currents.

Ice cube relays.

Normally open (when relay is off) vs Normally closed (when relay is on)

Think of open like when a circuit is open.

Relay vs Contactor

Contactor are more for high current.

Solenoids

Designed to pull with more force.

Solid state relays

Reed switches → Toggles one when a magnet is nearby. This is really cool! So tiny