So a quick overview of the situation before:
12v battery connected to an inverter. This inverter provides ac voltage for my fridge and the phone charger that I use to provide the arduino with power. A thermistor I used to measure the temperature in the fridge. When a certain temperature is reached a relay will change state providing the fridge of power. Works but has some insatiable readings.
Situation now:
I decided to power the arduino directly from the battery. Hoping to get rid of unstable temperature readings and also being to able read the temperature when the inverter is unplugged. To do this I ran a cable directly from the battery to my arduino housing. Here I use a fixed voltage regulator to get a noise free stable 5 volt for my arduino.
With the powerspupply to the arduino switched I happily plugged the power in and everything looked good. However...... When the time came the temperature raised enough for the relay to change state and power the fridge things went wrong.
As soon the relay changed state it changed back and went into a loop doing this switching between states on and of.
To by sure everything was still ok I switched power supplies to the arduino again and everything was ok again. As soon as I powered the arduino from the battery again the relay would start flipping on and of 3 again.
Anybody got any idea what's going on here? Probably missing something but I can not figure out what yet.
Ant help is associated and if any information is missing please let me know what info you need.
Regarding your ground comment, this all is working with one power supply, I just changed the two cables from the one power supply with the other one. Keeping everything the same.
So thanks to terryking I got a hint to Google on optical isolation on the relay board.
So I did some googling but not all loud and clear here. So, I did some more doodling on my tablet and came up with this. This is how the relay is hooked up now and what gives me troubles.
That would be it - and you arguably can use the same power supply if the positive and negative leads are kept paired and only come together from the two modules at the output capacitor of the power supply.