hi friends. I used arduino for fault indicator under the 20 kilo volt cable but there is problem some times the arduino interrupt pins activated I think the EMF active the arduino pins and I used 4.7 k resistor for pull down. any way to fix that ? thanks
Your cable weighs 20kg?
We need more information. Start with posting your code in code tags.
MorganS:
Your cable weighs 20kg?We need more information. Start with posting your code in code tags.
no ! the cable is high voltage 3 phase R S T with 20000 volts. the problem is only with pin 1 the arduino is PRO MICRO and the sketch I write attached.
sketch_may25d.ino (10.3 KB)
Fair chance that such a cable (the high current that such cables tend to carry rather than the voltage) are causing problems with your Arduino.
Solution will be one or more of these: build it inside a properly grounded metal box; shield your wires; use a small capacitor on your pins (it does slow down reaction so not good for high speed signals); use a stronger pull-up.
wvmarle:
Fair chance that such a cable (the high current that such cables tend to carry rather than the voltage) are causing problems with your Arduino.Solution will be one or more of these: build it inside a properly grounded metal box; shield your wires; use a small capacitor on your pins (it does slow down reaction so not good for high speed signals); use a stronger pull-up.
thanks for reply. is it good to use 10Kohm resistor for pullup and 104 capacitor ?
10k is weaker a pull-up than 4k7... values such as 2k2 or 1k is what you may have to look for.
100nF sounds good for filtering.
What does 20kv have to do with anything any why are you using an interrupt?
The Arduino cannot be anywhere near that voltage source and neither can the fault relay. In addition to the metal box for Arduino, proper grounding and isolation are a must.
Your code is not visible to mobile users. Please read the “How to use this forum” sticky at the top of each forum sub-section and post your code correctly for review, see topic #7.
It is not only 20KV where you get problems. When I worked for an access control company we were doing a job for the National Grid. One access point was a kilometre away, normally well within spec of the system. But we had endless trouble with the reliability because that cable went through a tunnel that also had a 10KV cable running through it.
Not at all an easy thing to cure.
WattsThat:
Your code is not visible to mobile users. Please read the “How to use this forum” sticky at the top of each forum sub-section and post your code correctly for review, see topic #7.
One can not post 10kB of code in a post. Renaming the ino to txt will help but it's still a big code to dig through on a cell phone.
Write a simple piece of code to just deal with this input problem first ( if that’s what it is) , and you can post that here.
Also explain better what your project is aiming to achieve .
hammy:
Write a simple piece of code to just deal with this input problem first ( if that’s what it is) , and you can post that here.
Also explain better what your project is aiming to achieve .
Hi thanks for reply. here my edited code:
#include "RF24.h"
#include "nRF24L01.h"
#include <avr/sleep.h>
#include <avr/interrupt.h>
RF24 radio(3, 4);
int transmitterId = 0;
const uint64_t pipes[3] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0E2LL, 0xF0F0F0F0E3LL };
const byte pirPin = 3;
int calibrationTime = 30;
long unsigned int lowIn;
long unsigned int pause = 30000;
boolean lockLow = true;
boolean takeLowTime;
int PIRValue = 0;
void setup() {
pinMode(pirPin, INPUT);
transmitterId = 64;
radio.begin();
radio.setPayloadSize(2);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipes[1]);
digitalWrite(pirPin, LOW);
radio.powerDown();
sleep();
}
void loop() {
if (digitalRead(pirPin) == HIGH) {
if (lockLow) {
PIRValue = 1;
lockLow = false;
radio.powerUp();
radio.write(&transmitterId, 1);
delay(50);
}
takeLowTime = true;
}
if (digitalRead(pirPin) == LOW) {
if (takeLowTime) {
lowIn = millis(); takeLowTime = false;
}
if (!lockLow && millis() - lowIn > pause) {
PIRValue = 0;
lockLow = true;
delay(50);
digitalWrite(pirPin, LOW);
radio.powerDown();
sleep();
}
}
}
void sleep() {
GIMSK |= _BV(PCIE);
PCMSK |= _BV(PCINT3);
ADCSRA &= ~_BV(ADEN);
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sei();
sleep_cpu();
cli();
PCMSK &= ~_BV(PCINT3);
sleep_disable();
ADCSRA |= _BV(ADEN);
sei();
}
ISR(PCINT0_vect) {
}
So does this piece of code do what you want it to do?
If not, what does it do and how is it different from what you want it to do?
wvmarle:
So does this piece of code do what you want it to do?If not, what does it do and how is it different from what you want it to do?
when the fault is appear on the high voltage cable ( short circuit ) the fault indicator device LED blinking. the output of the LED from the fault indicator LED is connected to the arduino input pin (3) then the arduino sending the fault via NRF24 module to the base station.
That doesn't answer the question.
Yes or no, does it do what you want?
thanks for all. the problem is solved with 4.7K resistor and 100nf + 22pf cap.
Grumpy_Mike:
It is not only 20KV where you get problems. When I worked for an access control company we were doing a job for the National Grid. One access point was a kilometre away, normally well within spec of the system. But we had endless trouble with the reliability because that cable went through a tunnel that also had a 10KV cable running through it.Not at all an easy thing to cure.
A kelvin-volt is not what you meant!
kV = kilovolt