Tmp36 sensor question

Hi. I am using a tmp36 temperature sensor to control a relay to turn on a cooling fan. My code works exactly as intended while my Arduino is connected to my computer, but it doesn't work once I disconnect my computer. My biggest question is whether or not the tmp36 sensor is capable of running without a computer connected to it? I do have external power running to the Arduino mega 2560 and I have an additional photoresistor to control automatic lights. The lights function properly without a computer and I took the same steps for the temperature sensor but it did not work as intended. Thanks for any help you can provide.

Please post code, schematics and all other relevant info.
Also please read this before posting.

I am currently away from my code and project. My question was simply whether or not the tmp36 sensor was capable of functioning without constant communication with a computer. I have searched the internet as the "how to use this forum" article stated and have found nothing that really answered my question as most projects use the tmp36 to collect readings that can be serial printed to the Arduino ide software for visual reference. I do not need visual reference. I need it to trigger a relay. It triggers the relay like it should when the USB is connected to my computer but as soon as I unplug it it doesn't function properly even though it is being powered correctly from a non USB source.

Well of course it can work without computer connected to it, many many people do just that. Probably most Arduino projects run independently from a computer.

I was just anticipating the obvious follow-up: "why doesn't mine work without being connected to the computer?".

Thank you for replying quickly. I'm having to do this for a school project so I'm trying to do it with as little outside help as possible. I just needed to make sure I wasn't just "beating a dead horse" as I am a beginner to using Arduino and I didn't want to spend a lot of time trying to make something work that was never going to work.

I definitely know Arduino doesn't have to be used with a computer. I was just wondering about that specific sensor. I have a light sensor autonomously controlling the headlights on a robot I have built. For the same project I need the temperature controlled relay setup to run a fan to cool my motor controller once it hits a certain temperature. I will continue to try to figure this out on my own but if I cannot I will absolutely post my code. Thank you for your help with my question and your willingness to help further, Wyatt.

As it works when connected to the computer I'm expecting an electrical problem.