I followed this guide to interface with a LM35 temperature sensor:
The reading appeared very accurate over USB, but when I hooked it up to a mains power supply it suddenly began to vary wildly (sometimes as much as +-10 degrees.
Uncanny! I was going to post on here tonight about this very same problem.
Just read the link about de-coupling. One quick question if I may....
I've got my ATMEGA168 sat in a socket soldered up on veroboard. The 5V supply comes from a 7805 voltage regulator which has a 10uF electrolytic capacitor across the output terminals.
Should I be looking to replace that capacitor (as a starting point) with a 47uF electrolytic capacitor and also use a 0.1uF across the ATMEGA's VCC and Supply pins?