Author Topic: Using Ultra Low Power RTC to control Moteino Sleep/Wake with 24nA Sleep current.  (Read 5829 times)

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Here's the reference design I mentioned in https://lowpowerlab.com/forum/index.php/topic,1579.msg11203.html#msg11203.  This is pretty bare bones, but does contain a 328P processor (internally clocked at 8MHz or lower), RFM69 radio, Abracon AB1805 Ultra Low Power RTC, all operating from a CR2032 coin cell fitted on a 26mm diameter PCB.  You can use either radio (RFM69W or RFM69HW), but the HW is risky due to high ESR of coin cell.  Note that the radio is mounted on the underside, sandwiched between the PCB & coin cell battery holder.

The base design uses the layout I developed for the TinyTH Mote (https://lowpowerlab.com/forum/index.php/topic,1254.0.html), with the TH sensor removed and the power sequencing circuit replaced with the controls from the RTC device. 

This design, if used in RC oscillator mode only, would draw approximately 16nA while 'sleeping' since virtually all the circuitry is powered off.  A more accurate Auto-calibrated RC Oscillator operation can be used with the average sleeping power running around 24nA.

The wake up timing is managed by the alarm feature of the RTC.  This can provide a multitude of features like:
  • Scheduled Wakeup from off condition
  • Scheduled Listen Mode operation - only enable Listen Mode for a few hours a day (eg common watering cycle time)
  • Scheduled interrupt of normal sleep mode, permitting fast response to wake up events at critical times of the day
  • Battery backed up RAM - 256 bytes for persistent state information
  • HW Watchdog Timer

The design also includes pads for an FTDI interface. The pins are not arranged in the normal in-line pattern, however, they are arranged on a 0.100 grid so that a perf board with connections such as pogo pins may be used for program load/debug.

Note that this is purely for reference purposes.  No claims are made as to the accuracy or reliability of the design.

Enjoy,
Tom
UPDATE: forgot to add Watchdog feature in previous version.

(screenshot posted by Felix):
« Last Edit: February 01, 2016, 08:40:08 PM by Felix »

joelucid

  • Hero Member
  • *****
  • Posts: 869
Cool. Amazing that you were able to fit it on this small of a PCB!

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6019
  • Country: us
    • LowPowerLab
Tom, very nice, thank you for sharing this.
And a BIG thank you for helping me keep my sanity by using EagleCAD and not Kicad.

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Tom, very nice, thank you for sharing this.
You're welcome, glad it may be of some use.  This RTC is a nifty little device.  Of course, it is a bit tricky soldering it, especially when you're a clumsy oaf like me!  I have made several boards with this device (using standard toaster oven reflow 'manufacturing') and had to 'massage' two of them, but they all work with relatively easy rework.
Quote
And a BIG thank you for helping me keep my sanity by using EagleCAD and not Kicad.
I suppose I could have included PDFs, at least of the schematic.  Didn't think of it.  Maybe I'll update tomorrow.

Tom

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Awesome work.  I really like that RTC, but how on earth did you manage to position it?  The mechanical drawing on the pad layout shows there's just 0.25mm between pads!  It looks as though the thermal pad on the bottom has to be soldered as well, so that would appear to remove the only trick I know, which would be super-gluing it first to pre-position it. 

I really wish someone would offer that RTC already soldered onto a breakout board of some kind, but I don't see anyone selling it that way yet.

[Edit1: I just stumbled across this DIY tool, which I suppose might help:  http://vpapanik.blogspot.com/2015/02/the-smd-beak.html]

[Edit2: Come to think of it, I do have a tiny micro mill X-Y table I could use to position a board manually.  All I would need is some z-axis thing to move the chip vertically down onto it.  Hm.... Maybe just a drill press, using the chuck to hold some kind of thin tube with a T in it connected to a vacuum pump?  That way I could also rotate the chip to align the yaw by manually rotating the spindle.]
« Last Edit: February 04, 2016, 03:39:27 PM by WhiteHare »

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Awesome work.  I really like that RTC, but how on earth did you manage to position it?
If you've done reflow, you know that the surface tension of the melted solder pulls the SMD into alignment and holds it there until it solidifies - gluing is not only not necessary, it actually defeats this behavior.  The trick for this device is to make sure you don't use TOO much solder.

I've done a few of these and had to repair two.  One case was clearly too much solder.  The second case was my clumsy placement managed to scrape away some of the paste from a couple of pads.  The first case was easily solved with some excess flux and solder wick.  The second case I solved with a very fine tip paint brush, a bit of solder paste mixed with some alcohol based flux to make a very thin 'paint' which I dabbed near the pad that was not soldered.  In the oven, the 'paint' was literally sucked under the chip as the solder began to liquify and, voila - fixed.

Tom

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
That's interesting detail.  Did you use a solder stencil before you first positioned the RTC chip, or were you able to apply the paste without a stencil, and the solder generally flowed to where it was supposed to when heated in the oven?  I've witnessed a similar effect when using a hot air pencil, except the chip tends to float away from where I want it because of the airflow. :(  Perhaps that indicates I'm using too much solder paste.   

I've never done reflow before, but this RTC may be reason enough to start.

[Edit: BTW, did you pick the I2C RTC over the SPI RTC to guarantee no conflict with the RFM69, or was there another reason?  I'm inclined to also pick the I2C, just to completely avoid the potential for hassle from  SPI library conflicts that I occasionally read about on this and other forums].
« Last Edit: February 04, 2016, 05:07:26 PM by WhiteHare »

TomWS

  • Hero Member
  • *****
  • Posts: 1892
That's interesting detail.  Did you use a solder stencil before you first positioned the RTC chip, or were you able to apply the paste without a stencil, and the solder generally flowed to where it was supposed to when heated in the oven?
Yes, I did use a stencil, but I've also done some repairs on a 24 pin 0.5mm pitch QFN with hand pasting.  This is where I discovered the 'painting' technique.
Quote
I've witnessed a similar effect when using a hot air pencil, except the chip tends to float away from where I want it because of the airflow. :(  Perhaps that indicates I'm using too much solder paste.   
No, I don't think it's necessarily too much paste (although hand pasting it's hard not to).  Hot air is great for removing SMD, but to use it to solder down a part, you need to physically anchor the device, with a needle stick or some such as the device is literally floating on molten solder.  The trick here is to remove the blower and then remove the hold down while the solder is still molten so the device can align itself before the solder hardens.
Quote
I've never done reflow before, but this RTC may be reason enough to start.
I wouldn't recommend 0.5mm pitch without an oven, but that's just me  :)
Quote
[Edit: BTW, did you pick the I2C RTC over the SPI RTC to guarantee no conflict with the RFM69, or was there another reason?  I'm inclined to also pick the I2C, just to completely avoid the potential for hassle from  SPI library conflicts that I occasionally read about on this and other forums].
Actually I've used both versions for different reasons.  The SPI because I had an application with LOTS of time critical data exchange with the RTC (however, that was an ARM with DMA on SPI).  In this reference design, the RTC is primarily used to control alarms for periodic power on of the rest of the system.  Very little I/O so I2C bandwidth isn't an issue.  Multiple devices on SPI on Arduino can be managed if you use the SPI transaction calls.

Tom

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
I ordered ten of the AB1805's today, and yesterday I ordered adapter boards for 3x3mm QFB16's to match them.

Although I see that you posted the CAD files for the PCB, I don't recollect ever seeing any firmware code.  Did you find a library that you either liked or leveraged for the AB1805, or did you instead roll your own using just the datasheet and the I2C library? 

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Did you find a library that you either liked or leveraged for the AB1805, or did you instead roll your own using just the datasheet and the I2C library?
'Rolled my own' as I tend to do even if there was a library.   There are so many capabilities in this device, most of which wouldn't be used by the 'common man', that I wouldn't presume what features to include or exclude from a library. Besides, once you get past readBytes(addr,...) and writeBytes(addr,...), it's all pretty straightforward anyway.

Tom

TomWS

  • Hero Member
  • *****
  • Posts: 1892
I ordered ten of the AB1805's today, and yesterday I ordered adapter boards for 3x3mm QFB16's to match them.
Did you order xtals?  You'll need those as well.  You'll also need to set the calibration registers to compensate for your PCB layout.

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 869
Hey Tom, I'm just playing around a little with the RTC on a TH mote. Any particular reason why you went the FET route here and didn't just let the RTC switch PSW as GND?

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Hey Tom, I'm just playing around a little with the RTC on a TH mote. Any particular reason why you went the FET route here and didn't just let the RTC switch PSW as GND?
A very good reason, I believe.  The spec (Table 6, section 4.3) says that the max resistance of the PSW pin is 3.8 ohm at 3.0V.  I thought this and even the  typical 1.1 ohm was too high to handle a 328P and RFM69 radio.  Also, the VCC of the RTC would be left powered in that case.

Besides, you know how much I love to use FETs!   ::)

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 869
Right. Vcc and vbat would both be connected to the positive side of the cr2032. A cr2032 has an internal resistance on the order of 20ohm - so what's 1.1ohm or even 3.8ohm between friends I would ask  ;)

Looks like the rtc could easily fit with si7021 and radio on the reduced 11mm radius th mote. Maybe I shouldn't have sent my boards off so soon after all.

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Right. Vcc and vbat would both be connected to the positive side of the cr2032. A cr2032 has an internal resistance on the order of 20ohm - so what's 1.1ohm or even 3.8ohm between friends I would ask  ;)

Looks like the rtc could easily fit with si7021 and radio on the reduced 11mm radius th mote. Maybe I shouldn't have sent my boards off so soon after all.
Too bad I didn't use the RFM69CW on the Reference Design!  Then all you'd need to add is the Si7021.  I thought about it but didn't because the mismatch between the HCW & CW footprints - that bugs me.  I like that you can swap in the extra powerful radio if you need it.

Oh well... we like to keep our PCB houses fully employed, eh?

Tom