First of all, thanks for any help.
My project is a simple one. I created an automated drum filler. With a potentiometer, you adjust a target weight. Then you place a drum on top of a scale and press a button. The board will read the scale until the weight reaches the target and then shut down the feeding valve. All the project works well and does what it is requested. The main problem is that from time to time the arduino mega board freeze or it reboots (it reboots mainly when it closes the valve). Because it works, I am sure that coding is not a problem, but there must be some short circuit somewhere or the way I connected stuff is draining the power supplies.
Currently, I am redoing the whole thing making sure all the welding and connections are tight.
Karma for a schematic on your first post. Problem is most likely electromagnetic interference from the solenoid, created when it opens and it’s being coupled into the 5 volts and crashing the Uno.
Could be wiring that is too close, for example the solenoid wiring running parallel to the 5 volt supply wiring. Please save us all a bunch of time with playing twenty questions and just follow up with a photo of the installation showing all wiring. We need to see how things are put together. Guessing is difficult, seeing is easy.
Edit: it appears that you have no common ground between the power supplies that connects to the Uno GND. The relay cannot work as shown so that’s a bit weird. Probably a schematic error as the button wouldn’t function as well.
I see the need for a snubber or TVS diode across the valve coil, but without knowing anything about the valve, I can't advise a component.
Just wondering, why are you powering your Mega from 12V when you have a 5V source available? That 12V power source appears redundant (and it's anyway a pretty bad idea to power a Mega off 12V). It's not just because that a Mega has a 5V pin, that's the best way of powering it!
In your situation, do NOT connect the ground wire of the relay module to your Arduino ground pin, but have a wire go straight to the power supply. Otherwise your interference will likely only get worse.
Sounds like the same problem I have been struggling with for days. It can be a noise problem that cause the I2C bus to "hang".
Take a look at my post. If found out that the second power supply caused very strange behavior on the I2C bus. I also had a few freezes causing the external watchdog to kick the 2560 in the ass.
Can you check your wiring closely.
In the circuit diagram you posted, the button when pushed will short the Vcc to gnd.
You need to have a 10K pullup resistor in there somewhere.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.