Webthermostat operation help

Hi All,

This would be my first post.

I would be great full if someone could take a look at this code to see whats causing this problem.

I am very new to the arduino scene and only know bash coding C language is new to me.

I am using this for peltier control on/off with the following hardware

Arduino Mega 2560
DHT22 sensor
Wiznet w5100 etheernet shield clone
16 channel relay module
TEC 72watt peltier x4 running from the one output "led" pin
725 watt HP server Power Supply

The problem is when i set the temperature in the thermostat area "Web browser" to ON in software turns LED ON and relays OFF an OFF in software turns LED OFF and relays ON (led's become active on relay module) this is the opposite to what i need.

What i need is to set the desired temperature and hold as close as possible to that temp set "auto mode".

I have change HIGH to LOW and vice versa, Also changed the stare; // 0 is OFF, 1 is ON to 0 is ON and 1 to OFF no difference.

I hope this is being posted in the correct area and i hope this makes sense.

Thanks in advance for any help.

Regards,
Mike.

Webthermostat-Mega-14-APR-2016.ino (15.6 KB)

Hi again,

After thinking this may be hardware related and not code related.

Can you guys/gals take a quick look at the code attached to verify this.

Many thanks,
Mike.

Webthermostat-Mega-14-APR-2016.ino (15.6 KB)

Can you guys/gals take a quick look at the code attached to verify this.

The code you posted does something. You expect it to do something. Without knowing what those two somethings are, I see no reason to read your code.

Hi PaulS,

I have explained what the two somethings i want the code to do.

I never wrote the code nor modified it nor ever written code before, Im simply asking for assistance.

Thankyou.

The problem is when i set the temperature in the thermostat area "Web browser" to ON in software turns LED ON and relays OFF an OFF in software turns LED OFF and relays ON (led's become active on relay module) this is the opposite to what i need.

You can't assume that setting a pin LOW will turn something on or off. You have to determine whether LOW makes the connected object turn "on" or "off". You could

#define relayOn LOW

if LOW makes the relay turn on. Then, use relayOn in the digitalWrite() statement to turn the relay on.

Do the same for ledOn. Then, the actual values of relayOn and ledOn won't matter. The names describe what you are trying to do.