I'm working on a project bashing my head into a wall trying to figure out why my arduino keeps disappearing from the network at seemingly random times but then continues it other functions.
My hardware is this:
Uno
WIZ5100 eth shield
4 channel relay (5v rail)
16x2 LCD display (5v rail)
mh-z16 co2 sensor (5v rail)
sht20 tmp humidity sensor (3v)
Off of a 9V2A psu
the relay is on a gnd with the lcd, both sensors are sharing one, and then the last is taken by a 100nf capacitor between reset to allow the shield to come back to life after a power outage without having to manually hit reset.
What's happening is that some times, not all the time, when a relay gets switched the whole unit will disappear from the network but the remaining functions are still visible on the lcd display.
Does anyone have an idea what could be causing this?
After ruling software issues through days of trouble shooting, I'm starting to wonder if the max amps from the CO2 sensor (150mA) is colliding with the relay mA(~60 i think). breaching the 200mA max. But why would this cause the eth shield to loose it's functionality but the rest will continue?
The 200mA you're referring to is max total I/O output pin current. Not 5volt pin current.
How are you powering this setup.
Four relays (4*75mA when active), and LCD (could be 50mA), WIZ5100 (160mA), and CO2 sensor (150mA).
That could add up to >=600mA if you include the Uno itself.
Too much for USB power, and too much for the 5volt regulator if you power the Uno externally.
What are you switching with the relays. Do you have snubbering on the loads/contacts.
Leo..
Please don't modify your original post.
That makes already given answers look stupid.
9volt on the DC socket or on V-in.
Put your finger on the 5volt regulator (next to the DC socket). Is it hot?
I'm surprised that the Uno doesn't shut down every few minutes.
But your problem is probably switching (inductive) loads.
Post a diagram and pictures of the setup.
Leo..
It was not my intent to make you look stupid. I thought I caught it quick enough before I got a response since I didn't get the usual "new comment" notification before updating my post that I'm used to on this forum. Perhaps I updated it before you commented, but because it wasn't a new comment you didn't get the notification that something was changed in the thread.
The top answer given also states that I can draw a total of 1A from the Uno, ~900mA at 7V, less due to the heat you mentioned at higher voltages.But that's still greater than 600mA even at max load.
I'm not trying to dispute your info, just showing where I got mine from. Yes I was mistaken about 200mA thing on the 5V rail. Are you saying that this post on stack exchange is incorrect about being able to pull 900mA from the regulator?
The relay is connected to an AC fan, 2 solenoid valves (a humidifier and a cooler), and some LED strips. No snubbering present; that's a new word for me.
I'm about to go and separate the the relay, and lcd display from the Uno's 5V rail and throw them on a 5V1A psu and see if that helps. When I do so I need to connect the Uno gnd with the other psu gnd too correct?
With 9volt on the DC socket there is 8.3volt on the V-in pin, because of a 0.7volt reverse protection diode drop.
So there is 8.3-5= 3.3volt across the regulator.
With the potential (relays) 600mA, that could generate 3.3*0.6= ~2watt in the regulator.
I think (educated guess) you shoud't dissipate more than 1watt in an Uno regulator.
That also depends a bit on ambient temps (airflow/case).
Powering some (or all) devices from a seperate 5volt supply could help the stressed regulator.
But remember this is probably not your main problem. It seems that switching the AC loads is upsetting the main micro or ethernet chip.
Try disconnecting the loads, one at the time, and run the system for a while.
When you know which load is doing it, then use a snubber circuit across those contacts.
Maybe you should use a 5volt cellphone charger only for the relay module.
Then you can use the opto isolation of that board (by NOT sharing relay ground with Arduino ground).
That (extra layer of isolation) could also help with the AC switching noise problems you're having.
Remove the JD-VCC jumper, and power the relay module with separate 5volt on JD-VCC (not VCC) and relay ground.
Connect VCC of the relay module to Arduino 5volt, and Arduino I/O to relay inputs.
DO NOT connect relay ground to Arduino ground.
Leo..
Well I walked away and tried the setup I mentioned prior to your above post. It's been working an hour and a half.
I will definitely try just running the system without any of the AC devices first before anything else.
I'll give your setup a shot next but I have another question then. I power the LCD and CO2 sensor on the 5V2A supply (I was mistaken when I first mentioned it as a 5V1A dc supply) is what you're recommending correct?
In this instance I would the GND from the relay module to the gnd of the separate DC power supply. But I still need to bridge one of the uno gnd's to the gnd of the second power supply when powering the lcd display and co2 sensor because they do not have said opto isolation, don't I?
The top answer given also states that I can draw a total of 1A from the Uno, ~900mA at 7V, less due to the heat you mentioned at higher voltages.But that's still greater than 600mA even at max load.
If that was your take away from the question you are miss understanding what was said.
from the answer
When you are using an external power supply, through the barrel power connector, you are limited by the local 5V regulator, which is rated for a maximum of 1 Amp. However, this it also thermally limited, meaning that as you draw power, the regulator will heat up. When it overheats, it will shut down temporarily.
It just says the regulator is rated at 1A, it goes on to say how you can never get close to this. A rating is just what you can get when everything is going in your favour, conditions that are never realistically achievable.
The obsolete tutorials on the Arduino site and others imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator imply that this is a usable source of 5 V power. This is absolutely not the case. It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.
the Erhernet chips are sensitive to electromagnetic interference (EMI) generated from relay contacts. the EMI is mainly catched and spreads by ground traces and wires. A RC snubber around AC connections of relay should help to suppress EMI.
if you have an AC zero crossing detector, it is ideal to switch the relay at zero crossing.