Did I burn the DI s? - tugalsan - 03-06-2023
I accidently plug 12 Volt to GND of DI sockets.
Even though, I did not plugged any wire on DI, I am getting the below output.
When I check it with Voltmeter, DIs is giving me 12V
Does that mean, I did burn the card? Or a code error?
code:
Code: #include "PCF8574.h"
//I2C INPUT
TwoWire I2C_0 = TwoWire(0);
PCF8574 pcf8574_I1(&I2C_0, 0x24, 4, 5);
PCF8574 pcf8574_I2(&I2C_0, 0x25, 4, 5);
PCF8574 pcf8574_I3(&I2C_0, 0x21, 4, 5);
PCF8574 pcf8574_I4(&I2C_0, 0x22, 4, 5);
//I2C RELAY
TwoWire I2C_1 = TwoWire(1);
PCF8574 pcf8574_R1(&I2C_1, 0x24, 15, 13);
PCF8574 pcf8574_R2(&I2C_1, 0x25, 15, 13);
PCF8574 pcf8574_R3(&I2C_1, 0x21, 15, 13);
PCF8574 pcf8574_R4(&I2C_1, 0x22, 15, 13);
void setup_input() {
for(int i=0;i<=7;i++){
pcf8574_I1.pinMode(i, INPUT);
pcf8574_I2.pinMode(i, INPUT);
pcf8574_I3.pinMode(i, INPUT);
pcf8574_I4.pinMode(i, INPUT);
}
pcf8574_I1.begin();
pcf8574_I2.begin();
pcf8574_I3.begin();
pcf8574_I4.begin();
}
void setup_output() {
for(int i=0;i<=7;i++)
{
pcf8574_R1.pinMode(i, OUTPUT);
pcf8574_R2.pinMode(i, OUTPUT);
pcf8574_R3.pinMode(i, OUTPUT);
pcf8574_R4.pinMode(i, OUTPUT);
}
pcf8574_R1.begin();
pcf8574_R2.begin();
pcf8574_R3.begin();
pcf8574_R4.begin();
for(int i=0;i<=7;i++) {
pcf8574_R1.digitalWrite(i, HIGH);
pcf8574_R2.digitalWrite(i, HIGH);
pcf8574_R3.digitalWrite(i, HIGH);
pcf8574_R4.digitalWrite(i, HIGH);
}
}
void setup_serial(){
Serial.begin(115200);
while (!Serial && (millis() < 3000));
}
void print_chip_arduino(){
Serial.print(F("\n\n----------------\n\n"));
Serial.print(F("ARDUINO_BOARD:"));
Serial.println(String(ARDUINO_BOARD));
}
unsigned long currentTime = millis();
void refreshCurrentTime(){
currentTime = millis();
}
void print_loopHeader(){
Serial.print(F("---------"));
Serial.print(F("t: "));
Serial.print(String(currentTime));
Serial.println(F(" ---------"));
}
void print_input(){
for(int i=0;i<=7;i++) {
bool input1 = pcf8574_I1.digitalRead(i);
bool input2 = pcf8574_I2.digitalRead(i);
bool input3 = pcf8574_I3.digitalRead(i);
bool input4 = pcf8574_I4.digitalRead(i);
Serial.print(F("i:"));
Serial.print(String(i));
Serial.print(F(" I1:"));
Serial.print(String(input1));
Serial.print(F(" I2:"));
Serial.print(String(input2));
Serial.print(F(" I3:"));
Serial.print(String(input3));
Serial.print(F(" I4:"));
Serial.println(String(input4));
}
}
void setup() {
setup_input();
setup_output();
setup_serial();
print_chip_arduino();
}
void loop() {
refreshCurrentTime();
print_loopHeader();
print_input();
delay(1000);
}
output:
Code: ---------t: 8096 ---------
i:0 I1:1 I2:1 I3:1 I4:1
i:1 I1:1 I2:1 I3:1 I4:1
i:2 I1:1 I2:1 I3:1 I4:1
i:3 I1:1 I2:1 I3:1 I4:1
i:4 I1:1 I2:1 I3:1 I4:1
i:5 I1:1 I2:1 I3:1 I4:1
i:6 I1:1 I2:1 I3:1 I4:1
i:7 I1:1 I2:1 I3:1 I4:1
RE: Did I burn the DI s? - admin - 03-06-2023
dc12v connect to DI is no problem, i think you can use our DI arduino code for a testing.
https://www.kincony.com/forum/showthread.php?tid=1776
RE: Did I burn the DI s? - tugalsan - 03-06-2023
(03-06-2023, 01:08 PM)admin Wrote: dc12v connect to DI is no problem, i think you can use our DI arduino code for a testing.
https://www.kincony.com/forum/showthread.php?tid=1776
I didnt connect 12V on DIs. I connect 12V on GND of DI socket.
Please see picture.
This is the result of the test code:
Code: KEY1 PRESSED
KEY2 PRESSED
KEY3 PRESSED
KEY4 PRESSED
KEY5 PRESSED
KEY6 PRESSED
KEY7 PRESSED
KEY8 PRESSED
KEY9 PRESSED
KEY10 PRESSED
KEY11 PRESSED
KEY12 PRESSED
KEY13 PRESSED
KEY14 PRESSED
KEY15 PRESSED
KEY16 PRESSED
KEY17 PRESSED
KEY18 PRESSED
KEY19 PRESSED
KEY20 PRESSED
KEY21 PRESSED
KEY22 PRESSED
KEY23 PRESSED
KEY24 PRESSED
KEY25 PRESSED
KEY26 PRESSED
KEY27 PRESSED
KEY28 PRESSED
KEY29 PRESSED
KEY30 PRESSED
KEY31 PRESSED
KEY32 PRESSED
RE: Did I burn the DI s? - admin - 03-06-2023
12v short with GND is dangerous.
i suggest you use our code for a testing , if not work well, the board chip is broken.
RE: Did I burn the DI s? - tugalsan - 03-31-2023
(03-06-2023, 01:36 PM)admin Wrote: 12v short with GND is dangous.
i suggest you use our code for a testing , if not work well, the board chip is broken.
I do not know what dry or wet contact mean.
Are DI supposed to be conntected to GND? Is it mean dry contact?
Its because, when i connect GND to a DI it is detected (!)
The scheme is like below:
So even i plugged 12 Volt to GND, the card survived?
RE: Did I burn the DI s? - admin - 03-31-2023
you are right.
if a short time for 12V connect to GND, maybe card survived, but it's dangerous.
|