I'm building a small battery powered temperature sensor gadget thing. I've bread-boarded the circuit and it worked great. I then proceeded to create small PCB out of it.

I've attached the schematic below but the basic idea was to power an attiny85 from a CR2032 coin cell and display the temperature on two 7 segment displays. The temperature is measured using the attiny85s internal 1.1V reference and is connected to ADC2.

The temperature sensor I'm using is the MCP 9700 from Microchip. It has a 10mV/degC temperature coefficient with a 500mV output corresponding to 0 degrees C. It has an accuracy of +- 4 degC which corresponds to a voltage of 40mV.

After testing all other components on the PCB and flashing the attiny85, I then soldered the MCP 9700 to the board. When I applied power, the reading was around 45 degrees C so I figured it must just be residual heat from the soldering process. I left the board un-powered for about an hour. When I switched it on again, the temperature was reading between 10 and 15 degrees too high still. I thought maybe the MCP 9700 I soldered on was dodgy, so I desoldered it and soldered on a new one. I let it cool down over night and it has the same issue.

I also noticed that when varying the supply voltage from 5V down to 3V, the output of the temperature sensor varies by as much as 10 degrees C or 100mV. The MCP 9700 is meant to be quite constant over supply voltage. The same temperature sensors on the breadboard do not exhibit this behavior.

I got the components from Digikey so I don't think they're fake or anything like that. Also, the same temperature sensors work perfect on the breadboard. The code on the attiny85 is correct. I've confirmed this by checking the raw ADC value against the output voltage of the temperature sensor using a Fluke 87V. This leads me to believe that it must be some type of construction issue. I've checked each trace over and over again, confirmed there are no shorts and that the circuit is correct.

I have been banging my head trying figure out why this is. Any ideas on what could be wrong?

Schematic PCB

  • 1
    \$\begingroup\$ Did you try to put some decoupling capacitor next to that sensor? \$\endgroup\$ Commented Jul 31, 2016 at 10:27
  • 2
    \$\begingroup\$ Leakage of ceramic caps is negligible compared to power consumption of MCU, sensor and 7-segment LED display. \$\endgroup\$ Commented Jul 31, 2016 at 10:39
  • 2
    \$\begingroup\$ You are afraid the nA, if not pA of a well chosen ceramic are going to win, at all, from any active component, let alone the self discharge inherent in any battery chemistry? You need to think again. Not to mention home etched and hand soldered PCBs, their contamination and trace-to-trace resistance being well below the giga-Ohms you seem to hope they are. \$\endgroup\$
    – Asmyldof
    Commented Jul 31, 2016 at 10:39
  • 1
    \$\begingroup\$ @Chupacabras Bodged on some caps and all is working great. Thank you \$\endgroup\$
    – bitshift
    Commented Jul 31, 2016 at 14:41
  • 1
    \$\begingroup\$ Maybe you can evaluate and leave your findings as the correct answer for posterity? \$\endgroup\$
    – Andy aka
    Commented Jul 31, 2016 at 18:55

1 Answer 1


I suggested (in the comments) to add some decoupling capacitors. Adding some 100nF ceramic capacitors helped. For sensor (between pin 3 and 1) and MCU (between pin 8 and 4).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.