For pins 3 and 4
i'm setting them as INPUT
pulling them down with a 10k resistor
All is well, and the value of digitalRead() is LOW, which makes sense.
As soon as i touch these pins with anything else, (for example a Dupont pin not connected to anything and not touching anything else, like my hand, or a wire not connected to anything),
The value from digitalRead() becomes a HIGH and remains until i remove the item.
This is weird behavior.
I tested voltage with a multimeter on the external wire .. says 0V
When touching says 0.08V, but even this should not trigger a HIGH.
Did you measure the resistors. Are you sure they are 10k.
A high value resistor and a hand/wire could pick up mains hum.
It could switch the pin high/low on the mains frequency.
Maybe post the code and/or a picture of the setup.
A common problem is a breadboard with interrupted ground/supply lines.
Leo..
Connect the wiring to A0 and A1 and read analog. Putting a meter on the circuit probably changed the circuit and you are dealing with low current, likely induced voltage.
Or just do enough digital reads to empty the ghost charge
while ( digital read == HIGH )
{
count the loops
}
loops are analog to charge.
As soon as i touch these pins with anything else, (for example a Dupont pin not connected to anything and not touching anything else, like my hand, or a wire not connected to anything),
I would expect that if the pulldown was gone, otherwise there's something you're not saying.
As soon as i touch these pins with anything else, (for example a Dupont pin not connected to anything and not touching anything else, like my hand, or a wire not connected to anything),
Then you have NOT got it wired up the way you describe.
The setup includes a high power 100W LED Projector connected to the mains of the house.
the MEGA 2560 is also connected to the mains via a 5V transformer/adapter.
For some reason, the problem is occurring only when the breaker for the LED projector is ON.
When the projector is OFF, everything is normal.
So what's going on here ? and is there a workaround to keep the projector ON?
It is likely that the mains units have some sort of leakage current they all do it is part of the design. That could be causing higher than normal levels of interference. Things to try:-
Use a much smaller pull up resistor, I would try a 1K and if that improves things but not fixes them then try a 510R.
Try and connect the mains ground to the Arduino ground.
The projector ground and Arduino ground are connected together aren't they?
exhauster:
So what's going on here ? and is there a workaround to keep the projector ON?
The jumper you touch to the pin is an antenna and the station is very close.
Try shielding your transformer(s) in well grounded copper or even steel screen or box.
Use shielded wiring and shield your board if you still have trouble.
Grumpy_Mike:
Well a lot more than you originally told us.
It is likely that the mains units have some sort of leakage current they all do it is part of the design. That could be causing higher than normal levels of interference. Things to try:-
Use a much smaller pull up resistor, I would try a 1K and if that improves things but not fixes them then try a 510R.
Try and connect the mains ground to the Arduino ground.
The projector ground and Arduino ground are connected together aren't they?
Well:
i'm not using PULL UP at all ... all my resistors are to PULL DOWN inputs. so lowering the R value would make things worse i guess
What do you mean connecting grounds ? LED Projector and mains are 220 VAC .. there's no ground there's only P and N. Arduino on the other hand has ground and VCC. so what you're suggesting is somewhat confusing.
As for the leakage issue, i suspect you're onto something.
what can i do to prevent / remedy leakage or feedback ?
GoForSmoke:
The jumper you touch to the pin is an antenna and the station is very close.
Try shielding your transformer(s) in well grounded copper or even steel screen or box.
Use shielded wiring and shield your board if you still have trouble.
This is a valid answer, but a very unlikely scenario.. since the arduino box is in a room under 60cm of concrete in all directions.
Plus.. PULLING DOWN the input pin with a 10k resistor would take care of radio interference i think.
Measuring voltage on the arduino pin while PULLED DOWN and the LED is ON gives off 80 mVDC.
i couldn't measure VAC at the time, but it seems the it has a frequency to it since the behavior programmed on the board is that of a frequency. (meaning that it's as if someone is clicking the switch button connected to the input pins continuously ON and OFF)
This brings up "Grumpy_Mike"'s theory into play.
but i have no idea how to get rid of leakage or feedback in this case
A (poor) solder joint can look OK but not make an electrical connection. If the connection is good, you have a serious and perhaps not easily solved problem.
Check the connection by measuring the resistance from the input pin to ground elsewhere.
Plus.. PULLING DOWN the input pin with a 10k resistor would take care of radio interference i think.
Look if you knew then you would not be asking questions here would you?
Why are you so reluctant to take advice from people who know far better than you?
I was rummaging through some old Magazines today and I can across my first published article, the date was 1972, so I have been doing this sort of thing for a long time. I am not saying that a change to a 1K will solve it what I am saying is that it should be 10 times less prone to interference. And I am advising you to try it.
You can theories until the cows come home but you will only fix things by trying things. There are lots of things to try and I am suggesting the simplest / most effective first. If you do not want help then do not ask for it.
Grumpy_Mike:
Look if you knew then you would not be asking questions here would you?
Why are you so reluctant to take advice from people who know far better than you?
I was rummaging through some old Magazines today and I can across my first published article, the date was 1972, so I have been doing this sort of thing for a long time. I am not saying that a change to a 1K will solve it what I am saying is that it should be 10 times less prone to interference. And I am advising you to try it.
You can theories until the cows come home but you will only fix things by trying things. There are lots of things to try and I am suggesting the simplest / most effective first. If you do not want help then do not ask for it.
Chill man, no need to go on the offensive here.
I did try what you suggested. and it changes nothing.
That's why i'm leaning towards your other theory of leakage....
and BTW where does turning the LED projector on or off fit here ?
because it's making all the difference.
Yes TomGeorge. I will post a picture the next time i visit the house where the installation is.
I also need to add a new observation.
Turns out it's not just the projector causing the issue.
Any high load component used in the house will cause the issue, like Air condition unit, or the washing machine.
Could it be that the high current is inducing a lower one on the input wires powerful enough to give out a HIGH?