9V
9V
Single-Pole Double-Throw (SPDT)
10A
Digital
2 (Relay Status, Power Supply)
25mm x 25mm x 25mm
20g
-40C to 85C
-40C to 125C
Applications
| The 9V Relay Cube is suitable for a wide range of IoT projects, including |
Home automation systems
Industrial control systems
Robotics and machine automation
Smart lighting systems
Security systems
The relay module should be used with a suitable power supply and in accordance with the manufacturer's recommendations to ensure safe and reliable operation.
9V Relay Cube DocumentationOverviewThe 9V Relay Cube is a compact, modular relay module designed for use in IoT projects. It features a single pole double throw (SPDT) relay that can be controlled by a digital signal from a microcontroller or other digital device. The relay is powered by a 9V DC power supply and has a maximum switching capacity of 10A/250VAC.PinoutThe 9V Relay Cube has the following pins:VCC: 9V DC power supply
GND: Ground
IN: Digital input signal (HIGH/LOW) to control the relay
NO (Normally Open): Relay output (connected to COM when relay is ON)
NC (Normally Closed): Relay output (connected to COM when relay is OFF)
COM: Common relay outputCode Examples### Example 1: Basic Relay Control using ArduinoIn this example, we'll use an Arduino board to control the 9V Relay Cube to turn an LED on and off.
```c
const int relayPin = 2; // Choose a digital pin on the Arduino boardvoid setup() {
pinMode(relayPin, OUTPUT);
}void loop() {
digitalWrite(relayPin, HIGH); // Turn the relay ON
delay(1000);
digitalWrite(relayPin, LOW); // Turn the relay OFF
delay(1000);
}
```
Connect the relay module to the Arduino board as follows:VCC to Arduino 5V
GND to Arduino GND
IN to digital pin 2 on the Arduino board
NO to LED positive leg
COM to LED negative leg
NC not connected in this example### Example 2: Home Automation using ESP8266 and BlynkIn this example, we'll use an ESP8266 board to control the 9V Relay Cube using the Blynk mobile app.
```c
#include <BlynkSimpleEsp8266.h>char auth[] = "YourAuthCode"; // Replace with your Blynk auth code
char ssid[] = "YourWiFiSSID"; // Replace with your WiFi SSID
char pass[] = "YourWiFiPass"; // Replace with your WiFi password#define RELAY_PIN 2 // Choose a digital pin on the ESP8266 boardvoid setup() {
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(RELAY_PIN, OUTPUT);
}void loop() {
Blynk.run();
}BLYNK_WRITE(V0) { // Assign a digital pin to a Blynk virtual pin
int state = param.asInt();
digitalWrite(RELAY_PIN, state);
}
```
Connect the relay module to the ESP8266 board as follows:VCC to ESP8266 3.3V
GND to ESP8266 GND
IN to digital pin 2 on the ESP8266 board
NO to a connected device (e.g., a light bulb)
COM to the power source of the connected device
NC not connected in this exampleNote: Make sure to replace the auth code, WiFi SSID, and WiFi password with your own credentials.These examples demonstrate the basic control of the 9V Relay Cube using digital signals from a microcontroller or IoT board. You can use this component in various IoT projects, such as home automation, robotics, or industrial control systems.