Precision Arduino Clock

with XBee RF Link

Last Updated: August 10, 2013

 

Useful as a phased-installment training vehicle for Arduino development, our Precision Arduino Clock project promises to evolve into a full-fledged, useful precision clock for our ham radio shacks.  Whether you mount it to the wall for viewing at your operating position, or couple its 1 pulse per second output signal to your transceiver for synchronizing WSPR, JT65A, and EME/moonbounce communications, the Precision Arduino Clock will be a great way for the homebrewer in you to become comfortable with the Arduino computing platform and the convenient XBee RF modules for providing command & control nodes throughout your hamshack and QTH.

 

Contents

Overview

Project Resources

1) Introduction

2) Adding Real-Time Control Hardware & Software

3) Experiment: Basic Radio Link for Terminal-to-Terminal Connection

4) Experiment: Remote Temperature Sensing Node

5) Experiment: Remote 7-Segment LED Display

6) Experiment: Upgrading to the Series 2 XBee RF Modules

7) Experiment:  Completing the Remote Display Node   <== NEW !

References


Overview

This is the home page for the Precision Arduino Clock, the ongoing group design project providing instructional and motivational guidance to ham homebrewers looking to become familiar with hardware and software aspects of the Arduino platform.  The project is chronicled in the live, bi-weekly Chat With The Designers program.

The Precision Arduino Clock project displays date and time by means of an LCD display module connected to an Arduino microcontroller board (Uno, Nano, etc.)  An XBee RF module is also interfaced to this "base" Arduino in order to send the time over a 2.4 GHz RF link to a battery-powered remote display node, consisting of another XBee module and a 4-digit multiplexed 7-segment LED array connected to second Arduino controller (e.g., an RBBB board).  The time is synchronized to WWV or CHU by means of a LMC567 tone decoder indicating the "top of minute" tones to the base Arduino controller, which resets its seconds count on the next minute value.  Future installments of the project will likely include more sophisticated and automated methods of time synchronization (see Roadmap below), and a formal, dedicated shield (hardware adapter) may be produced as an inexpensive kit for others to later easily replicate the refined design.

FEATURE ROADMAP

Phase 0: Tone detection at top of minute from WWV or CHU

Phase 1: Addition of 1pps input signal from GPS for seconds sync

Phase 2: Addition of RTC chip to maintain date/time

Phase 3: Addition of NMEA input from GPS for date/time setting & sync

Phase 4: Addition of USB serial input from PC for sync via Internet

Phase 5: Addition of MC145442 modem chip to decode WWV digital data

 


Project Resources

  1. Schematics -- See below

  2. Sketches (software) -- Here we have collected each of the sketches used in the evolution of this project, allowing the builder to see the progression of features and to construct this Arduino project in the same orderly steps as we followed in the CWTD episodes.

    1. Phase 0/1 -- Software for basic clock with manual register count-up (for software training purposes) and sync with tone decoder via CHU signal. Also handles external sync input.

    2. Phase 2b -- Software now uses the RTC chip for date/time retention and timing. Current time set from computer when you first load the sketch onto the Arduino ... no more need for cumbersome serial console and "user time setting" menus!! Also no longer depend on "wait 1000ms" for timing ... we now let the RTC chip do it and we look for the transition of its output pin, clocking at 1 Hz interval. LED added to show RTC heartbeat. Software greatly simplified. Needs the RTClib (see next item).

    3. Phase 2c -- Software that includes (and depends on) the RTC

    4. Base Station Temperature Display ... Software for Base station to display temperature from Remote node

    5. Phase 2g ... Software for Base Arduino node sending time data to Remote node for display

    6. Remote Time Display Node ... Software for the Remote node displaying the time on the 7-segment LED

    7. Series2_IoSamples_CWTD_RemoteTemp.ino - Sketch for receiving the remote temp data, adapted from the "Series2_IOSamples" example sketch that comes with the XBee library

    8. Emonlib_test.pde - This is the code that N3PUU uses on the whole house power monitor which sends the data off over XBee.  The XBee portion is adapted from the "Series2_Tx" example sketch that comes with the XBee library.

  3. RTClib library... unzip, rename folder to RTClib and place into your Arduino libraries folder.

  4. DS1307 Data Sheet (RTC chip)

  5. LMC567 Data Sheet (Tone Decoder)

  6. Arduino UNO R3 Information Page

  7. Rookey Tone Decoder Board  

  8. 7-segment, 4-digit, multiplexed LED array

 

