1
\$\begingroup\$

I've built a meter reader, based around an ATMega 328P and an XBee series 2. The initial protoype built with an Adafruit trinket pro (3.3V) and it worked like a charm. It was stable for 10ish days, before it ran out of battery.

To improve battery performance, I moved it to a breadboard-duino. This is where the problem starts. I start it with a newly charged battery back (4*1.5V hybrid NiMH) and it's fine for ~7ish days, as the battery pack voltage slowly drops from 5.7V down to ~5.1V. Some time around this point (and it varies by >0.1V) the XBee dissociates from the network. I know this because 1) Power cycling the xbee only restores connectivity 2) The XBee association LED activates, rather than blinking and 3) The 328P can be regularly seen trying to put the XBee to sleep.

However, if I restart the xbee (or entire circuit, ether way) the issue repeats itself - but in a timeframe of a day. This implies to me it's related somehow to the battery decay, as that's the only thing that doesn't get reset.

However:

  • Power output is regulated to 3.3V by a TS2950CT 3.3V regulator
  • Measured circuit voltage is 3.27V, nonfluctuating on my meter
  • The trinket pro worked all the way down to a supply voltage of 3.6V
  • There's a 100uF capacitor between the +3.3V and ground for smoothing
  • After the blocking diode, supply voltage is still 4.69V
  • Drop out voltage on the regulator is listed at 450mV, worst case, with a 100mA load. This is, at worst, half that.
  • All the components are rated at 3V, except for...

The only dodgy thing I've done is (accidentally) used a 16Mhz ATMega. I've got an 8Mhz crystal in the post, and I'm going to replace that ASAP. But it's Christmas, and if I'm lucky it'll be here by new year.

So, what I'm asking people is - what else can I check? What could it be? Where could I start looking?

Oh, and, relevant seasonal greetings. They'll be merry if I can get this thing to work!

\$\endgroup\$
1
\$\begingroup\$

The only thing I can think of is that fast current spikes are pulling your supply voltage down again in fast spikes. Try putting a 300nF ceramic in parallel with your 100uF smoothing capacitor. This is much better at dealing with fast spikes than the 100uF.

Do you have decoupling capacitors on all your chip power supplies again this may help with this problem.

\$\endgroup\$
  • \$\begingroup\$ Have thrown a 47uF directly across the Xbee voltage/ground, because it's the main power draw, and put an additional 1uF across the regulator as suggested. So far, so good - but it feels... wrong... \$\endgroup\$ – user2702772 Dec 25 '16 at 20:44
  • \$\begingroup\$ These capacitors need to pass high frequencies to take out the high frequency noise. Because of their construction electrolytics are not good at this and the higher the value the worse the problem. The combination of electrolytic and ceramic gives good smoothing and good hf noise removal. \$\endgroup\$ – RoyC Dec 25 '16 at 20:50
  • \$\begingroup\$ There is some math here, link that tells more the issues with electrolytic capacitors. But while I still don't understand it - the circuit is stable, and RpuC's answer appears good. Perhaps more wine will help with that math.... \$\endgroup\$ – user2702772 Dec 26 '16 at 9:06
  • \$\begingroup\$ And the problem returns. Arrgghh. \$\endgroup\$ – user2702772 Dec 27 '16 at 18:27
2
\$\begingroup\$

After much fault finding, the thing that finally fixed this was putting the ATMega328P into "full swing" clock mode, which according to the datasheet is much more resistant to noise than the low power mode.

So the answer should probably be "Go back and read the datasheet. No matter your problem, READ THE DATASHEET."

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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