Powering LM95071 (need analog help =)

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a wierd issue with an RTC and a couple temperature sensors connected to my m168. What I've got is a little box that keeps track of power outages and fridge/freezer temperature (father-in-law's cabin has frequent power outages and he wants to keep track of em and see if he should toss the fridge contents or not). There's a DS1306 RTC connected to the SPI bus (close to AVR) and a couple LM95071 SPI temperature sensors connected to the same bus at the end of ~5' or so of cable with a cap on the power pins. In most cases, everything is working great. I periodically store the current values to EEPROM and then on bootup I check if there was a previous record being worked on and if so assume that there was a power outage, complete the record with the current values and start a new one.

The problem is that after a "power outage", the temperature sensors and RTC seem to sometimes boot up in wierd states. I've even stuck in 10+ second delays before communicating with them and it doesn't seem to fix it. It's almost like the first reads can sometimes be screwed up. To fix it, I inserted some dummy reads to both sensors and the RTC and it seems to have fixed the RTC issues, but still the temperature sensors can sometimes get confused. Either everything works fine, or they'll just spit out something like -1 degrees until I power cycle again.

I'm wondering if anyone else has seen wierd issues like this. I'm wondering if it's problems with the power being supplied in a non-instant fashion, as it's currently being run from a wall-wart through a regulator. Would I be better off powering the chips from one of the AVR pins so I can apply power after the AVR is up and running and the power has been stabalized? Anyone else seen similar behaviour or have suggesstions?

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

Last Edited: Wed. Apr 4, 2007 - 03:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RTC is <1.5mA and each sensor is <1mA.

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess noone has experience with this. Let me rephrase and post the question differently.

Assuming I decide to power the devices from an AVR I/O pin, should I be concerned about any glitches in the supplies when the other I/O pins on the same port switch, whether input or output?

The device is a mega168. PortD is used by an LCD, PortB is connected to the 3 SPI devices (1 input, 5 outputs) and two leds (2 outputs), and PortC is connected to 3 push buttons (3 inputs) and the RTC interrupt (1 input). That only leaves two pins on PortC to choose from. Since the other devices on that port are switches, which will bounce a bunch when pressed, and the RTC interrupt, which toggles twice per second. All of the pins on PortC are inputs, though, if that makes a difference.

Anyone have any advice/experience with this?

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe you could use a transistor or a relay triggered by PortC pin.
Another suggestion is to use NTC termistors as temperature sensor. They will never send wrong values. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you are powering the devices from the mega do you make sure all lines are sent to 0 to remove power? As if the Vcc goes low but a control/data line remains at Vcc confusion could result.

Yes I am getting grumpy!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, in hindsight, I should have used thermistors instead. Would have made it a lot easier making a nice robust probe =)

It's almost done, though, so I'll stick with these. I've changed it to power from the pin and so far it seems to work ok. I never need to power down the sensors, so I just make sure that setting the pin high is the first thing I do on powerup, before any SPI traffic, and it seems to be ok. Stopped the wierd non-functional state that they seemed to get into sometimes.

Thanks for the input =)

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clpalmer wrote:
(...) so I just make sure that setting the pin high is the first thing I do on powerup, before any SPI traffic, and it seems to be ok. Stopped the wierd non-functional state that they seemed to get into sometimes.

Does your device has a decoupling cap? If it doesn't, then it probably should have. If it does, you may need to give it some time to charge, at power up.

Embedded Dreams
One day, knowledge will replace money.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's a cap on the mega8 and another cap on each of the temp sensors (as they're each at the end of a few foot cable). I tried delaying for 10+ seconds after powerup when they were connected to the main power line with no success. With them connected to an AVR pin that's set high shortly after powerup, though, there's no problem. Dunno why they wouldn't like the main power line...

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Changed the topic to reflect the fact that I now need some help from a more analog-ally inclined person =)

Here's a capture from the VCC line of the temperature sensor (at the end of a few foot cable with a cap between it and GND pin). As you can see, it spikes up to 6V after what I assume is a draw due to an SPI transaction. It also drops down to 3V. The LM95071 should operate ok at 3V, so it's not dropping out, but I'm wondering if the 6V spike is damaging it, even though it's only for a few 10's of nanoseconds. I have two LM95071's, each at the end of a cable and they share the SPI lines (except CS of course). One of them works ok, the other doesn't, though it did when I first soldered it.

Anyone know if this spike could be a problem and if so, what I should be doing to reduce it?

Had min/max measurements on the scope, but they weren't stuck into the pic. This tektronix TDS7104 is annoying me. Had an agilent one before and the UI was more more user-friendly and intuitive. Anyways, the max voltage is 6.32V and the min is 3.2V.

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post