230V light with relay – Learning path project 17

Our Learning Path is an itinerary designed to teach all the foundaments and a little more about electronics, coding and robotics.

When you complete all the projects you will be able to develop almost any project you can imagine. In each chapter new concepts are introduced. You will learn by doing in a funny way.

Use our relay to control any 220VAV appliance, like a light bulb! Be careful!

Project 17
230VAC light with relay

Use the relay module to control a 230VAC light

BEFORE TO START

DIFFICULTY LEVEL: Intermediate
DURATION OF THE ACTIVITY: 30 min.

MATERIALS:
4in1 board
Battery holder & wires
Battery holder & wires
Battery holder & wires
Battery holder & wires

1 - Build&Code 4in1 board
1 - Relay module
1 - 230VAC bulb
1 - Button module

Battery holder, USB cable and wires.

17 - Relay 230V AC

The 230V AC relay is the way to control 230V devices. Anything we plug in at home can be controlled by the relay. But, be careful! 230V can harm you! Remember to disconnect any device before handling wires and relay.

Our relay can handle powerfull devices, but is limited to 10A current. Be sure to not use too much powerfull devices with this relay or it may burn. 10A at 230VDC, it's fine for devices up to 2300W

We use a light bulb to show the relay function, but it can be used for any device, even a 12VDC led strip externally powered for example.

17 - Circuit

Relay is just a switch. It's possible to use it normally open (NO) or normally closed (NC). This defines the state with a low level state input, so using NO pin, there is no connection between COM pin and NO pin. If NC pin used, when high state is present, internally it moves and disconnect COM pin from NC.

Connect wires from 4in1 board to components:
- DIO4 to button
- DIO9 to 220VAC relay

17.1 - Turn on light bulb by pressing button

As you can see, the program is almost like the first project. Too easy for you now! Isn't it??

Block Coding
Arduino Coding
int light = 9;     // CONNECT RELAY TO DIGITAL PIN 9
int button = 4;      //  CONNECT BUTTON TO DIGITAL PIN 3

void setup() {  
  pinMode(light,OUTPUT);   // DECLARAR BOMBILLA COMO SALIDA
  pinMode(button,INPUT);     //DECLARAR buttonÓN COMO ENTRADA
}

void loop() {
  if(digitalRead(button)==HIGH){         // ENCENDER LA BOMBILLA AL PULSAR EL BOTÓN
    digitalWrite(light,HIGH);
  }
  else{
    digitalWrite(light,LOW);           // APAGAR LA BOMBILLA SI EL BOTÓN NO ESTÁ PULSADO
  }
}
Final project - 230VAC light control

Build your light as you want. You can follow our guide, but now probably you have more imagination than us!

Now....
YOU ARE THE KING OF LIGHTING!
We are sure you don't need code from us to finish this project
previous arrow
next arrow
Slider

The Mega Maker Kit fits perfectly with the Learning Path, you can build all projects with it, but if you have other kits, you can also follow the entire itinerary and finish some projects, or buy the missing components. You can check in our Learning Path page.

0 0

0