not sure how to explain this, my project is a home monitoring power wall and it works great my problem is when im recording data and anything in the house switches on or off my data USB port quits working and i need to unplug USB and or reboot computer to get USB port to work again.
i have grounded my project to the battery pack ground and to the house ground witch helped 100% but it still stops the data / USB port now and then.
im not a electronic person but i was thinking to put a 10uf cap between mega ground and vin ? bad idea or good idea or...... ??
Sounds like common-mode spike on the USB cable - you really don't want this, its risking your computer. Is there any way you can create and opto-isolation barrier in your setup, or perhaps power it from a different source that's less sensitive, and communicate wirelessly with the computer?
Would need to know a lot more about the project but I'm guessing you're getting capacitively coupled interference into your system that was grounded via the computer, which is why the additional ground
connection helped (shunting current away from the USB port).
Transients on mains cabling can easily reach the kV level which will couple very effectively to nearby circuits and
sensors through stray capacitance.
well i put a 10uf cap on ground and vin and so far no spikes and data is recording.
this is a mega with 8 100amp solid state relays, 8 100amp CT current transformer, 8 voltage dividers for 8 6v 48v power wall ,1 temperature sensor for fan on mega board and solid state relays , 2 more temperature sensors 1 for battery box temperature ,1 for outside humidity & temperature.
my power supply is 9v 1500ma hook to ground and vin.
i also have a 12vdc power supply for fan threw a relay.
amir2:
my power supply is 9v 1500ma hook to ground and vin.
Not a very sensible way to power an Arduino!
The on-board regulator can only provide a few hundred mA before it overheats and (hopefully reversibly) shuts down. So whether the supply can provide 300 mA or 1500 mA becomes irrelevant!
For stable operation you need to provide a regulated 5 V supply to the "5V" pin, capable of providing whatever total current is required for the Arduino and its output pins and any other components connected to the same line. A convenient device is a common USB "phone charger" rated at 1 or 2.1 Amps.
There is a concern however about providing 5 V to the Arduino "back-feeding" the USB port and causing the computer's USB interface to shut down, curiously just what you seem to be describing! Given that you have a reliable 5 V supply for the Arduino, this is overcome by breaking the 5 V line in the USB cable.
With 9volt on the DC socket you can only draw about 200mA total from the Mega before the 5volt regulator overheats.
So a 1500mA supply is gross overkill.
Maybe a 5volt cellphone charger connected to the USB socket is a better way to power the Mega.
With opto isolation and a separate supply for the relay coils to minimise ground loops and interference.
Only the relay coil side should be grounded, not the Arduino/laptop side.
Leo..