Test Program

Table of Contents

Introduction #

  • This guide is intended to test the features and the basic operation of the device, NORVI-IIOT-AE01-R (Relay model).

Files

Download Link to Files

Table of Test Instructions

**Flash the test code firmware before testing the device. Follow the instructions given in the Guide to Flash the Test Code Firmware guide, to flash the binary code.

Testing component/feature
Test

Expected Output/Outputs
PowerProvide 24V DC supply.Red colour LED inside the device glows.
Display turns on.
DisplayPower-up the device using USB cable or 24V DC supply.Display starts with the Norvi logo.
Device model is displayed.
Final screen with Input, Output and Push Button status appears.
The output side LED indicators glow in a pattern.
Digital InputsPower-up the device using 24V DC supply.







Connect the GND & COM pins and supply the 24V DC to every digital input one by one.
Refer to the expected outputs of the Display Check above.
In the input status, status of all the 8 digital inputs will be 1.(As the inputs are internally pulled up)
The input status changes from 1 to 0, and the input side LED indicator starts to glow accordingly.
Voltage Inputsand Transistor OutputsPower-up the device using 24V DC supply.Status of all the 6 analog inputs will be 0.
Toggling output status (from 0 to 1 ) is observed on the display for the 2 transistor outputs, which follows the output side LED indicator blinking pattern.Whenever these LEDs are on, it means the respective transistor is on.
Voltage Inputsand Transistor Outputs (continued..)After powering up the device, to check the working of the 6 analog (voltage) inputs, supply a voltage between 0-10V (10V max) to each voltage input.
(Check this link for the wire connection)
To check the working of the 2 transistors, a voltage test is done using a multimeter.To do this, keep the positive probe of the multimeter on the +24V pin of the device. 
Next touch the negative probe with the 2 transistor output pins after,one by one after a 15s gap.
On the display, the voltage sensed by the Norvi device is displayed.(You can confirm these voltage values using a multimeter.)




The multimeter shows a 24V DC reading, whenever the transistor is on.(Transistor status is indicated by the respective output side LED indicator and the output status on the display)
Push ButtonsPress the 3 push buttons, one at a time.The 4 digit analog status of the push button is displayed accordingly on the display.
***Analog status 1_ _ _  for the upper button
Analog status 2_ _ _  for the middle button
Analog status 3_ _ _  for the lower button
RS-485  Communication

















For this test, a USB to RS-485 converter is required.
Connect the RS-485 A and B pins of the Norvi device with the respective A and B pins of the USB to RS-485 converter.
Plug the USB end of the USB to RS-485 converter to the PC.
Power-up the Norvi device using USB Cable. 
Open the Arduino IDE application.
Select the correct COM port of the USB to RS-485 converter in Arduino IDE and open the serial Monitor.
Send the Number ‘5’ in the serial monitor.
In the serial monitor “RS485 SUCCESS” statement getting printed is observed.
This indicates that the RS-485’s Tx operation is working properly in the Norvi device.

Once number “5” is received, all the output side LED 
indicators will glow simultaneously for a few seconds. Then later they’ll  continue to glow in their previous pattern.
This indicates that the RS-485’s RX operation is working properly in the Norvi device.
Table of Tests

Test Program #

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_ADS1015.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

#define FC   4

int ledPin1 = 14;
int ledPin2 = 12;
int ledPin3 = 13;
int ledPin4 = 15;
int ledPin5 = 2;
int ledPin6 = 33;
int ledPin7 = 26;
int ledPin8 = 27;

int  buttonState = 0;
const int buttonPin = 32;

Adafruit_ADS1115 ads1(0x48);
Adafruit_ADS1115 ads2(0x49);

float Voltage1 = 0.0;
float Voltage2 = 0.0;
float Voltage3 = 0.0;
float Voltage4 = 0.0;
float Voltage5 = 0.0;
float Voltage6 = 0.0;



static const uint8_t image_data_Saraarray[1024] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xfc, 0x1f, 0x80, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xf8, 0x0f, 0x80, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf8, 0x07, 0x80, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0x07, 0x80, 0x07, 0xf8, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xd8, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0xe3, 0x80, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x00, 0x00, 0x7f, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x3c, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0f, 0x01, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xe1, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x7f, 0xf1, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xf8, 0xf9, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x79, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x39, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x39, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};


Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
 
  pinMode(FC , OUTPUT);                            // Declare FLOW CONTROL pin as output
  Serial.begin(9600);                              // set serial communication baudrate
  ads1.begin();
  ads2.begin();
  
  pinMode(18, INPUT);
  pinMode(39, INPUT);
  pinMode(34, INPUT);
  pinMode(35, INPUT);
  pinMode(19, INPUT);
  pinMode(21, INPUT);
  pinMode(22, INPUT);
  pinMode(23, INPUT);
  pinMode(buttonPin, INPUT);
  
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);
  pinMode(ledPin7, OUTPUT);
  pinMode(ledPin8, OUTPUT);


  Wire.begin(16, 17);                            // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.display();

  display.drawBitmap(0, 0, image_data_Saraarray, 128, 64, 1);
  display.display();
  delay(2000);
  display.clearDisplay();
  display.display();

  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(15, 15);
  display.println("NORVI IIOT-AE02-V");
  display.setCursor(45, 30);
  display.println("HELLO...");
  display.setCursor(25, 45);
  display.println("Test code V1.0");
  display.display();
  delay(2000);

}

