Temperature control using relay.

Read the cooler pin - whichever that is - and which should be an INPUT of course, not an OUTPUT (I do assume you know the difference but starting to doubt it - you may want to look up how those ports work).