power/reboot issues when switching relay state

On my adventure to get stable temperature readings to control my fridge in my campervan with an arduino I stumbled upon another issue.

Trying to get rid of unstable readings due to noise made by my inverter I decided to power the arduino directly from my leisure battery. No success

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.

Hi,

There is a complicated reality of how this is all wired, and where "Ground" is etc etc. Here is a page with suggestions on how to approach this:

https://arduinoinfo.mywikis.net/wiki/Arduino-Project-Planning-Electrical

Does your relay board have optical isolation??

This is the relay I am using

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.

I am still not clear on the wiring.
Can you draw up a wiring diagram? Pencil, paper and a camera are good enough.

vinceherman:
I am still not clear on the wiring.
Can you draw up a wiring diagram? Pencil, paper and a camera are good enough.

This is what I could do on my tablet, hope this helps

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.

This is how I think it is supposed to be? But still not all clear on that so any help would be appreciated.

Or should it be like this ? Totally confused now.....

Vinceherman will those drawings do?

Another try, got my soldering iron up and running again. (Kind of) Can anybody please give me some feedback on my thoughts here?

Remove the jumper.

Arduino Vcc goes to "Vcc" on the relay board, Arduino output pin goes to "In1". No ground connection from Arduino.

Relay power supply +ve goes to "JD-VCC", relay power supply -ve goes to "GND".


Go on! Click it!

Thanks a lot for the reply Paul__B.

So this is my final try just to be sure :stuck_out_tongue:

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.