Introduction #
- This guide is intended to test the features and the basic operation of the device, the NORVI IIOT-AE01-T (transistor model).
- NORVI IIOT-AE01-T test program.
Table of Test Instructions #
Flash the test code firmware before testing the device. Follow the instructions given in the Guide to Flashing the Test Code Firmware guide to flash the binary code.
Testing component/feature | Test | Expected Output/Outputs |
Power | Provide a 24V DC supply. | The red LED inside the device glows. The display turns on. |
Display | Power up the device using a USB cable or a 24V DC supply. | The display starts with the Norvi logo. The device model is displayed. A final screen with Input, output, and Push Button status appears. The output-side LED indicators glow in a pattern. |
Digital Inputs | Power up the device using a 24V DC supply. Connect the digital input side GND and COM pins and supply 24V DC to every digital input one by one. | Refer to the expected outputs of the Display check above. In the input status, the status of all eight digital inputs will be 1.(As they are internally pulled up) The input status changes from 1 to 0, and the input side LED indicator starts to glow accordingly. |
Transistor Outputs | Power up the device using a 24V DC supply. | Toggling output status (from 0 to 1) is observed on the display for the 8 transistor outputs, which follows the output side LED indicator blinking pattern. Whenever these LEDs are on, it means the respective transistor is on. |
Transistor Outputs (continued) | To check the working of the 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 two transistor pins, one by one, after a 15-second gap. | The multimeter shows a 24 V 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 Buttons | Press the three 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 the RS-485 converter. Plug the USB end of the USB-to-RS-485 converter into the PC. Power up the Norvi device using a USB Cable. Open the Arduino IDE application. Select the correct COM port of the USB to RS-485 converter in the Arduino IDE and open the serial Monitor. Send the Number ‘5’ in the serial monitor. | In the serial monitor, the “RS485 SUCCESS” statement is printed. This indicates that the RS-485 sending operation is functioning properly on the Norvi device. Once the 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 receiving operation is functioning properly on the Norvi device. |
Test Program #
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "FS.h"
#define ANALOG_PIN_0 32
#define INPUT1 18
#define INPUT2 39
#define INPUT3 34
#define INPUT4 35
#define INPUT5 19
#define INPUT6 21
#define INPUT7 22
#define INPUT8 23
#define OUTPUT1 26
#define OUTPUT2 27
#define OUTPUT3 14
#define OUTPUT4 12
#define OUTPUT5 13
#define OUTPUT6 15
#define OUTPUT7 2
#define OUTPUT8 33
#define RS485_RXD 3
#define RS485_TXD 5
#define RS485_FC 4
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
int analog_value = 0;
int readSwitch(){
analog_value = analogRead(ANALOG_PIN_0);
return analog_value;
}
void setup() {
Serial.begin(9600);
Serial.println("Hello");
pinMode(RS485_FC, OUTPUT);
digitalWrite(RS485_FC, HIGH);
Serial1.begin(9600, SERIAL_8N1,RS485_RXD,RS485_TXD);
digitalWrite(RS485_FC, HIGH); // RS-485
pinMode(OUTPUT1, OUTPUT);
pinMode(OUTPUT2, OUTPUT);
pinMode(OUTPUT3, OUTPUT);
pinMode(OUTPUT4, OUTPUT);
pinMode(OUTPUT5, OUTPUT);
pinMode(OUTPUT6, OUTPUT);
pinMode(OUTPUT7, OUTPUT);
pinMode(OUTPUT8, OUTPUT);
pinMode(INPUT1, INPUT);
pinMode(INPUT2, INPUT);
pinMode(INPUT3, INPUT);
pinMode(INPUT4, INPUT);
pinMode(INPUT5, INPUT);
pinMode(INPUT6, INPUT);
pinMode(INPUT7, INPUT);
pinMode(INPUT8, INPUT);
Wire.begin(16,17);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.display();
adcAttachPin(32);
}
void loop() {
Serial.println("");
Serial.print(digitalRead(INPUT1));
Serial.print(digitalRead(INPUT2));
Serial.print(digitalRead(INPUT3));
Serial.println(digitalRead(INPUT4));
Serial.print(digitalRead(INPUT5));
Serial.print(digitalRead(INPUT6));
Serial.print(digitalRead(INPUT7));
Serial.println(digitalRead(INPUT8));
Serial.println("");
Serial.print("Push button ");Serial.println(readSwitch());
Serial.println("");
digitalWrite(OUTPUT1, HIGH);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, HIGH);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, HIGH);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, HIGH);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, HIGH);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, HIGH);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, HIGH);
digitalWrite(OUTPUT8, LOW);
delay(200);
digitalWrite(OUTPUT1, LOW);
digitalWrite(OUTPUT2, LOW);
digitalWrite(OUTPUT3, LOW);
digitalWrite(OUTPUT4, LOW);
digitalWrite(OUTPUT5, LOW);
digitalWrite(OUTPUT6, LOW);
digitalWrite(OUTPUT7, LOW);
digitalWrite(OUTPUT8, HIGH);
delay(200);
digitalWrite(RS485_FC, HIGH); // Make FLOW CONTROL pin HIGH
delay(500);
Serial1.println(F("RS485 01 SUCCESS")); // Send RS485 SUCCESS serially
delay(500); // Wait for transmission of data
digitalWrite(RS485_FC, LOW) ; // Receiving mode ON
delay(1000);
while (Serial1.available()) { // Check if data is available
char c = Serial1.read(); // Read data from RS485
Serial.write(c); // Print data on serial monitor
}
}