Instructables

MSP430 Based Chronulator (using Launchpad chip)

Featured
Recently, I have been experimenting with microcontrollers. A project that really caught my eye was the Chronulator at http://www.sharebrained.com. At the same time, Texas Instruments released an experimenter's kit called the Launchpad for the outstanding price of $4.30 plus shipping. This kit comes with everything you need to get started, including 2 microprocessors. One microprocessor is fairly decked out with lots of features. The other chip, a MSP430G2211, is more plain.


I decided as a learning experience to use the MSP430G2211 from the Launchpad kit to build a Chronulator. It turns out that this is a really fun project, and yes, I learned a lot!

See the plans for the mantel clock case that I built for this Chronulator.
    
 
Remove these adsRemove these ads by Signing Up

Step 1: What you need - Materials / Tools

Picture of What you need - Materials / Tools
IMG_3244.JPG
The first thing you need is a Launchpad kit from Texas Instruments. You will also have to download the free compiler/debugger. They have 2 different options for compiler/debugger. I used the IAR Embedded Workbench KickStart.

The details on how to get a Launchpad are at http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29?DCMP=launchpad&HQS=Other+OT+launchpadwiki

List of Materials to make Chronulator:

  1  -   Radio Shack General Purpose Printed Circuit board part # 276-150 (project board)
  4  -   0.1uF capacitors
  1  -   1nF capacitor
  3  -   47k resistors
  3  -   push buttons
  1  -   14 pin DIP socket
  2  -   panel meters with any combination of full scale values of 50uA, 100uA, or 1mA
          note: I'm using a 50uA (mins) and a 100uA (hrs) because that is what I had on hand.
                   Higher sensitivity meters will result in using less power - longer battery life.
  1  -  4 pin male single in-line 0.1 inch header (to connect meters)
  1  -  4 pin female single in-line 0.1 inch header with wire
          note: I got mine by cutting off a small power connector from an old PC
                   power supply.
  1  -  battery holder for 3 AA sized batteries (Radio Shack)
  3  -  AA batteries
  1  -  battery leads for 9V size battery (the battery holder required this)
  1  -  MSP430G2211 (part of Launchpad kit)
  1  -  watch crystal - 32.768 kHz (One comes with the Launchpad - but I would
          suggest keeping that one on the Launchpad and getting another for this project.
          I went to Target and bought a watch from their dollar bin and took the 
          crystal from it. BG Micro sells them for $0.65, but you have to pay shipping.)
  1  -  LDO, low Iq, 2.5V voltage regulator (I'm using a Seiko S-812-C series regulator
         Mouser part # 628-812C25AY-G, Manuf # S-812C25AY-B-G  price: $0.51)
         The key is to use a LDO regulator with low quiescent current (Iq).  
         Note: Another alternative is to use 4 AA batteries and a 3.3 V LDO, low Iq, 
                   voltage regulator.

  2  -   resistors (values depend on meters used - see next step)
 
Misc:
         hookup wire
  

Tools Required:

   Solder gun and solder suitable for working with printed circuit boards
   Desoldering tool
   Multi-meter (optional, but great in troubleshooting - Harbor Freight price: $3.97)
   Screw drivers (for working with panel meters)
   needle nose pliers
   wire cutter

   
 
Just got a couple of them. For less than five dollars they are a steal compared to the Arduino stuff.
Doug Paradis (author) 2 years ago
Since several comments on this Instructable asked battery related questions, I just wanted to note that  the three off brand AA batteries in the original clock died on May 5, 2012 after -21 months of service. The clock kept accurate during the whole life of the batteries.
mbonnin3 years ago
Any chance it might work using only 2 AA batteries and the same Seiko S-812-C regulator ? I am a bit short of real estate for my project so saving a battery would be helpfull... And the LDO datasheet states a 0.12V drop so it should work no ?
Doug Paradis (author)  mbonnin3 years ago
It would work with 2 batteries, however when the batteries were depleted to 2.62V (i.e., each battery at 1.31V) the regulator would drop out. At a battery terminal voltage of 1.31V you have used less than 1/3 of the energy stored in the battery. So if you were using only 2 batteries the clock would stop working correctly way before the batteries died.

Using 3 batteries, and allowing them to drop to 2.62V (i.e., each battery at ~0.87V), you use all of the batteries' energy.

You would be better off using 3AAA batteries , than 2AA batteries. The AAA batteries have about 1200mAh vs. the 2400mAh of the AAs. So the 2AA batteries would drop out at ~800mAh (about 1/3 of life), where the 3AAAs would be exhausted and use their full 1200mAh

Have you considered two small Li Photo 1/2AA size batteries? They are more expensive than the alkaline batteries, but they have a small form factor. The Li battery's voltage/energy curve is more flat and I believe they would fit your needs. They have a nominal voltage of 3V. You would want the one that is a little longer (EL123), not the shorter one (EL1CR2). You would need 2 of them in series Both together would take up the space of a single AA battery.

The reason that you need the regulator is to keep the PWM "on" voltage the same during the life of the batteries. If the voltage magnitude changes, the current to the meter will also change.
Using a switchmode power supply chip, namely the 34063, you can step down or step up the supply voltage to suit your clock's requirements. I have his chip configured in the buck circuit shown below, and by doing so i have reduced the total current draw of the project from 10.05mA (317T adjustable linear regulator) to 2.82mA(nominal clock requirement).
This is could be a great way to increase the battery lifetime of your circuit if the prescribed 2.5v reg draws more than this. Switch mode power supplies love efficiency.

the below schematic was generated by this webpage:
http://dics.voicecontrol.ro/tutorials/mc34063/

and and accompanying video tutorial helps you understand the function and method of inputting correct data into the above link.
http://www.eevblog.com/2010/09/10/eevblog-110-lets-design-a-dc-to-dc-switchmode-converter/

It's a long video, but has a lot of insight into a very useful and reliable component.

As mentioned by me earlier, a problem i had was finding a dc adapter that had a clean DC output. With this chip you can SELECT how clean your output is in the order of mA ripple.
step_down.php.jpg
Note: The above image is a BELOW view of the chip. I don't know why the creator decided this was a good idea.

Using a step-up configured circuit with the 34063, it would be quite possible to run the project (or any) off a single AA (or D for longevity) cell. My above circuit is suited for 3 D cells in series as the input.
The thing is that 2.82 mA is huge compared the MSP430 ~0.1uA in sleep mode and the Seiko S-812-C ~1uA consumption. My project is not exactly a clock but more like a tea timer so it'll be sleeping most of the time. I would like to keep the "standby" consumption as low as possible.
Doug Paradis (author)  mbonnin3 years ago
Miko's idea of a charge pump type regulator is a good one for single battery operation, but you need to use a low quiescent current (Iq) regulator.

A good candidate would be Texas Instrument's TPC60310. The regulator circuit is slightly more complex than the Seiko regulator specified in the project since you need a few more capacitors and an inductor. Also, these type of regulators are generally surface mount packages.

Since I tend to make my own PCB boards, the surface mount package would not be an issue. Texas Instruments also has a very generous sample program. So you would most likely get the regulator for free.

The TPC60310 can be run in "Snooze" mode if the load is less than 2 mA. In this mode the Iq is ~2 uA. The load presented by the clock in the instructable meets this requirement if the right meters are used.

If anyone knows of a similar regulator that has a through-hole or larger pitch SM package, please shout out.
I guess you meant TPS60310 and not TPC60310. I'll try to find a couple of these.
Else I came accross this one: LTC1502 from Linear Technologies (http://www.linear.com/product/LTC1502-3.3). It seems it is available in SOIC , which is larger than the TI one, right ?
Doug Paradis (author)  mbonnin3 years ago
I  did mean TPS60310 not TPC. Sorry for the confusion. The Linear Technologies part looks like a good candidate also. The SO package has a center of lead to center of lead pitch of 50 mils. The package for  the TPS60310 is 20 mils center lead to center lead pitch.. The SO package would be much easier to deal with.
Thanks for the detailed answer, I understand better now. I think I'll go for 3xAAA. It's not that I do not like the EL123 but I would try to use batteries as "standard" as possible. So that I have no troubles finding them at the shop around the corner :-)
Using a 317T adjustable linear reg for my power supply circuit has worked out well for me when running off batteries, instead of the preset 2.5v reg in your original design. However, i decided to convert the setup to be able to run off a 6V regulated power adaptor.
There were initial troubles with the chip not responding to any inputs when run off the adapter. I suspected that the very low reset cap value was the culprit in this issue. By replacing the reset cap to 100N (as per the authors original design) and then later removing the reset cap entirely, i have been successful in operating the clock off the mains adapter. Soon i will be following the steps for calibration for the crystal load capacitance and hopefully we won't see any accuracy shift between running from perfect DC put out by chemical cells, and less clean adapter power.

During my troubleshooting process i also added a blocking diode across the micro-ammeter terminals, even though the very low voltage and current shouldn't be a problem. Due to the low voltages involved i suspect the diodes will be doing nothing at all, but hey, why not.
Unsuccessful. This project requires a very, VERY clean DC to run properly. Looks like if i can't find an ultra clean 2.5v supply i'm stuck with batteries for this clock.
Doug Paradis (author)  Sidney Floyd3 years ago
miko,
    Completely removing the capacitor from the reset line is bad idea. It buys you some immunity to power supply glitches. The 47k resistor pullup with 10nF capacitor is the same circuit used on the Launchpad. 

    I have run versions of this clock using a wall wart and a USB wall plug (eBay about a $1) with no issues. I would suggest that you try addng a 1-10 uF capacitor connected to the power regulator's output to ground. Depending on your layout and the regulator that you use this might be necessary.

    BTW, with low current meters this clock should run over a year on the same set of batteries.

    Let me know if this helps. I would like to see your clock be successful.
Doug Paradis (author)  Doug Paradis3 years ago
Should have said 1 nF not 10 nF  and the suggested 1-10 uF capacitor should be a tantalum (Ta) capacitor in your final circuit. You can test with a non-Ta cap.
You're absolutely right. And using a usb wall wart is a very good idea too. They are quiet and still meet the 2.5v difference required for the 317 regulator. I will be trying this tonight. My clock definitely won't run for a full year round thanks to my use of the 317. The total circuit draws 10.9mA average which is enough to drain a AA in a week or so.
I will be replacing the power supply with a 5v usb supply i have around here somewhere and returning the circuit to it's previous prescribed state. At the moment though it runs very well off batteries, with 0.99974 seconds on the crystal corresponding to one second in reality. So once this power supply issue is sorted i should be ready to construct a case.

The attached image shows the two micro-ammeters that i'm using for the project, the left hand one dating 1959. To do these gorgeous meters justice, I'm determined to complete this project in its entirety.
Image0124.jpg
Doug Paradis (author)  Sidney Floyd3 years ago
miko,
    Those are beautiful meters. That is going to be a stunning clock.
Kristy4n3 years ago
Hi ! What can i do if i accidentally broke the reset pin on the chip ? i have a small tssop chip , i managed to program it , i placed it where i wanted but i forgot to pull-up the pin and when i soldered it , it broke. And without that pull-up the chip isn't powering .
Well.. i managed to cram a little solder in there and it made contact . I don't think there was much to do but throw the chip. Unfortunately for me it was the only one in the tssop form and i needed it so i did my best to fix it. The next two pins are also covered in solder but i didn't need them in my project so it was ok .
Doug Paradis (author)  Kristy4n3 years ago
    Sounds like you made the best of a bad situation. You do need a pull-up resistor on the reset pin or the chip will just keep resetting.

    If you have a solder bridge to the test pin you will have programming issues. Spy-by-wire programming uses both test and reset pins.
Yeah, but i wasn't going reprogram it anyway so it all worked out ok .
Now that it's been a good few months since you created this clock, how has the accuracy and precision held up?
I have wanted to make an ammeter clock for quite a while now and have toyed with the idea of digital to analog converters, but they don't had a high enough resolution. This instructable seems like the best bet for making a clock, and seeing as i have a launchpad and two remarkably pretty microammeters, I'd like to give this design a try.

There seems to be a lot of fiddly calibration and trial + error in this i'ble, but what else can you expect from analog circuitry. The theory you have applied in the construction of this clock is impressive.
Doug Paradis (author)  Sidney Floyd3 years ago
  Thank you for the kind words.  

   The clock is still right on the money.
Sometimes when the weather changes drastically I have to touch up the zero on the hour meter. The hour meter is pretty old and has gone through some hard times. I have not had to adjust the time except for daylight saving time. The original akaline batteries are still working.

    I have since made another clock (see secondary picture on last step). This new clock used brand new meters and had more accurate meter faces. Setting up the minute and hour calibration arrays was a piece of cake. All I had to do was find the full scale deflection value and divide it by 12, then made a few minor tweaks of some of the values to fine tune. Remember to keep the minute array members divisible by 5 and the hour array members divisble by 12.

    Do not be afraid of the tuning procedure. Once you start getting visual feedback from the meters, it goes quickly.

rcafrix3 years ago
thanks for the effort of detailing everything. just finished building it, it works perfectly!!!
Doug Paradis (author)  rcafrix3 years ago
Fantastic! I would love to see a picture of your clock.
thelagged3 years ago
Awesome clocks!
AbbiesAcres3 years ago
Those Launchpad kits seem to be pretty popular; I ordered one from Mouser and it's back-ordered for 13 weeks. Does any one know of a comparable chip?
Doug Paradis (author)  AbbiesAcres3 years ago
HannesBK3 years ago
Great! That's the project I was looking for to start with my launchpad.
But I did not really understood why you made an extra board an not use the lauchpad. I think, feeding the USB plug with 4 AAs should work well @3v6.
Is it only saving power to run @2v5, or is it completely impossible to use the lauchpad?
Doug Paradis (author)  HannesBK3 years ago
This project was a lot of fun and I learned a lot. I transferred the project to another board so that my Launchpad would be available for the next project. I originally used a proto board and the launchpad to setup the circuit.

Using 4 batteries and a LDO low Iq 3.3 V or 3.6 V regulator, such as the TPS77301DGK used in the Launchpad, would work just as well as the 3 batteries and a 2.5 V regulator.

It was just a personal choice. I should have made it clear that a 3.3 V regulator could be used if you increased the supply voltage to 6.2 V (4 batteries). That would allow the batteries to run down to about ~ 0.9 V before the PWM outputs lose calibration.

Thank you for the input! I will edit the instructable to make this option clear.
bluehash3 years ago
Your Chronulator got featured on 43oh. This is a sweet project and will make a fine desk clock. 
One question - why did you not use the crystal that comes with the kit?
Doug Paradis (author)  bluehash3 years ago
The main reason was that I already had it soldered to my Launchpad. They are so cheap, it seemed easier to just get a new one.
timotet3 years ago
great work! great instructable as well!
kyojin3 years ago
Excellent work sir. The DPRG would enjoy having you perform a demo at one of our RBNO's, especially since you are a dues paying member. Doug Emes Dprg.org Dallasmakerspace.com
trialex3 years ago
Nice. Clock/time based projects are an excellent application for the low-power LaunchPad micros. When TI finally decide to deliver to Australia I will definitely be referring to your project.