tolgadurudogan
Published © GPL3+

V-I Component Tester Interface v2

If you have an oscilloscope, you don't need to buy a V-I Component Tester. Development based on v0.

IntermediateFull instructions provided766
V-I Component Tester Interface v2

Things used in this project

Hardware components

Plastic Enclosure, Project Box
Plastic Enclosure, Project Box
×1
Resistors (varies, refer to circuit schematics and layouts)
×40
Relay, HUI KE HK19F-DC3V-SHG
×8
Transistor, BC237C
×8
Diode, 1N5408G
×8
Capacitor (Ceramic), 100nF 25V
×1
Capacitor (Ceramic), 220nF 25V
×1
Capacitor (Electrolythic), 330uF 25V
×1
Capacitor (Electrolythic), 470uF 25V
×2
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
×3
Female/Female Jumper Wires
Female/Female Jumper Wires
×60
Transformer, PCB-Type Enclosed, 1x 12VAC 5VA Sec.Coil
×1
Transformer, PCB-Type Enclosed, 2x 9VAC 3.2VA Sec.Coil
×1
Arduino Nano R3
Arduino Nano R3
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Oscilloscope

Story

Read more

Custom parts and enclosures

Power Supply Board Layout

Power Supply Board Layout

VAC Selection Board Layout

VAC Selection Board Layout

Relay Board Layout

Relay Board Layout

Resistor Board Layout

Resistor Board Layout

LED Board Layout

LED Board Layout

Push-Button Board Layout

Push-Button Board Layout

Schematics

VI Component Tester(50 Hz v2.0)-0.Principal Circuit

Principal Circuit-Overall

VI Component Tester(50 Hz v2.0)-1.VAC Selection Board

VAC Selection Board + Arduino Nano mount base

VI Component Tester(50 Hz v2.0)-2.Relay Board(Single Relay Typical)

Relay Board - Typical for Single Relay.
There will be 5 relays on board.

VI Component Tester(50 Hz v2.0)-3.LED Board

LED Board

VI Component Tester(50 Hz v2.0)-4.Push Button through AI

Push Button Circuit

VI Component Tester(50 Hz v2.0)-5.Interconnections

Interconnection Diagram

Code

Code

Arduino
/* Keypad Hardware & Reading Setup */
// Keypad shall be powered by Arduino's 3.3V supply.
// When requested <__KeypadSamples> ea. reading executed and their
// arithmetical average value is calculated to determine pressed key.
#define _KeypadChannel  A0 // Analog Input for Keypad
#define _KeypadSamples   5 // Sampling Qty for Averaging
#define _KeypadDelayMS 200 // Time Delay (ms) after reading 

/* Keypad Reading Values */
#define _KeyNONE  0 // No any key is pressed
#define _KeyCINC  1 // Current Sensitivity Increase
#define _KeyCDEC  2 // Current Sensitivity Decrease
#define _KeyCCS   3 // Current Sensitivity Continuous Switching
#define _Key3V3   4 // Voltage Set, 3V3
#define _Key5V    5 // Voltage Set, 5V
#define _Key12V   6 // Voltage Set, 12V

/* Command Channels (DO) to Circuit */
#define _12V    2 // 12V Enable/Disable
#define _3V5V   3 // 3.3V/5V (0: 3V, 1: 5V)
#define _CS47R  4 // Current Sensitivity.1 (47R)
#define _CS1K   5 // Current Sensitivity.2 (1K)
#define _CS10K  6 // Current Sensitivity.3 (10K)
#define _CS1M   7 // Current Sensitivity.4 (1M)
#define _CS10M  8 // Current Sensitivity.5 (10M)

/* LED Interfaces */
#define _PWRLED 9 // Power LED
// Other LEDs are controlled directly by circuit.


/* Startup Tests Section */
boolean StartUpTests(){
  // Important: Relay power supply circuit is capable to power 
  // 3 relays simultaneously.
  // Power LED: Shall be blinked for ~1 seconds, then kept off
  // during initial tests.
  for (int i=0;i<=5;i++) {
      digitalWrite(_PWRLED, HIGH); delay(100);
      digitalWrite(_PWRLED, LOW);  delay(100);
     } 
  // Each command shall be activated once for verification.
  digitalWrite(_3V5V, LOW); delay(200);  // Test: 3.3V
  digitalWrite(_3V5V, HIGH); delay(200); // Test: 5V
  digitalWrite(_12V,  HIGH); delay(200); // Test: 12V
  // For safety, circuit shall remain at 3.3V level at the beginning
  digitalWrite(_3V5V, LOW); delay(200);  
  digitalWrite(_12V,  LOW); delay(200);
  
  digitalWrite(_CS47R,HIGH); delay(200);
  digitalWrite(_CS47R,LOW);  delay(200);
  digitalWrite(_CS1K, HIGH); delay(200);
  digitalWrite(_CS1K, LOW);  delay(200);
  digitalWrite(_CS10K,HIGH); delay(200);
  digitalWrite(_CS10K,LOW);  delay(200);
  digitalWrite(_CS1M, HIGH); delay(200);
  digitalWrite(_CS1M, LOW);  delay(200);
  digitalWrite(_CS10M,HIGH); delay(200);
  digitalWrite(_CS10M,LOW);  delay(200);
  
  digitalWrite(_CS47R,HIGH);

  digitalWrite(_PWRLED,HIGH);
}


