Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod SSR with Arduino Uno

Application notes for Pmod SSR and Arduino Uno. In this app, a load is controlled from the serial monitor.

BeginnerShowcase (no instructions)1 hour183
Using the Pmod SSR with Arduino Uno

Things used in this project

Hardware components

Digilent Pmod SSR
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Pmod SSR and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod SSR to the Arduino Uno. Please note that the Pmod OD1 is depicted here instead of the Pmod SSR; however, connections are the same.

Pmod SSR and Arduino Uno Fritzing Image

Fritzing image displaying the connection of the Pmod SSR to the Arduino Uno. Please note that the Pmod OD1 is depicted here instead of the Pmod SSR; however, connections are the same.

Code

Pmod SSR and Arduino Uno Code

Arduino
Using this code control a load from the serial monitor.
/************************************************************************
*
* Test of the Pmod
*
*************************************************************************
* Description: Pmod_SSR
* A load is controlled from the serial monitor (0 = OFF and 1 = ON)
* and via the module which can switch a large power.
*
* Material
* 1. Arduino Uno
* 2. Pmod SSR (same pinout as Pmod OD1)
*
************************************************************************/
#define relais 3
char octetReception=0;

void setup()
{
 Serial.begin(9600); // initialization of the serial monitor
 pinMode(relais,OUTPUT); // Pin 2 as output
}

void loop()
{
 Serial.println("Relais actif:Taper 1 ou Relais inactif:Taper 0");

 while (Serial.available()==0); // wait receive one byte
{
 octetReception=Serial.read(); // Reading the received byte and storing it in the variable
 switch (octetReception)
 {
  case '0': // case 0
   {
   digitalWrite(relais,LOW); // Inactive relay
   Serial.println("Relais inactif");
   Serial.println();
   break;
   }
  
  case '1': // case 1
   {
   digitalWrite(relais,HIGH); // active relay
   Serial.println("Relais inactif");
   Serial.println();
   break;
   }
  default: // default case
   {
  Serial.println("Commande non reconnue");
   }
  }
 }
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 7 followers
Alex Wong

Alex Wong

5 projects • 19 followers
I work in Digilent and like creating projects
Thanks to Lextronics.

Comments

Add projectSign up / Login