getting false triggers from arduino mega!

Hello,

I am using an arduino mega which controls my home entertainment system but i am getting lots and lots of false triggering!

The setup is like this: a reed sensor is connected one end to a 5v source and the other end to my arduino(and also to the ground with a pull down resistor). When the sensor is triggered with a magnet. The arduino is recieving 5v(HIGH) and then it triggers my x10 module that controls my home entertainment system(beamer,surround,lights,heating,..) and also it powers a transistor so a part of my table slides apart(allowing the beamer to porject on the wall behind it). From the beginning i have noticed strange things, like things that were lying on the table when I left now were next to it. This was an indication the table half had been moving while I was not around. Now I have installed a datalogger on my x10 system and guess what: The arduino triggers more than 10 times a day unwanted!! At first I thought it was a faulty reed sensor so i replaced it with a fysical button. Same result,arduino seems to trigger randomly Also the fact that the home entertainment system turns back off instantly after being enabled suggest the arduino must get some faulty pulses from somewhere... Then I was thinking the cause was that the arduino was connected to my mac mini and everytime the com port closes the arduino resets. Turned out it wasn't the either.

the setup is:

A 12v power supply feeds the motors to my table and drawers. Also on that 12v are multiple 7805's for the 5v feed like arduino and sensors.

Anybody who has an idea what could cause this. It is really bad for my beamer to be turned on and off instantly 10 times a day

thanks!

PS excuse my bad English, it is not my native language

everytime the com port closes the arduino resets.

That does happen though doesn't it? Have you left the Arduino unplugged for a day to prove that's not the issue?

Have you removed the reed switch to see if it's the input that's a problem?

What value is the pull down resistor?

How long is the wire between the reed switch and the Arduino?


Rob

The arduino is now 2 weeks unplugged and still getting the false triggering, so that is not the issue.

The reed sensor is removed and replaced by a simple on/off switch but still having these issues of false triggers

The pull down resistor is 100kOhms (tried multiple from 5kOhms to 100kOhms and at school they suggested 100kOhms was the best)

The wire length is 15cm at most and is lying freely not crossing other wires

Hmmm, well that shot all my ideas down :)

I think 100k is maybe to high but as you say you've tried lower as well. You haven't got the internal pull up resistor enabled by any chance?

Is there a swimming pool pump right next to your power supply? Anything environmental like that?

If not then it must be the code. You could post it here for people to have a look at.

Also maybe record the times you get these triggers. Just spit the millis() value out to a PC and do the maths yourself. Maybe you'll spot a pattern. If the numbers are not all larger than their predecessor then the Arduino is reseting, if they are then that's not the case. Either way the time between them and/or the calculated real time might give you a hint.


Rob

100K is far too large for the pulldown and the wires to the reed switch/button are likely to pick up noise or static. Try reducing it to 1K or 470 ohms.