Whats the best equipment for this project?

Status
Not open for further replies.

lbeckner

Member
I want to create a control box that will run off a battery and monitor sensors every minute or so and log the results to an SD card. The logged results will need to contain values and a timestamp. There will also be an LCD readout (over serial) that can be controlled by a keypad (possibly over serial) that will allow the operator to set the time/date info and manually check the logs. When there is no operator then the keypad and LCD will be turned off to conserve battery life. I ordered a Teensy ++2.0 and got the LCD up and running and discovered that there is no RTC, I know, I know, a slow-witted move. I am now looking at using a Teensy 3.2 because it has a built in RTC. As far as power consumption is concerned, is it better to add a RTC to the 2.0 or go on up to the 3.2? Also, if I want to control 2 serial devices and log the data to an SD card does that make the 3.2 a better option? Power consumption is a big deal, as I would like the unit to run for a month or so on a 12V 5Ah battery. I only need to collect the data every minute or so and I plan on putting the controller to sleep and waking on a timed interrupt. I apologize if I left out too many details, I am new at this and I appreciate the advise of all you pros out there. Thanks and have a nice Thanksgiving.
 
The battery should be fine for the job, but there are a lot of ways to make this work depending on programing skill, time and money.

The simple way to do it is something like this:
https://www.sparkfun.com/products/10160
Use the alarm function to wake the Micro of your choice, have it power up the remaining hardware, do the reading and then power everything off again. Done right this means the only thing drawing current is the standalone RTC. Expensive though.

Stand alone RTC will be more accuracte out of the box, though good results with temperature compentsation have been achieved with the T3 on, and suspect for data logging would be fine as is.

Fundamentally suspect it comes down to how much time you want to spend on it. T2+RTC will get you up and working using your existing hardware quickly and reasonably painlessly, and depending on the RTC, even without an alarm you may be able to use it's square wave output to increment a wake counter in a deep sleeping T2.

The T3.x solution will be smaller, have newer libraries and have a better chance at low power consumption being a newer core but also leave you with a more complex set of code to get right.

Suspect the critical element in the battery life of this design will actually be the regulation, since dropping 12V to 3.3V will involve some trade offs in conversion efficiency on load vs leakage type losses.
 
Thank you for your response. I didn't consider the 3.3v regulator being less efficient than the 5v regulator. That's a good point. Given what you said I will stick to the ++2.0 and add a RTC. Then I won't have to worry about putting 5v analog signal into a 3.3v controller. Isn't SparkFun that company that steals peoples designs and resells them? I was able to put my controller to sleep and wake it with the WDT but that only resulted in a 8 sec sleep time. I suppose with the added RTC I will be able to make it sleep for as long as I want. I'm still not sure if the ++2.0 can handle my LCD over serial, SD card over SPI, RTC, and keypad over serial all at the same time.
 
8 Sec sleep is about normal for these things, so you end up with a check right after your sleep call that counts up and puts it back to sleep if it's not time to do anything yet. Fun part of course is working out how often to wake far enough to check the real time on the RTC, since the 8 second sleep will change with temperature.

The regulator thing was because a 3.3V linear regulator will be turning 3 times the power used by the circuit to run into heat. A switching reg will drop that right down, but be less effeceint while everything is sleeping. In terms of power to actually run the thing suspect the T3 would use less amps than the T2 to achieve given functionality, but that would quite possibly be lost in the additinal level conversion hardware. Thought there will already be level conversion on the SD card, since the are nativly 3.3V most likely along with the RTC.

Suspect the T2 is capable of what you are trying, since everything except the keypad can be done in sequence, so there is less risk of X blocking Y and the whole pile falling over, and softSerial can probably be used to drive the LCD, since it shouldn't be trying to send much back
 
SD card writes are power-piggy, so do them sparingly!
WoW, a 5Ah battery is unusually large for a data logger.
 
I tried SoftSerial and it ran my LCD perfectly, thanks for that. That opens my hardware serial port. I guess my next step is to get a RTC and figure out how to program it. I appreciate your help Gremlin, you've gotten me along the way on this. Stevech I picked a 5Ah battery because that is the largest that will fit in my project enclosure. It will be charged with a solar panel so if I can use a smaller battery I definitely will. Would you guys recommend using a USB thumb drive for storage instead of the SD card? I was also told that the tech would prefer plugging in a USB thumb drive to copy the logs to. So that would leave me with either a SD card or USB thumb drive for log storage and then a USB port to copy the logs to a thumb drive through the T2. I haven't found anything about the T2 being able to use a USB thumb drive. Is it feasible?
Stevech I noticed in your post you wrote 'WoW', hehe, I suspect you are a World of Warcraft player.....
 
In terms of RTC programming, most RTC's use i2c and are DS1307 compatible. There is a DS1307RTC library: http://www.pjrc.com/teensy/td_libs_DS1307RTC.html.

You can find DS3231 RTC's (that have internal support to correct the time with temp. sensors) fairly cheap. I went over to ebay, and I found a US seller for $2.

I don't think there is support for USB thumb drives, but just include a SD or Micro-SD card reader for the tech to copy the drives. The tech would have to take out the SD/micro-SD card and put it in the reader.
 
Michael I wish I would of waited until after your post to order the RTC. I bought one of these http://macetech.com/store/index.php?main_page=product_info&cPath=5&products_id=8 . It's called a ChronoDot. I'll look on Ebay for the DS1307. I wish PJRC sold the RTC, I would prefer to get everything there because the support is really good. I'll abandon the USB thumb drive idea and just require them to remove the SD card, copy the file, and put it back in the logger. Thanks for your help.
 
Just want to put in a plug for the M41T62 RTC capable of 2 ppm accuracy. The way I designed the board it fits well onto the Teensy 3.X and comes with a supercap for backup power, etc. The power draw of the RTC, pressure, humidity, temperature sensor is less than 100 microAmps and it has a 256kbyte I2c EEPROM on board for logging. May not be exactly what you need but you can see what's possible in a very small, power efficient design.
 
Just want to put in a plug for the M41T62 RTC capable of 2 ppm accuracy. The way I designed the board it fits well onto the Teensy 3.X and comes with a supercap for backup power, etc. The power draw of the RTC, pressure, humidity, temperature sensor is less than 100 microAmps and it has a 256kbyte I2c EEPROM on board for logging. May not be exactly what you need but you can see what's possible in a very small, power efficient design.

@onehorse, you might want to look here: https://forum.pjrc.com/threads/2927...in-audio-library?p=89230&viewfull=1#post89230
 
Chronodot is one of the original DS3231's. I think it was made by Adafruit (or at least sold by them). It works, but for my Pi's, I moved on to the cheaper clones that are now flooding the market (note, I don't depend on high accuracy, since I tend to use the RTC in raspberry pi's when there is no network available) You don't want a DS1307, as they are 5v only, and the Teensy runs at 3.3v. The later generations of the RTC can run at both 3.3v and 5v. In the DS series, you want DS3231 specifically, as that RTC is more accurate, since it has a temp. sensor to correct for differences that occur in hot/cold temps.

Onehorse designs are always topnotch, and are made to fit the Teensy.
 
Status
Not open for further replies.
Back
Top