Skip to main content

Featured

RELAY

RELAY A relay is like a switch that can be controlled electronically. Relays are very simple devices and can be used to control devices with higher loads(Like AC controlled devices and devices that require heavy voltages to operate). Relay modules can be used mainly in IOT projects and home automation. Relays can be used to make useful hobby projects.  A two channel relay. *Dealing with high voltages may cause injuries or even death, please use relays with utmost care. Working of Relays. Relays work like electromagnets, when a voltage is applied the coil,  the coil gets charged and acts like an electromagnet and moves the switch to the desired position. In simple terms, relays act as magnets when a signal is applied or removed. Basic circuit of a relay Connections. +5V of Arduino-  5V of relay module. GND of Arduino- GND of relay module. Pin no. 8 of Arduino- In1 of relay module. Basic connection of a relay module CODE void setup() { pinMode(8, OUTPUT); } void loop() { digitalWrite(8,

WHAT IS A BLUETOOTH MODULE AND HOW TO USE IT?

BLUETOOTH MODULE

A Bluetooth module is a device that can be used to connect your smartphone or any other device to your Arduino project. We can send signals to our Arduino boards by connecting a Bluetooth module to it and make the Arduino perform different functions. According to our preferences, we can use different types of Bluetooth modules and build our required project.
For beginners, I would like to recommend the Bluetooth modules HC-05 and HC-06 as their connections are easy and they give a good enough range for the user.

COMPONENTS YOU MIGHT NEED

  • Arduino board.
  • HC-05 or HC-06.
  • An LED.

Bluetooth Transceiver HC-06 - TTL-1

HC-06

CONNECTIONS

  • Connect the GND pin of Arduino to GND pin of the Bluetooth module.
  • Connect the 5v pin of Arduino to 5v pin of the Bluetooth module.
  • Connect  Rx of Arduino to Tx pin of the Bluetooth module.
  • Connecting Tx of Arduino to Rx of the Bluetooth module.
  • Connect the longer end of an LED to any digital pin of the Arduino and the shorter end to GND.

THE CODE


void setup()
{
Serial.begin(9600);pinMode(8,OUTPUT);}void loop()
{

if(Serial.available()>0)
char data=Serial.read();
switch(data)
{
case '1':digitalWrite(8,HIGH);break;
case '0':digitalWrite(8,LOW);break;
default:break;
}
}

You should download an app called 'Arduino blue control' connect to the Bluetooth module and send 0 for the LED to turn off and 1 for it to turn on.

Any doubts please comment down below!!!

Comments

Popular Posts