Hi,
I have been using an Overhead Water Tank Level Indicator and Motor control system based on IC 4049 from last 2 years which was working fine and I thought to have it upgraded to be Controlled by Arduino so that I can enhance the system with some more logics. I did my research for few weeks and finally able to make it with Arduino Nano and Implement the system and it work exactly as I was expected.
Now after 2 weeks of daily use suddenly it just stopped behaving in the way it was made for so after some investigation I found the sensor reading is not stable and started fluctuating from 0 to 1 and vice versa.
Talking about the sensor it just a 5 feet PVC pipe with four steel screws at 4 different levels and one steel screw for +VCC at the bottom and I have managed to seal the PVC pipe in such a way that water cannot enter inside and damage the wire/joints at over the period of time. This might be the best option but I am ok to clean/replace it in few years and it’s cost effective.
The reason it stopped working after 2 weeks is because I was using 2 year old sensor which was with Iron screws and telephone line copper cable wrapped “outside” of PVC pipe which was completely burned out because of corrosion but I am not sure why now it is not working with the new sensor setup with steel screws I have described above. To be more precise here, everything works fine with short cable length of 1 feet or less but not when I connect 30 feet CAT5 cable as sensor values just float around.
I am using Arduino Nano with external 10k Pull-down register at pin 9 to 12 and cat 5 cable of around 30 feet attached with the sensor setup described above. I have just downloaded the Fritzing app to make the schematic but yet to see how to make one, if needed I will make the schematic and attach it.
Here are my findings so far:
-
SOMETIME new sensor reading are stable with both short cable length and long cable length wire when the system is powered by my laptops 3.0 USB port running on batteries but its start floating when I attach the laptop charger. Same happens when the system is powered by 5 volt smartphone wall charger. Using of less or high ampere charger does not have any effect here.
-
I have to use both Arduino’s Internal Pull-up and External pull-down register ate same time for each pin to get it work which should not be the case I believe.
-
Because of the long wire I have tried to change the External pull-down values from 10k to 1k but it just stop reading values form sensor.
My code is too long to post here and also irrelevant to the actual problem so for debugging I am using below simple and short code nowadays and hoping it to work.
After going through all the section of the forum I have chosen this section to post my question , If this is not the correct section of forum please let me know.
Any help will be appreciated.
Thanks
Shantanu
#define forthLevel 9
#define thirdLevel 10
#define secondLevel 11
#define firstLevel 12
void setup() {
Serial.begin(9600);
pinMode(firstLevel, INPUT_PULLUP); //PULLUP to avoid floating values when input is low, addition 10 k register is connected between
pinMode(secondLevel, INPUT_PULLUP); //each pin and ground
pinMode(thirdLevel, INPUT_PULLUP);
pinMode(forthLevel, INPUT_PULLUP);
digitalWrite(firstLevel, HIGH);
digitalWrite(secondLevel, HIGH);
digitalWrite(thirdLevel, HIGH);
digitalWrite(forthLevel, HIGH);
}
void loop() {
int firstLevelReading = digitalRead(firstLevel);
int secondLevelReading = digitalRead(secondLevel);
int thirdLevelReading = digitalRead(thirdLevel);
int forthLevelReading = digitalRead(forthLevel);
Serial.println("--------Status--------"); //reading it via Putty from my laptop.
Serial.print("firstLevelReading - ");
Serial.println(firstLevelReading);
Serial.print("secondLevelReading - ");
Serial.println(secondLevelReading);
Serial.print("thirdLevelReading - ");
Serial.println(thirdLevelReading);
Serial.print("forthLevelReading - ");
Serial.println(forthLevelReading);
Serial.write(27); // ESC command
Serial.print("[H"); // cursor to home command
}