Two Open Logs and an RTC

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a project where I need to log both transmit and receive data to and from a cellular modem module. The data will be collected from a remote location over a period of a couple of weeks. I picked up a couple of open log boards, a DS3234 RTC board and a basic FTDI board from Sparkfun and a couple of 4GB microSD cards. I've modified the open log firmware so that the master open log board will read the time and date from the RTC using software SPI and then use the manchester library to send the time over to the slave open log board using a single wire. Each slave open log board will send the time to the next slave in the chain. To do this, PC0 is used to send the data downstream and PC1 is used to receive the data from upstream. The time is read by the master and propagated to the slaves just after power-up of the logger. I then count on each logger to periodically write the time/date to its log file. This time entry is made prior to the open log firmware entering sleep state which happens when no data is received for 2 seconds. The basic FTDI board is only used to program each of the open logger boards.

 

I'll post links to the various Arduino libraries that I've modified once I get caught up here a bit.

 

Enjoying life in Canada!

Tom

 

Master Slave Open Logger with RTC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey where have you been lately? laugh

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cool project, since you only read the time from the RTC at boot up, how well do the slaves maintain time after that,

or do they poll for an updated time periodically?  Once a day perhaps to stay in sync?

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John, I've been working for a couple of startup companies in the Seattle area for the previous 6 years. Not much time for anything but work. I got married in July and obtained a Canadian work permit in October so now I'm finally home with my wife in BC. Your number of posts has increased since I've been on the board. Hope you're doing well.

 

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim, The system that the loggers are installed in are power cycled at least once a day. In between power cycles, each open logger's ATmega328 keeps 'good enough' time for what I need.

 

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hope you're doing well.

Trying to keep on breathing like other "ol' fellows" around here. laugh I guess you know we lost Chuck Baird a few months ago, very sad.

 

Oh and of course congratulations on your wedding. yes

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Wed. Dec 16, 2015 - 08:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Joo Tom !

A real pleasure to see you're back again. yes

 

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Although not Arduino code compatible this DATA LOGGER also from Sparkfun, and is totally reprogrammable, has a built in battery charger and USB mass storage interface. I customized the firmware for a few of them years ago. They are still in service spying on Germans mowing their lawns as far as I know. There's always more than one way to implement a design.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@js, So sorry to hear about Chuck. My sympathies go out to his family and friends.

 

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@plons, Nice to see you here too! The neighborhood looks a bit different!

 

Tom

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,  The individual loggers did not keep track of the time very accurately over a day. Since I didn't tune the timer handling as is described by Karl here, this wasn't too much of a surprise. However, I did have the square wave/alarm output from the DS3234 connected to PD2 on the master open logger ATmega328, so I set up an interrupt to update the local time after it's read from the RTC once per second. Once the RTC time is read by the master open logger, it sends the time to daisy-chained slave open loggers using the manchester library over the "one-wire". After this is complete in setup(), I change the function of the one-wire pin to output and toggle its state in the Master's PD2 (RTC square wave 1 per second) interrupt handler. On the slave open logger, after receiving the current time over the manchester encoded link to the master, I setup the one-wire pin to be an input with a pin change interrupt. Thus, I am able to keep the master and all downstream slaves synced to the same time without disrupting the time-critical data logging function. The data I'm logging is at 115200bps, but it bursty, so I write the current timestamp to the uSD cards in the portion of the logger function that puts the logger in a low-power sleep mode if there is no activity after 2 seconds.

 

Tom