SCHEMATICS

 

 

 

 


1) Introduction:  Getting your first Arduino project working ... LCD display!

In this first installment, we get a simple "software clock" loaded into the Arduino, which is wired to an LCD in order to display the time.
No special efforts are made for clock accuracy in the Phase 0/1 sketch used here, as it is a simple training vehicle for now to illustrate
the simplicity of the Arduino programming environment, and the nice displaying capability we have with a standard LCD connected
to the Arduino.

Reference: CWTD Episode #48 (Feb 5, 2013), wherein we introduce the Arduino Clock project and various methods of getting
                 (and synchronizing to) accurate time in today's world.  Take special notice of the WWV, CHU and WWVB discussion
                 segments, as we'll be implementing some of the concepts in follow-on installments of the project.
                 Also, listen to the podcast #48 for yet additional information.

                 Further, you can listen ahead to the podcast #49, in which
we describe step-by-step the initial sketch (software) used on the
                 initial Arduino Clock. We explain the construct and way that it works. Some guys mentioned that they were mystified by
                 the code, so we want to explain the pretty standard way that software is constructed and arranged on the Arduino. After all,
                 if you are going to follow along with this project, we want you to have a good feel for what’s inside. You won’t need to become
                 an expert on sketch design, but it’s always good for a homebrewer to at least have a feel for what makes a project tick.

 

   


The main circuit we use in our Phase 0 implementation is the LMC567 Tone Decoder,
as implemented in the Rookey Kit ... http://midnightdesignsolutions.com/rookey/index.html 

 

 

 


2) Adding Real-Time Control Hardware and Software

So far we have covered the basics of this prescient design, both from a hardware and software perspective, using initial methods for timekeeping and synchronization with WWV and CHU. This time we implement the software for a key element for moving forward: the Real-Time Clock. Surprisingly, the Arduino sketch (software) is vastly simplified and we have the stage set now for making the Arduino and our CWTD shield (hardware) a very useful addition to anyone's shack.

So this time
we take our basic “phase 0” Arduino clock to the phase 1 milestone with the addition of a Real Time Clock chip (the DS1307). With this hardware addition, our “CWTD Arduino Clock” can be set with accurate time and retain it when power is removed.

Reference:  CWTD Episode #49 (Feb 26, 2013), wherein we discuss the principles and background for this RTC chip technology, in addition to the actual implementation of it on our growing shield
                   (the hardware interface board).
                  
Also, listen to the podcast #49 for yet additional information about the hardware implementation, and podcast #50 for a walk-thru of the software flow chart.

 


Precision Arduino Clock Functional Flow Chart Phase_2b

 

 


3) Experiment:  Basic Radio Link for Text-to-Text Connection ... The First Step in our XBee Experiments

Understanding that we ultimately wish to have a remote clock node for the shack (hanging on the wall, on multiple operatioing benches, etc), we introduce the XBee RF modules as a way to interconnect our Arduino with the displays and measurement nodes. So in this experiment we use a couple of "Series 1" XBee modules in default, out-of-the-box configuration to set up a remote terminal modem capability ... typing on the remote XBee node's serial port terminal is sent wirelessly to an Arduino connected serially to the other node. 

Reference: See CWTD Episode #51 for a good background on the XBee RF modules, where to order and how to configure.
                  Also listen to the podcast #51 for audio notes on making this first implementation of Arduino + XBee work.

XBee RF Data Link for Ham Station Mesh Networking, Part 1 -- This is the start of an interesting group project that will lead to the creation of a functional, useful and indeed valuable "mesh network" for data and control within our ham stations.  We begin by using a couple of "Series 1" XBee modules in default, out-of-the-box configuration to set up a remote terminal modem capability ... typing on the remote XBee node's serial port terminal is sent wirelessly to an Arduino connected serially to the other node.  Then we reconfigure the standalone remote node to independently make periodic A/D readings of an LM34 temperature sensor and send the readings over the RF link to the XBee receiver on the base Arduino, which converts the raw ADC readings to accurate temperature values for display in the Arduino's serial console. 

Here are the components that we'll be using in our XBee experiments.  Bare minimum needs are two XBee Series 1 modules (item 1) and one each of the carrier boards (items 2 and 3.)

1) XBee Series 1 Radio Modules --  Series 1 modules are the easiest to use in setting up and learning about XBee capabilities ...
        Adafruit product ID : 128 
(http://www.adafruit.com/products/128)

2) Translator Carrier/Adapter -- Since the XBee natively works on 3.3V, we need a "level translator carrier board" in order for the Arduino's 5V I/O pins to connect to the XBee ...
        Adafruit product ID : 126
 (http://www.adafruit.com/products/126)
   
    Digi-Key ...    http://www.digikey.com/product-search/en/rf-if-and-rfid/rf-accessories/3539661?k=32401-nd

3) USB Carrier Board -- There's also a carrier board with an FTDI USB controller chip on it,  for use as an easy connection to the computer's USB port ...
        Adafruit product ID : 247 ...
 http://www.adafruit.com/products/247  

And while you're at it, you might want to prepare for next episode's exercise of using three of the Series 2 modules below for "multi-point mesh networking" ...

4) XBee Series 2 Radio Modules --  We'll later evolve to using Series 2 XBee modules for enhanced operation (as a multipoint-connected "mesh" network) ...
        Adafruit product ID : 968 
(http://www.adafruit.com/products/968)
        Digi-Key ...
http://www.digikey.com/product-detail/en/XB24-Z7WIT-004/602-1098-ND/1942304

 

Two Series 1 modules are connected here in our test system breadboard(s). 

The XBee in the left node is connected to a serial port of a PC using the XBee in a convenient USB carrier board (Adafruit p/n: 247, http://www.adafruit.com/products/247?gclid=CI3H56bP37YCFUFo4AodkiQAWA ).  Keystrokes made in a dumb terminal program application (like TeraTerm or X-CTU) running on the PC gets sent over the RF link to the other XBee node.

The  XBee node on the right is plugged into the "level translation" carrier board (Adafruit p/n: 126, http://www.adafruit.com/products/126?gclid=CMHgzpTP37YCFYPd4Aod_jwA9A), which in turn is plugged into the wire plugboard containing the Arduino.
The Arduino is running the sample sketch "NewSoftSerial_1" that acts as a modem: Keyboard data entered into the Arduino serial console (i.e., the "terminal" program in the Arduino environment running on the PC) is sent via a serial Rx/Tx digital signal stream to the XBee node, which get sent via the RF to the left node XBee.

Using this arrangement, one is able to type in either "terminal" window and see the data appear in the other! 

See the diagram below for the schematic version of this modem exchange.

 

And finally, the terminal windows (below) showing the respective left XBee node and the right XBee node.
The process starts with the Arduino on the right node starting up and displaying "Goodnight moon!" in its own serial console, and then
sending "Hello, World?" to the left XBee node.

Then to illustrate the interactive nature of the bi-directional modem link, I typed into the text entry area of the right window "now is the time"
and hit <Send> to send that string over to the left XBee node ... resulting in that string being received and displayed in the window.

I then typed "for all good Homebrewers to build!" into the terminal of the left XBee node, and the characters were transmitted (as I typed)
to the right XBee node, resulting in that string being displayed in the Arduino's serial console on the right.

 

 


4) Experiment:  Remote Temperature-Sensing Node

We now reconfigure the standalone remote node to independently make periodic A/D readings of a simple LM34 temperature sensor and send the readings over the RF link to the XBee receiver on the base Arduino, which converts the raw ADC readings to accurate temperature values for display in the Arduino's serial console. 

Reference: See CWTD Episode #51 again for details on this experiment.
                  And this experiment is also discussed in podcast #51 .

The first thing to do is to reconfigure the XBees to do something slightly different than the transparent pass-thru character mode done so far.
We will:
    1) configure the standalone remote XBee node to periodically make A/D readings, send them to the base node, and then go to sleep in between readings; and
    2) configure the receiving XBee node (at the Arduino) to be listening for this  periodically incoming ADC reading

First, we need to connect each XBee, in turn, to the PC using the USB carrier and a program from the XBee people called: X-CTU.  This program provides a convenient way to read and configure the many internal settings of the XBee.  Just download and install the X-CTU program for Windows, connect to your XBee in the USB carrier, and make the following settings in each module, as shown in the chart below (transmitter XBee settings are in the left column, and the Receiver XBee settings are in the right column).  If you have any problems, you can refer to the good X-CTU manual.)

TRANSMITTER XBEE NODE: RECEIVER XBEE NODE:
Connected to PC via XBee USB Adapter

In X-CTU:
Modem is set to XB24
Function Set is XBEE 802.15.4
Version set to 10ED
Click Write (updates firmware)


Then Parameters are set to:
MY=1 - Address of module is "1"
SM=4 - Cyclic Sleep
ST=3 - return to sleep after 3 milliseconds of RF/Serial inactivity
SP=C8 - Sleep period of 2000 (200 x 10) milliseconds
D0=2 - Sets pin D0 to ADC Mode
IT=0B - 11 A/D samples per packet
IR=1 - milliseconds between A/D samples

Click Write (writes settings to XBee)
Connected to PC via XBEE USB Adapter

In X-CTU:
Modem is set to XB24
Function Set is XBEE 802.15.4
Version set to 10ED
Click Write (updates firmware)


Then Parameters are set to:
AP=2 - Enables API Mode w/ PPP

Click write (writes settings to XBee)
WIRING FOR REMOTE NODE (Transmitter) WIRING FOR ARDUINO BASE NODE ( Receiver)
+Vs of LM34 to XBee Pin 1 (Vc / 3.3v)
Vout of LM34 to XBee Pin 20 (D0)
Ground of LM34 to GND Pin on XBee Adapter Board
XBee Pin 14 (Vref) to XBee Pin 1 (Vcc / 3.3v)

GND Pin of XBee Adapter to - of battery
+5V Pin of XBee Adapter to + of battery
XBee in XBee Adapter ("Carrier") Board
Arduino GND Pin to XBee Adapter GND Pin
Adruino 5V Pin to XBee Adapter GND Pin
Arduino Pin 7 to XBee Adapter RX Pin
Arduino Pin 8 to XBee Adapter TX Pin

 

 


Photo of the N3PUU remote temperature node (on right), with the Arduino "base" receiver node (on left).


Screen shot of the Arduino Serial Console displaying the temperature coming in from the remote node.

Here is the sketch (Series1_Read_Remote_TMP36_via_XBee.ino) to be loaded into the Arduino Base Controller to read the remote temperature sensing node and display it on the Arduino's Serial Console, as pictured above.

 

 

5) Experiment:  Remote 7-segment LED Display for the Precision Arduino Clock

In this experiment we again use a couple of "Series 1" XBee modules in default, out-of-the-box configuration to set up a remote clock display node using a 7-segment, 4-digit multiplexed LED display.  The base Arduino+RTCC+XBee sends the time code wirelessly to the remote node:  XBee+Arduino+Display

Reference:  See CWTD Episode #52 for additional notes on this step of the project evolution.
                   And podcast #52 provides some good "live" discussion about how the remote display node was created.

 

This is installment of our ongoing Arduino project starts bringing together the various experimentation threads we've been doing so far: 

1) The basic Arduino Clock displaying time to an LCD;

2) Its synchronization with an accurate external source;

3) The Real-Time Clock chip (DS1307) and use of it to maintain time through power cycles of the platform;

4) Wireless communication between two Arduinos using the modular XBee radios; and

5) Display of the clock information to a 7-segment, 4-digit multiplexed LED module

So what we are focusing on this now is the start of our Ham Station Mesh Network in the form of a remotely located clock connected by RF link to the base station Arduino controller!

 

Precision Arduino Clock with Remote 7-Segment LED Display
 

 


Remote Node:  Arduino "RBBB" controller + XBee RF card +  7-Segment LED Display
 

Operation:

The Precision Arduino Clock operates the same as it has recently evolved to work in conjunction with the DS1307 Real-Time Clock chip to keep accurate time, even when the power goes down of course, and displays the date and time to the LCD display on this "base station", as shown on the white breadboard in the photo below.

However this time we are starting to use a new 7-segment, 4-digit, multiplexed LED module from Adafruit Technologies.  This display is controlled by a set of i2c control lines coming from a second Arduino sitting on the plugboard situated on the left side of the photo.  This "remote" Arduino is connected wirelessly to the Base Arduino by using those little XBee radio nodes we used last time in establishing a link between two "terminals" for bidirectional textual communication, as well as between a remote node measuring temperature and the base node displaying that temperature.

So this time we are using the same "transparent" protocol for the two nodes to be sending raw data between them, but we are only using one-way communication from the Base node to the Remote node, and we're sending the time digits!

The Base Arduino timekeeping sketch has some extra lines of code added to "send time to remote node", and the Remote node sits there waiting for the incoming time codes (happening every second), and it then displays those time digits to the 7-segment display!

 

6) Experiment:  Upgrading to the Series 2 XBee RF Modules

Here we now replace the original Series 1 XBee modules with the Series 2 version.  This is a necessary step for "going multi-node" with a mesh network in later experiments. 

So if you are interested in continuing along toward the Mesh Network goal, you also should get some Series 2 modules for using in our experiments from now on.

 

Reference:  This phase of the Arduino Clock + Remote Display project was covered in CWTD Episode #54.

                  Discussion about this phase occurs in the latter part of podcast #54.

 

 

The notes and photos here show the easy way you can substitute the Series 2 XBee modules for the Series 1 modules we've been using thus far.

 

XBee Series 2

Ordering the XBee Series 2 Radio Modules ...
       
Adafruit product ID : 968   ... http://www.adafruit.com/products/968
        Digi-Key ...
http://www.digikey.com/product-detail/en/XB24-Z7WIT-004/602-1098-ND/1942304

 

Series 2 modules run the Zigbee stack.
Every Zigbee network must have one (and only one) "Coordinator" to manage the network.
"Router" nodes are end devices on the network that will also relay traffic from other nodes. Because they are relaying, their power usage is higher. Because of this, "router" duties are generally reserved for devices with 24x7 line power.
The third type of Zigbee node is an "End Device." These will not relay traffic from other nodes, and are generally used when the node is battery powered.

 

The tables below indicates the configuring steps and settings to use with the Series 2 XBee modules, using the X-CTU Configuration software program.

 

For "Virtual Serial Link, or "Chat"

 

Addresses (For Reference):

Coordinator (USB Explorer): 40813F6C
Router (XBee Adapter): 40814000

Module Configuration (Series 2 Modules):

Coordinator:
Connect Module to PC
Start X-CTU
In X-CTU, under Modem Configuration Tab, Download New Versions (of firmware)
Flash with "ZIGBEE COORDINATOR AT" Firmware (Version 20A7)
Write firmware to XBee

Configure:

PAN ID (ID) - 0C2D (For "Chat 2 Designers")
Destination Address High (DH) - 0013A200
Destination Address Low (DL) - (8 char hex address of router) 40814000 (in my case)

Write configuration

Router:

Connect Module to PC
Start X-CTU
In X-CTU, under Modem Configuration Tab, Download New Versions (of firmware)
Flash with "ZIGBEE ROUTER AT" Firmware (Version 22A7)
Write firmware to XBee
Configure:
PAN ID (ID) - 0C2D (For "Chat 2 Designers")
Destination Address High (DH) - 0013A200
Destination Address Low (DL) - (8 char hex address of router) 40813F6C (in my case)
Write configuration

Testing:

Attach XBees to PC(s)
Fire up terminal programs pointed to serial ports where XBees are attached (9600 baud)
Chat!

 

For "Standalone Temperature-Sensing Remote Radio Link"

 

Addresses (For Reference):

Coordinator (To Arduino): 40814000
End Device (Temp Sensor): 40813F6C

Module Configuration (Series 2 Modules):

Coordinator:
Connect Module to PC
Start X-CTU
In X-CTU, under Modem Configuration Tab, Download New Versions (of firmware)
Flash with "ZIGBEE COORDINATOR API" Firmware (Version 21A7)
Write firmware to XBee
Configure:
PAN ID (ID) - 0C2D (For "Chat 2 Designers")
Write configuration

End Device:

Connect Module to PC
Start X-CTU
In X-CTU, under Modem Configuration Tab, Download New Versions (of firmware)
Flash with "ZIGBEE END DEVICE API" Firmware (Version 29A7)
Write firmware to XBee
Configure:
PAN ID (ID) - 0C2D (For "Chat 2 Designers")
Destination Address High (DH) - 0013A200
Destination Address Low (DL) - (8 char hex address of coordinator) 40814000 (in my case)
Sleep Mode (SM) - 4 "Cyclic Sleep" (likely default)
Time Before Sleep (ST) - 3
Cyclic Sleep Period (SP) - C8 (2000 (200x10) milliseconds)
D1 AD1/DIO1 Configuration - 2 - ADC
IO Sampling Rate (IR) - 32
Write configuration

 

 

 

 

 

Photos of the N3PUU Series 2 XBee Setup

  
Picture of the front of a Series 2 module                                 Picture of the rear of a pair of Series 2 modules to show where the addresses are printed


 

   
Picture of module on desk while it was being programmed                                            Picture of 2 modules on the desk during the chat test


 

   
Screenshot of the 2 terminal windows talking                                            Screenshot of the Arduino serial output showing received temperature


 


Picture of the remote temp node with Arduino base station

 

 

7) Experiment:  Completing the Remote Display Node

Now that we have the basics of the "system" working, we'll now concentrate on getting the Remote Display Node into the usable state that we ultimately want:  bigger digits, sixty LEDs for indicating each second, a power-saving motion detector to turn off the displays when the room is vacant, and suitable battery operation.

 

 

 

 

Parts used in this experiment

 

7-seg, 4-digit, common cathode Blue LED array ... Sparkfun COM-11408 ... $2.66

   (BTW, have you ever explored the Sparkfun Tutorials?  Pretty nice coverage of good material.)

 

MAX7219 serial display driver ... Digi-Key ... $7.50

 

Arduino RBBB ... ModernDevice … $13.00 … http://shop.moderndevice.com/products/rbbb-kit  (I haven’t forgotten that I owe you one of these Frank!)

   or

Funduino Nano ... WayEngineer ($15.90) ...  http://www.wayengineer.com/index.php?main_page=product_info&products_id=921

   and for production:

Bare ATMEGA328P-PU chips … Digi-Key ($1.98)

 

LEDs for Seconds … Mix of red, green, yellow (how many of each depends on # info segments in WWV minute)

 

 

 

Arduino sketch to display "1234" in display ... Jumbo7_test2.ino

 

      Control Words send to MAX7219 chip in order to display the digit information

 

MAX7219 8x8 Display Driver

This is a surprisingly powerful chip from MAXIM that enables the Arduino to control up to 8-digits of a 7-segment LED array using only 3 bits in a bit-banged SPI serial manner.  The MAX7219 has a great deal of flexibility in that it can be programmed to accept raw abcdefg segment data for each digit, or binary-coded decimal (BCD) numbers and do the internal decoding to display the BCD number using the 7 segments.  The chip can be programmed to shut down the display (to save on power consumption), the intensity may be programmed in 1/32 step increments, and the scan rates can also be set. 

A couple of good tutorials on controlling a 7-seg multi-digit LED array with the MAX7219 chip can be found at ...

Hardware ... http://playground.arduino.cc//Main/MAX72XXHardware

Software ... http://playground.arduino.cc//Main/LedControl

I/O Expansion via "Charlieplexing" to drive the 60 “seconds” LEDs

Charlieplexing technique ... (http://makezine.com/projects/charlieplexing-leds-with-an-avr-atmega328-or-arduino/)

 

We'll need 9 pins to do 60 LEDs (9 pins actually does 72 max, but 8 only does 56).  An interesting side benefit of this method is that by design only 1 LED is illuminated at a time which should help keep our power down.

 

Maxim also has some chips that do the same thing in hardware ... http://www.maximintegrated.com/app-notes/index.mvp/id/1880

 

A pair of MAX6958/MAX6959 might be a good choice - talks i2c and a pair will drive 72 LEDs, even comes in a 16 pin DIP ... http://datasheets.maximintegrated.com/en/ds/MAX6958-MAX6959.pdf

 

Precision Wall Clock Power Budget 

 

Necessary evil with battery powered projects

-        See how much battery capacity needed

-        Gauge battery type to use to get useful operating time

-        Look for areas to lessen power drain

Begin with “bogey” budget to scope out total consumption

-        Guestimates of power drain for each subcomponent

Refine numbers based on data sheets or measurements

Tweak design or power source to get desired operating life

 

Spreadsheet handy format for budget

-        Easy to see all data at a glance

-        Good for “what-if” exercises

Sample spreadsheet  (See chart below)

-        All functions enabled full time avg current 120 mA

-        Xbee only on 1% of time for updates avg current 70.5 mA

-        Xbee 1% and 7-seg disp off in dark room 43.7 mA

 

 

 

Function >>> Processor (mA) Duty Cycle % Avg Current (mA) 7-Seg Digits (mA) Duty Cycle  % Avg Current (mA) LEDs (mA) Duty Cycle  % Avg Current (mA) Xbee  (mA) Duty Cycle  % Avg Current (mA) Total Current (mA)
See Note A 20 100 20 40 100 40 10 100 10 50 100 50 120
See Note B 20 100 20 40 100 40 10 100 10 50 1 0.5 70.5
See Note C 20 100 20 40 33 13.2 10 100 10 50 1 0.5 43.7

Note A:  All functions enabled 100%

Note B: Xbee off 99% of the time

Note C: Xbee off 99% of the time and 7-seg display disabled when room is dark

Assume Circuit needs 7.2v,  and use 6 D cells. 

-        120 mA  ~ 90 hrs

-        70.5 mA ~ 170 hrs

-        43.7 mA ~ 300 hrs

 

 

 

 

Ref: Eveready alkaline D cell technical data sheet:  http://data.energizer.com/PDFs/E95.pdf

 

 

PIR Motion Sensor Note -- on Adafruit site .... http://www.ladyada.net/learn/sensors/pir.html

 

 

PIR Active time = 24576 x R10 x C6

                       = 24576 x 10k x .01uF

                       = 24576 x E4 x E-8

                       = 2.4576 seconds ... too short!  (The displays will turn off if you are still for about 2.5 seconds!

So we'll need to increase R10 and C6 by factor of 10 each, yielding 245 seconds = 4 minutes.  This is good, as you will likely not be perfectly still for more than this time and the display will stay on.    But if you leave the room (with no reason to have the clock display on) the PIR sensor will go inactive and the Arduino will turn off the displays to conserve battery power.

 

 

 


REFERENCES

XBee REFERENCES

1) Mesh networks ... http://en.wikipedia.org/wiki/Mesh_networking

2) Point-to-point protocol ... http://en.wikipedia.org/wiki/Point-to-point_protocol

3) Overview of XBee ...  http://www.ladyada.net/make/xbee/

4) Which XBee module to use? ... http://www.ladyada.net/make/xbee/modules.html

5) Manufacturer of XBee Modules ...  Digi.com ... http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/

6) Passing discrete signals (pin hi/lo) from module to module ... http://www.ladyada.net/make/xbee/ref.html

7) Other Arduino XBee project pages:
    http://www.tigoe.net/pcomp/code/category/category/XBee/
    http://www.faludi.com/itp_coursework/meshnetworking/XBee/

8) XBee Manual ... https://dl.dropbox.com/u/43021514/CWTD/xbee_1/XB_802.15.4%20Manual.pdf
 

  • ARDUINO I2C REFERENCES

    "Official" info on I2C communications with the Arduino using the Wires : <http://www.arduino.cc/en/Reference/Wire>

    Sample project using I2C expansion with Arduino: <http://www.neufeld.newton.ks.us/electronics/?p=241>

    Sample I2C Arduino sketches: <http://digitalcave.ca/resources/avr/arduino-i2c.jsp>

    1. Wikipedia ... http://en.wikipedia.org/wiki/Arduino

    2. Arduino Home Page ... http://www.arduino.cc/

    3. Arduino Software Download Page ... http://arduino.cc/en/Main/Software

    4. Arduino Tutorial by ladyada.net ... http://www.ladyada.net/learn/arduino/

    5. 102 Projects from Make Magazine ... http://makeprojects.com/c/Arduino

    6. Reference Books ...

        The Definitive Guide to (All) Arduino Reference Books ... http://www.arduinobooks.com/

        The Arduino Cookbook ... http://www.amazon.com/gp/product/0596802471/ref=as_li_ss_tl?ie=UTF8&tag=ab-checkprice-20&linkCode=as2&camp=217145&creative=399369&creativeASIN=0596802471

        Programming Arduino - Getting Started With Sketches ... http://www.amazon.com/Programming-Arduino-Getting-Started-Sketches/dp/0071784225/ref=sr_1_4?ie=UTF8&qid=1358741928&sr=8-4&keywords=arduino

        30 Arduino Projects for the Evile Genius ... http://www.arduinoevilgenius.com/

    1. Purchase the Arduino at ...

              Adafruit Arduino Starter Pack ... http://www.adafruit.com/products/68

              Maker Shed ... http://www.makershed.com/Arduinos_Microcontrollers_s/43.htm

              Mintduino ... http://blog.makezine.com/2013/01/18/mintduino-game-pack-learning-arduino-from-the-ground-up/

              Digi-Key ... http://www.digikey.com/product-detail/en/A000066/1050-1024-ND/2784006?WT.mc_id=PLA_2784006&gclid=CMLp77rH-LQCFQSg4Aod5icA1Q

              Atmega AT328P chip with programmed-bootloader ... http://www.adafruit.com/products/123

    8) Arduino Uno R3 … http://www.makershed.com/New_Arduino_Uno_Revision_3_p/mksp11.htm

    9) LCD Shield Kit … http://www.makershed.com/LCD_Shield_Kit_p/mkwd08.htm
     

    10) Prototype Shield: Maker Shed: http://www.makershed.com/MakerShield_p/msms01.htm
     

    11) LCD … https://www.sparkfun.com/products/10054 [or order from the CWTD Project Room … https://dl.dropbox.com/u/43021514/CWTD/TeamspeakChat.html ]
     

    12) Rookey + LCD Combo from Midnight Design .... If you don’t already have a Rookey Kit, this project will be a good set of parts to use in this Arduino project. We reduced the price of the Rookey Kit to make this a good deal for our Arduino project and you’ll benefit from getting it along with the LCD (if you need either.)