The Wemos D1 Mini Relay Shield is an expansion board designed to be used with the Wemos D1 Mini microcontroller. It provides the ability to control high-power devices such as home appliances and industrial equipment. This shield features a relay that can switch on and off by the D1 Mini, allowing for the control of devices that operate at higher voltages and currents than the D1 Mini can handle directly.
Pin | Description |
---|---|
D1 | Relay control signal (active high) |
5V | Power supply to the relay coil (from D1 Mini 5V) |
GND | Ground connection |
// Example code to control the Wemos D1 Mini Relay Shield
// The relay is controlled by setting pin D1 to HIGH or LOW.
#define RELAY_PIN D1 // Define the relay control pin
void setup() {
pinMode(RELAY_PIN, OUTPUT); // Set the relay pin as an output
}
void loop() {
digitalWrite(RELAY_PIN, HIGH); // Turn on the relay
delay(1000); // Wait for 1 second
digitalWrite(RELAY_PIN, LOW); // Turn off the relay
delay(1000); // Wait for 1 second
}
Q: Can I control multiple Relay Shields with one D1 Mini? A: Yes, but you will need to use separate control pins for each relay and stack the shields with care to avoid pin conflicts.
Q: Is it safe to control AC devices with the Relay Shield? A: While the relay is rated for AC control, safety precautions must be taken, including proper insulation and avoiding contact with live wiring.
Q: Can I use the Relay Shield with other microcontrollers? A: Yes, as long as the microcontroller can provide the necessary control signal and power to the relay.
Remember to always follow safety guidelines when working with high voltage and current. If you are not experienced with electrical systems, seek assistance from a qualified individual.