[ Log In ]
Hex Inverter

Hex Inverter 6 Input and Outputs 2-5.5v Operation

$0.95
Qty:
Potentiometer with adjustable knob.

50K Potentiometer Panel Mount (Non Trimmer) With Knob

$2.45
Qty:
USB 2.0 Cable 10 Foot Type A Male to Type B Male

USB 2.0 Cable Type A Male to Type B Male - 10 FT

$4.80
Qty:
Multimeter Security Banana Plug To Test Hook Clip Probe Lead Cable 500V

Multimeter Security Banana Plug To Test Hook Clip Probe Lead Cable 500V

$8.99
Qty:
3 Foot USB Cable Type A to USB Cable Type A

USB Cable Type A Male to USB Type A Male - 3 FT

$2.65
Qty:
Tumbnail: 62 oz-in NEMA 17 Stepping motors (also called stepper motor)

NEMA 17 Stepping Motor (62 oz-in 5mm single shaft)

$19.95 Out of Stock
Qty:
Image of the Atmega324p

Atmega324P

$8.50
Qty:

10K timmer potentiometer

10K Trimmer Potentiometer (Through Hole)

$0.85
Qty:
16x2 LCD (Liquid Crystal Display)

16x2 LCD (Liquid Crystal Display)

$12.50
Qty:

Understanding the Support Components That Need to be Used with the Relay

The Relay requires a few other components to provide enough power to trip the relay coil (transistor) and a diode across the relay coil to protect the transistor from any back EMF that could be caused by the relay coil.

The relay will be controlled by a pin on the microcontroller. Since the microcontroller will not allow a draw of current that the relay coil will need, a transistor will be needed to switch on a higher current supply. The higher current supply is just the 5v that is powering the circuit. On of the pins of the transistor is connected to the pin of the microcontroller. This pin will have a resistor between the pin and the transistor (base). When the pin is high, the transistor will allow current to pass through the other two pins (collector and emitter).

The relay coil is connected to this part of the transistor so when the pin is high, the relay coil will fire. Since the coil can create back EMF, the coil will have a signal diode across the coil to keep any current from hitting the transistor.
First, we need to determine the current the relay will draw (ohm's law) to determine the minimum current rating of the transistor we wish to use:

We know that the resistance of the relay coil is 25 ohms from the relay datasheet.

I = V/R
= 5v/(25 ohms)
= .2 Amps or 200 mA (milliamp)

Next, the current gain rating (Hfe) for the transistor needs to be determined:

Hfe must be 5 times the load current divided by the current from the microcontroller pin. The microcontroller can output 40 mA from the port pin (found in the microcontroller datasheet).

Hfe = 5 x (loadCurrent/PinCurrent)
= 5 x (.2 amps / .04 amps)
= 5 x (5)
= 25

So, the transistor must have a rating above 25.

The final consideration is to determine the resistance value that must be added between the pin and the base pin of the transistor. We can use a special formula since the voltage from the pin will be the same as the voltage going through the collector and emitter.

Resistance = CurrentOfCircuit x ResistanceOfRelayCoil x HfeOfTransistor
= .2 amps x 25 ohms x 200
= 1000

So a 1k resistor will work.

The diode that will be placed across the coil of the relay will be a diode rated at 1 amp since there is only .2 amps on that part of the circuit. The diode will be a 1N4001 signal diode.

Comments and Additional Information

Have some code to share? Or additional information? Respond here:

You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.

Description:

Code (optional):