Everyone loves a Real-Time Clock, but did you know they're usually unsafe for the classroom? The lithium cell (that runs the clock in standby) is super harmful if swallowed, and you can't transport them by air! This week we've designed an RTC module backed up by a Supercapacitor. We also received our new soldering jig for OLED module assembly, and begin an i2c-bus-extender project.


Welcome back to the factory. This week we have a real-time clock module to show you. Of course, there's some jigs and we'll stretch PiicoDev as far as we can. Let's do it.


First thing I have to share with you this week is Brenton has been working on a real-time clock module with a bit of a difference. Everybody's used a real-time clock, however, in general, you need to use a lithium cell to back up the time. We're going to take a different approach. This design is going to use a supercapacitor. Why would we go down this path? In schools, you can't use lithium batteries or at least you can't use removable lithium batteries in electronics because someone could swallow that and that's very dangerous. So there's a couple of ways around that.

You can solder a lithium battery in place during the assembly process but I don't know about you but if I got a maker electronics module that had a lithium battery soldered in place I'd think to myself, oh man, I can't change that battery ever without doing something potentially destructive. It doesn't really fill you with the positive emotions. So we're going for a supercapacitor-backed real-time clock. That means that when you power it up it will charge the supercapacitor. The supercapacitor will obviously have a lot less capacity than say a lithium cell but if you think about the use cases for real-time clocks that's probably okay. They're probably not depowered for more than a couple of days at a time.

So here we have the module. It's about 25 millimetres by 25 millimetres give or take and you can see that it's dominated by this supercapacitor footprint right in the middle. Up the top, we have the real-time clock and then just the supporting components, some decoupling caps, pull-up. Resistors. There's not all that much to a real-time clock circuit. Jumping over to the schematic, we're looking at using the RV3028 which is a one part per million integrated oscillator RTC. It's not temperature compensated but it's pretty damn good. It's good enough for most applications, I would say.

It's a bit of a balancing act with real-time clocks. You can get very affordable ones where you need an external crystal and then you have to be quite careful in how you design them and how you load those crystals that actually run the clock. Then you have integrated oscillators which are super easy to design around. You don't have to worry about that external crystal and then on the more expensive end are the temperature compensated units. Those are often you know quite a bit more expensive so I think this is probably a good middle ground and you know one part per million is nothing to sniff at.

Taking a walk around the circuit, this device is intended to be used with a supercapacitor. So we have the standard supercapacitor backup circuit where the backup coming from the RTC just has a little bit of filtering on it and then a charge resistor and your large supercapacitor. Basically, every RTC has an interrupt output so that you can set alarms to trigger events. Interestingly, this one can have the interrupt line pulled up to the backup and that way you can have interrupts fire even when the circuit is depowered. So you can use that as a wake-up condition, say. Might have to do some thinking about how we use this if you were to pull up to V backup and this were connected to a depowered microcontroller or a microcontroller in sleep mode that might actually load the backup capacitance enough to really affect the backup time. We chose this RTC because it has a really low standby current which is important if you're going to run off a supercapacitor. It can also run down to about I think 0.9 volts on the backup line.

Now this is the self-discharge curve for the supercapacitor and the real-time clock standby current is about the same as the self-discharge rate. So you can basically take these numbers, halve them and that's probably a pretty close estimate to how much time you'll get in backup.

Now I've spoken at length about how do you test something like this, how do you test a circuit that needs to be battery backed up. So we've included these two jumpers under the supercap so we can pogo pin into that and of course we'll pogo pin onto the main header and that way using our test jig we can sequence a power run, a charge cycle, we can remove power and make sure that power is backed up, repower the circuit, read the time and make sure that the time is still accurate. For something like this the test might take like a handful of seconds like maybe 10 seconds, 20 seconds so it makes sense to maybe have a battery of test points so you can test multiple devices in sequence. By the time you've loaded up say the fourth device under test, the first one should have finished the test, you can remove that one. Just treat the test like a circular buffer.

For the jig portion of this week's episode we've received our OLED soldering jig. So Peter has made up two PCB designs, just bare FR4 boards with routed outlines so we can load an OLED module into one compartment, load the board that we want to solder it to in the other and there's actually provisions for pins to come through that will align the ribbon cable to the board. The flat flex is soldered to the board to hold everything in place securely. We use a t-bar soldering tip to solder the entire FFC in one go. This is a useful trick if you don't have machining capabilities in your workshop or if you need a fast, cheap, and precise solution. Using un-copper clad fiberglass milled out by a PCB manufacturer is a cost-effective way to create precision fixtures or parts.

We are getting closer to releasing the PiicoDev OLED module. We are just waiting for some soldering iron tips and a soldering station, but we are making progress. For the rest of the week, I will be working on assembling the prototype PiicoDev RGB module. It has been on the to-do list for a while, so I'm excited to finally complete it. I have assembled a few prototypes, and the program and test jig has arrived, so I can laser cut the fixture for programming and testing PiicoDev smart modules.

Brenton will be assembling a real-time clock, and Peter is working on extending PiicoDev buses. We want PiicoDev to be accessible not only for education and engineering purposes but also for installation art and creative projects. If you want to use PiicoDev in installation art or a sculpture, you may need a long I2C bus. This will allow you to mount your microcontroller somewhere and have a distance sensor placed several meters away, enabling interaction with the art piece. So, we are also working on developing long I2C buses to meet these requirements. The challenge is this, how do you extend an I2C bus? There are a couple of options. There do exist some differential amplifiers where you have basically your I2C bus connected on one end. It goes through a bus translator that converts it to a differential signal so you can send that over twisted pair cable. Then on the other end, you have the same device again to catch that differential signal and convert it back to I2C.

These devices are really robust and reliable, but unfortunately, in this climate, these kind of chips are just not very available. So we have a backup idea. There does exist a low voltage I2C bus accelerator. It basically sits on an I2C bus just like any other device and acts as a set of active pull-up resistors. The I2C bus is pulled down by devices and pulled up by resistors, and it's really that pull-up resistor that limits the length and speed that the bus can handle. The idea is this active device basically just sits on a regular I2C bus and acts as a bus amplifier. So we busted out some adapters and some ethernet cable just to see how far PiicoDev can go at the moment. I'm pretty pleased to say that we were actually able to drive an OLED module through all of this cable. I don't know what is this, this might be like something like 10 meters before we needed amplifying. I mean it's worth mentioning it's not a very noise hostile environment but it's a pretty promising first go.

So the next step will be to get some of these chips, connect them to a longer bus, and see how far we can stretch it. In any case, that's all I have to update you with this week. If you have any suggestions on what we should work on next or if you just have some questions, open a thread on the Core Electronics forums and I'll catch you next time.



Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.