void loop()
{
  display.clearDisplay();
  update();
  digitalWrite(ledPin1, HIGH);
  update();
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, HIGH);
  update();
  digitalWrite(ledPin2, LOW);
  digitalWrite(ledPin3, HIGH);
  update();
  digitalWrite(ledPin3, LOW);
  digitalWrite(ledPin4, HIGH);
  update();
  digitalWrite(ledPin4, LOW);
  digitalWrite(ledPin5, HIGH);
  update();
  digitalWrite(ledPin5, LOW);
  digitalWrite(ledPin6, HIGH);
  update();
  digitalWrite(ledPin6, LOW);
  digitalWrite(ledPin7, HIGH);
  update();
  digitalWrite(ledPin7, LOW);
  digitalWrite(ledPin8, HIGH);
  update();
  digitalWrite(ledPin8, LOW);
}

void update()
{
  float adc0;
  float adc1;
  float adc2;
  float adc3;
  float adc4;
  float adc5;
  
  adc0 = ads1.readADC_SingleEnded(0);
  adc1 = ads1.readADC_SingleEnded(1);
  adc2 = ads1.readADC_SingleEnded(2);
  adc3 = ads1.readADC_SingleEnded(3);  
  adc4 = ads2.readADC_SingleEnded(0);
  adc5 = ads2.readADC_SingleEnded(1);

  Voltage1 = (adc0 * 0.1875) / 1000;
  Voltage2 = (adc1 * 0.1875) / 1000;
  Voltage3 = (adc2 * 0.1875) / 1000;
  Voltage4 = (adc3 * 0.1875) / 1000;
  Voltage5 = (adc4 * 0.1875) / 1000;
  Voltage6 = (adc5 * 0.1875) / 1000;
  
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 5);
  display.println("V1");
  display.setCursor(0, 15);
  display.println("V2");
  display.setCursor(0, 25);
  display.println("V3");
  display.setCursor(0, 35);
  display.println("V4");
  display.setCursor(0, 45);
  display.println("V5");
  display.setCursor(0, 55);
  display.println("V6");
  
  display.setCursor(75, 0);
  display.println("Inputs");
  display.setCursor(50, 12);
  display.println(digitalRead(18));
  display.setCursor(60, 12);
  display.println(digitalRead(39));
  display.setCursor(70, 12);
  display.println(digitalRead(34));
  display.setCursor(80, 12);
  display.println(digitalRead(35));
  display.setCursor(90, 12);
  display.println(digitalRead(19));
  display.setCursor(100, 12);
  display.println(digitalRead(21));
  display.setCursor(110, 12);
  display.println(digitalRead(22));
  display.setCursor(120, 12);
  display.println(digitalRead(23));

  display.setCursor(75, 25);
  display.println("T1");
  display.setCursor(78, 35);
  display.println(digitalRead(26));


  display.setCursor(90, 25);
  display.println("T2");
  display.setCursor(93, 35);
  display.println(digitalRead(27));
  
  display.setCursor(55, 45);
  display.println("Button State");
  buttonState = analogRead(buttonPin);
  delay(50);
  display.setCursor(85, 55);
  display.println(analogRead(buttonPin));
  
  display.setCursor(20,5);
  display.println(Voltage1 * 2.5);
  display.setCursor(20,15);
  display.println(Voltage2 * 2.5);
  display.setCursor(20,25);
  display.println(Voltage3 * 2.5);
  display.setCursor(20,35);
  display.println(Voltage4 * 2.5);
  display.setCursor(20,45);
  display.println(Voltage5 * 2.5);
  display.setCursor(20,55);
  display.println(Voltage6 * 2.5);
  display.display();
  display.clearDisplay();
  
  digitalWrite(FC , HIGH);                      // Make FLOW CONTROL pin HIGH
  Serial.println("RS485 SUCCESS");              // Send RS485 SUCCESS serially
  Serial.flush();                               // Wait for transmission of data
  digitalWrite(FC , LOW) ;                      // Receiving mode ON
  delay(500);
  if (Serial.available())
  {
    if (Serial.read() == '5')                  // If 5 available change the LED status
    {
      digitalWrite(ledPin1, HIGH);
      digitalWrite(ledPin2, HIGH);
      digitalWrite(ledPin3, HIGH);
      digitalWrite(ledPin4, HIGH);
      digitalWrite(ledPin5, HIGH);
      digitalWrite(ledPin6, HIGH);
      digitalWrite(ledPin7, HIGH);
      digitalWrite(ledPin8, HIGH);
    }
    else
    {
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin2, LOW);
      digitalWrite(ledPin3, LOW);
      digitalWrite(ledPin4, LOW);
      digitalWrite(ledPin5, LOW);
      digitalWrite(ledPin6, LOW);
      digitalWrite(ledPin7, LOW);
      digitalWrite(ledPin8, LOW);
    }
  }

}

Powered by BetterDocs