Hello, i have come here to ask for help on little project i have been working on for a while. I basically made a controller for my terrarium setup using an Arduino uno rev3.
I'm having problems with the program freezing up, i first thought it was because of the temperature sensor not reading correctly, so i disabled that feature for a while and let it run for a while and everything worked perfectly fine. I had also unplugged the electrics like the lamps, heating and pump. I did this for the reason that 'if the arduino freezes the pump wouldn't stop pouring water in the aquarium reservoir.
After a week of running the program with no temperature sensor perfectly fine, i plugged the electrics back in. I found that the arduino freezes up again and also noticed that the water pump is always turned on when its frozen.
This would mean that the water pump would be causing the freezing.
Can i get some advise on how to deal with this problem? The pump i'm using is 15W 230VAC, it's contolled via a simple relay module.
Could You post schematics and a foto of the build?
Most likely it's eletrical noice from the relay contact fingers bouncing.
May SSR, Solid State Relay would do better?
Moving the wiring would be hard at this point since i already printed a casing where everything fits perfectly and can't quite move the components much more.
I can in fact drill a hole on the other side for the low voltage wires to go through seperate from the AC wiring. I can also configure the first relay for the AC pump, so that it's further away from those cables, but then it would still be close to the arduino.
Is there like any component i can add to absorb the electrical noise? If for say moving the wires would not be enough.
I use the DS18B20 for temperature and comes with 1m cable
But i strongly believe the problem is caused by the pump switching on, since i did a small test where i used the relay switch closest to the low voltage wiring, furthest to the right and observed that the program freezes immediately when it switches on.
But that seems to be the cause of the fault.
The interaction of the mains switching transients and the lower voltage controller wiring, including the sensor wiring.
As I said your project is not finished, you cannot rely on the DuPont connectors and protoboard.
I wanna let you know that the problem has been solved!
This morning i simply added a RC-snubber circuit parallel over the pump to absorb the electrical noise and now have no problems anymore with the arduino freezing.
I also added a Watchdog timer to my code for if the code still would manage to freeze. This way it automatically restarts upon an error.