loading

Hello everybody.

I am one of the lucky one who got Intel Edison from Instructables. When I got the the grove starter kit with Intel Edison, I understood what each element did except Groove smart Relay. I researched and came up with a small project to make you more familiar with Relay. Relay is kind of digital switch which opens or closes the circuit depending on the code. It could handle high voltages working only on small voltage of 5V. For the project we will first need few things.

Step 1: Parts Needed

  • Intel Edison with extension board
  • Arduino motor shield to protect Intel Edison
  • Micro-USB to USB cable
  • Grove Button
  • Grove smart Relay
  • Grove Cables
  • Male Jumper cables
  • AA Battery
  • A testing element (I used a simple DC motor)

Step 2: Connections

Using Grove cables connect button to D3 and Relay to D6. Also connect positive of the testing element (DC motor) to one of the green holes (doesn`t matter which one) on Relay element. Connect negative of testing element to negative side of battery and using male jumper cable connect positive of battery to other green hole or Relay element. Circuit can be seen in the images. Connect micro USB cable to the port closer to power supply and connect other side to computer. Using Arduino Software, copy paste the following code on one window and upload. Now DC motor runs when button is pressed.

Step 3: Code

// Edison Relay Basic
const int buttonPin = 3; // the button is attached to digital pin 3 const int relayPin = 6; // the relay is attached to digital pin 9
int buttonState = 0;
void setup()
{
    pinMode(relayPin, OUTPUT);
    pinMode(buttonPin, INPUT);
}
boolean released = false;
void loop()
{
    // read the state of the button:
    buttonState = digitalRead(buttonPin);
    
    if (buttonState == 1)   
    {
      if(released == true) {
        digitalWrite(relayPin, HIGH);
        released = false;
      }
    }
    else   
    {
      if(released == false) {
        digitalWrite(relayPin, LOW);
        released = true;
      }
    }
}

Step 4: Future Considerations

You could play with the code and use Relay for different projects. You could use a remote control for room lights and fan. If you have any questions please comment below and i will try to reply as soon as I can.

Caution:- Be very careful while messing with electric connections at home.

<p>When connecting a digital device like the edison to a higher voltage analog device always use a optocoupler for the relay pull. This way if your relay fries or shorts out your digital circuit is safe. </p>

About This Instructable

3,651views

23favorites

License:

More by sagar.rupapara.14:Combination Padlock 2.0 Laser security System 2.0 Range Finder (basic) with Intel Edison 
Add instructable to: