12V Relay Cube
12V Relay Cube
The 12V Relay Cube is a compact, electronic device that enables the control of high-power devices or appliances using low-power signals from microcontrollers, sensors, or other electronic circuits. It is a versatile and widely used component in Internet of Things (IoT) projects, robotics, and automation systems.
The 12V Relay Cube contains four SPDT (Single Pole Double Throw) relays, each capable of switching high-power loads. The relays are controlled by four low-power input signals, which can be provided by a microcontroller, sensor, or other electronic circuit. When a low-power signal is applied to the input, the corresponding relay switches, allowing the high-power load to be turned on or off.
| The 12V Relay Cube is widely used in various IoT applications, including |
Home automation systems
Robotics and robotic arms
Industrial control systems
Smart energy management systems
Security systems
Lighting control systems
The 12V Relay Cube is a versatile and reliable component that enables the control of high-power devices using low-power signals. Its compact design, high-power handling capabilities, and ease of use make it an ideal component for a wide range of IoT projects and applications.
12V Relay Cube DocumentationOverviewThe 12V Relay Cube is a modular, compact, and easy-to-use relay module designed for IoT projects. It provides a convenient way to control AC or DC loads, such as lights, motors, and solenoids, using a microcontroller or other low-voltage devices. The relay cube operates on a 12V power supply and can switch loads up to 10A.PinoutThe 12V Relay Cube has the following pinout:VCC: 12V power supply
GND: Ground
IN: Input signal (logic level)
NC ( Normally Closed ): Normally closed terminal
NO ( Normally Open ): Normally open terminal
COM (Common): Common terminalExample 1: Controlling a DC Fan with ArduinoIn this example, we will use the 12V Relay Cube to control a DC fan using an Arduino board.Hardware Requirements:12V Relay Cube
Arduino Board (e.g., Arduino Uno)
DC Fan (12V)
Jumper wires
BreadboardCode:
```cpp
const int relayPin = 2; // Choose a digital pin on the Arduino boardvoid setup() {
pinMode(relayPin, OUTPUT);
}void loop() {
digitalWrite(relayPin, HIGH); // Turn the fan ON
delay(5000);
digitalWrite(relayPin, LOW); // Turn the fan OFF
delay(5000);
}
```
Explanation:1. Connect the 12V power supply to the VCC pin of the relay cube.
2. Connect the GND pin of the relay cube to the GND pin of the Arduino board.
3. Connect the IN pin of the relay cube to a digital pin on the Arduino board (e.g., pin 2).
4. Connect the COM pin of the relay cube to one terminal of the DC fan.
5. Connect the other terminal of the DC fan to the 12V power supply.
6. Upload the code to the Arduino board.
7. The DC fan will turn ON and OFF every 5 seconds.Example 2: Controlling an AC Load with Raspberry PiIn this example, we will use the 12V Relay Cube to control an AC load, such as a lamp, using a Raspberry Pi.Hardware Requirements:12V Relay Cube
Raspberry Pi
AC Load (e.g., lamp)
Jumper wires
Breadboard
12V power supplyCode:
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
relay_pin = 17 # Choose a GPIO pin on the Raspberry Pi
GPIO.setup(relay_pin, GPIO.OUT)while True:
GPIO.output(relay_pin, GPIO.HIGH) # Turn the lamp ON
time.sleep(5)
GPIO.output(relay_pin, GPIO.LOW) # Turn the lamp OFF
time.sleep(5)
```
Explanation:1. Connect the 12V power supply to the VCC pin of the relay cube.
2. Connect the GND pin of the relay cube to the GND pin of the Raspberry Pi.
3. Connect the IN pin of the relay cube to a GPIO pin on the Raspberry Pi (e.g., pin 17).
4. Connect the COM pin of the relay cube to one terminal of the AC load.
5. Connect the other terminal of the AC load to the AC power source.
6. Install the RPi.GPIO library and upload the code to the Raspberry Pi.
7. The AC load will turn ON and OFF every 5 seconds.Remember to always use proper safety precautions when working with high-voltage AC loads.