/* Continuous Current Sensitivity Switching (CCS) */
/* CCS switch turns CCS on. It's also possible to change test voltage
   during CCS.
   CCS can be tuned off by pressing any current range adjustment switch
   (+/-) or CCS.
   It's also possible to adjust test voltage during CCS.
*/
byte    CSense[5]   = {_CS47R,_CS1K,_CS10K,_CS1M,_CS10M};
byte    CSenseIndex = 1;
boolean CSenseCCS   = 0;

void toCircuit_CCS(){
int Direction = 1; // 1:Upward, -1:Downward  
 do {
     CSenseIndex+=Direction; 
     if(CSenseIndex==5) Direction=-1;
     if(CSenseIndex==1) Direction= 1;
     for (int i=0; i<=4; i++) digitalWrite(CSense[i],LOW);
     digitalWrite(CSense[CSenseIndex-1],HIGH);
     int Key = getKeyAnalog(_KeypadChannel,_KeypadSamples,_KeypadDelayMS);
     switch (Key) {
        case _KeyNONE: break;
        case _KeyCINC: CSenseCCS=0; break;
        case _KeyCDEC: CSenseCCS=0; break;
        case _KeyCCS : CSenseCCS=0; break;
        case _Key3V3 : digitalWrite(_12V,LOW);  digitalWrite(_3V5V,LOW);
                       break;
        case _Key5V  : digitalWrite(_12V,LOW);  digitalWrite(_3V5V,HIGH);
                       break;
        case _Key12V : digitalWrite(_3V5V,LOW); digitalWrite(_12V,HIGH);
                       break;
     }
    delay(1000); 
    }
 while(CSenseCCS);
}


/* Keypad Reading */
int getKeyAnalog(int _Channel, int _Samples, int _DelayMS){
 // Keypad shall be powered by Arduino's 3.3V supply.
 float _Key=0.0;
 for (int i=1; i<=_Samples; i++) _Key+=analogRead(_Channel);
 if (_Key<20) _Key=0.0; // No key is pressed.
 _Key/=(_Samples*65);
    /* 
      65 is for index mapping.
     Keys generate approx. {75,145,210,280,350,430} values.
     Dividing value by 65, generates index number {1,2,3,4,5,6] for each key.
     0: No any key is pressed
     1: Increase Current Sensitivity
     2: Decrease Current Sensitivity
     3: Current Sensitivity Continuous Switcing(CCS) On
     4: Test Voltage=3.3V
     5: Test Voltage=5V
     6: Test Voltage=12V Enable/Disable
     */
 delay(_DelayMS);
 return((int)_Key);
}

/* Setup and Loop */
void setup() {
  pinMode(_3V5V,  OUTPUT); digitalWrite(_3V5V,  LOW);
  pinMode(_12V,   OUTPUT); digitalWrite(_12V,   LOW);
  pinMode(_CS47R, OUTPUT); digitalWrite(_CS47R, LOW);
  pinMode(_CS1K,  OUTPUT); digitalWrite(_CS1K,  LOW);
  pinMode(_CS10K, OUTPUT); digitalWrite(_CS10K, LOW);
  pinMode(_CS1M,  OUTPUT); digitalWrite(_CS1M,  LOW);
  pinMode(_CS10M, OUTPUT); digitalWrite(_CS10M, LOW);
  pinMode(_PWRLED,OUTPUT); digitalWrite(_PWRLED,LOW);
  StartUpTests();
}

void loop() {
switch (getKeyAnalog(_KeypadChannel,_KeypadSamples,_KeypadDelayMS)) {
        case _KeyNONE: break;
        case _KeyCINC: CSenseIndex++; if(CSenseIndex>5) CSenseIndex=1; 
                       for (int i=0; i<=4; i++) digitalWrite(CSense[i],LOW);
                       digitalWrite(CSense[CSenseIndex-1],HIGH);
                       break;
        case _KeyCDEC: CSenseIndex--; if(CSenseIndex<1) CSenseIndex=5;
                       for (int i=0; i<=4; i++) digitalWrite(CSense[i],LOW);
                       digitalWrite(CSense[CSenseIndex-1],HIGH);
                       break;
        case _KeyCCS : CSenseCCS=1; toCircuit_CCS();
                       break;
        case _Key3V3 : digitalWrite(_12V,LOW);  digitalWrite(_3V5V,LOW);
                       break;
        case _Key5V  : digitalWrite(_12V,LOW);  digitalWrite(_3V5V,HIGH);
                      break;
        case _Key12V : digitalWrite(_3V5V,LOW); digitalWrite(_12V,HIGH);
                       break;
  }
}

Credits

tolgadurudogan

tolgadurudogan

4 projects • 20 followers

Comments