EmbDev.net

Forum: µC & Digital Electronics Search for best processor long term data logging


von Dirk (Guest)


Rate this post
useful
not useful
Hi,

I am not sure how to search to not trigger the same processor which I 
thought might be the best. Goal is logging temperature, brightness and 
clarity of lake water.

So my requirements are:
1 year logging
3 analog Input ports
USB connection
I calculate about 250kB-500kB for 1 year (e.g. 1 measurement / 4h).
AND I would need to use a small battery pack only (could be 500mAh 9V 
Block or 3.3V Li Cells)

Ideally to read out the data SD card seems to be favorable too. But 
higher requirement is the battery limitation.
So I was thinking of ATtiny85 or Arduino Nano kind of setup with some 
extra storage connected. But I may be wrong.
So any help is welcome. If there is such project somewhere to find even 
better. :-)

best regards
Dirk

von hinz (Guest)


Rate this post
useful
not useful

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
Hi Hinz, thanks for feedback. There seem to be compatibilities with 
Arduino boards, I have to find out. On TI page it says GCC compiler that 
should be ok. I have not yet much found on eval boards. In the end I 
like to build about 15-20 applications so have to look at price finally 
too.
Let me check this out tomorrow.
Best regards Dirk

von Manfred (Guest)


Rate this post
useful
not useful
Dirk wrote:
> So I was thinking of ATtiny85 or Arduino Nano kind
> of setup with some extra storage connected.

Aduino Nano is not a good idea because of it's USB-interface. In this 
case, the A* ProMini is a good choice, sleep with timer around 5µA: 
http://www.home-automation-community.com/arduino-low-power-how-to-run-atmega328p-for-a-year-on-coin-cell-battery/

If you use the version with 8 MHz, it can run directly from one 
LiIon-Cell.

However, you need to think about powering of your sensors, can work 
between 4.2 and 3.0 Volt? How to powering down while the AT328 is in 
sleep mode?

How you can handle powering down your sd-card and initialize again after 
restart? The usual China modules have an xx1117-3V3 with too mouch 
quiescent current, replace by MCP1702 / 1703 but with different pinout.

von Chris R. (ohne login) (Guest)


Rate this post
useful
not useful
Hi Dirk,

do you really want to fire and forget?
I could imagine it is quite unpleasant if you leave the hardware at the 
lake and the firmare/hardware does weird things - for whatever reasons.

And of course do you want to collect data in shorter periods than one 
year? What if a sensor runs away or gets broken?

I'd suggest to use some rf magic like Lora (if monitoring is a thing), 
also you should have a not too bad time reference - you could of course 
use the ambient light which is accurate for longer periods but why so 
complicated ;)

A external RTC is quite accurate and not to expensive.

For the MCU selection - if you want to stick to Atmel/Microchip go check 
the tiny816 or the amtega 0 series (eg. Atmega3208) those are quite 
decent IMO.

If you want to have low power the EFM32 claim to be very low power.

If you're concerned about power consumption and don't mind larger 
footprint, use a solar cell both as light sensor and energy source (or a 
solar cell as energy source and an off the shelf ALS if you don't want 
to bother calibration)

Just some thoughts :)

von sid (Guest)


Rate this post
useful
not useful
you somehow lost me on bightness and clarity already ...
sounds like one and the same;
or you want to measure the tint and opacity?

Anyhow, that sounds like a more sophisticated optical sensing than a 
good ol' photoresistor.
More like a full fledged albeit low res camera module.
I'm only asking because that will (well - might) be the main cause for a 
drained battery;
and as that it's almost of no importance if you throw an ATTiny10 or an 
ATMega16 at it.
In terms of reliability I guess any modern day µC that has a wide enough 
temperature range for your lake in question will do just nicely.
So the only thing I can think of is low power consumption.

So in order to answer the question in a reliable way, it'd be important 
if you could let us know what three sensors you have in mind.
(make and model and if possible linked datasheets)
To properly guess the required amount of battery juice for a single 
reading and then expraopolate from there.

Too bad btw you said lake not river...
I saw a hobbyist project once that used a tethered submarine-style 
controller with a tiny turbine..
the flow charged an array of caps which then powered the gear.
that was nice.. (IIRC it was only temperature and time to interpolate 
flowrate or such.. can't remember exactly.. hence I cannot find it atm)

Another possibility might be to equip the gear with a small solar cell, 
salvaged from an ikea garden light or such..
(I think there are also swimming pool lights that work alike)
a small amount of rechargeable double-A batteries (mostly just one, 
sometimes up to three) power those lights,
and usually should hold enough of a charge to power your gear for quite 
a while.. if it's enough to cover all of a long winter IDK,
depends on the requirements again.


'sid

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
Might be better to first realize project with Arduino nano and then 
switch to MSP430 ? I have not been programming to much the last years.
Regards Dirk

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@ Sid: Yes, 3 sensors is my plan:

1xTemperatur - resistor
1xPhotodiode or resistor
1xOpacity: 
https://www.ebay.de/i/362675061100?chn=ps&norover=1&mkevt=1&mkrid=707-134425-41852-0&mkcid=2&itemid=362675061100&targetid=896427593016&device=c&mktype=pla&googleloc=9044506&poi=&campaignid=10199424628&mkgroupid=101937413997&rlsatarget=pla-896427593016&abcId=1145992&merchantid=7364532&gclid=CjwKCAjw8pH3BRAXEiwA1pvMsejQ9R8-5p2zAebk_C2zt75AhV0Hf7CxIKgTiOgXtQw1nMKJVd-GIhoCuxgQAvD_BwE

I have thought on a solar cell at the water surface as well but the 
problem is that other people see the solar cell and will remove it. 
Therefore I need to mount it below water surface in 1xsensor pack at 
0.1m, 1 at 5m and 1 at 10m. So that will be in total 3x3sensor packs. I 
intended to keep them independant due to robustness so they can easily 
connected to a simple rope.
Does this help to understand?

Best regards
Dirk

von Toby P. (Guest)


Rate this post
useful
not useful
Dirk B. wrote:
> 1xOpacity:

That part alone needs 11mA during Operation.  Did you calculated the 
total power requirements of all sensors during the your campaign? 
Methink processor power is neglectable.

Btw. 10 meter depht means 1 bar pressure (1kg on each cm²). On a first 
view i do not see how you can tighten this sensor against it (i made 
measurements much more deeper and offshore).

Putting sensors in natural waters invites all the tiny little creatures 
in fouling and covering your sensors. Are you aware of this? Then you 
have leakage out from moisture. It is hard to tighten a case over longer 
periods without special hardware. Putting ebay buying parts together in 
a case means  a hard way to prevent this.

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@Toby, yes I am aware of the sealing topic. I have been building an 
underwater lamp for scuba diving. I would be able to view the sensor 
from frequently but I do not want to need to do so. We will be cleaning 
the sensor from algae if necessary as well. The sensors we be mounted on 
the side not at the top. My plan currently. I wanted to prepare "diver 
eggs" for it. - Regards Dirk

von sid (Guest)


Rate this post
useful
not useful
So nine sensors, not threee all of a sudden then..
and lacking the info on what sensors will be involved but one
(an ebay link is not a datasheet..)

If that's your type of research, I'm afraid I don't bother too much...
The footwork at least should be your part not ours!


good luck with the project.

'sid

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@Manfred, yes I agree the sleep modes are very important to get 
realized. Therefore I like to use a µC with those capabilities.

The article on powering down the AT ProMini I like very much. That 
allows working on a well-known platform and step-wise powering down the 
setup.
So the USB-Board you probably have then remotely for programming only - 
I guess. Would you recommend a DTR connection as well? Due to sensor I 
would choose the 5V variant knowing now that this will be even better.

I guess that the sensors in sleep will be fully depowered and do not 
create additional currents?!
Then to the 13mA I problably have to add 11mA for opacity and let´s be 
safe 10mA for Temp. and Photoresistors each. So it would be 44mA total.

What about the data storage now? The A*Nano offers sufficient storage. 
So with realization of Pro Mini: To connect the SD card you said replace 
China-ware with low power chip variants of MCP1702/3. SD Card then could 
be filled with MBytes? As said 1MB will be enough.
SD card consumption? I read 100mA for 5ms, so with a wake-up cycle and 
writing at the end the overall energy shall be low. In stand-by I saw 
values around 250µA. Powered down does it get depowered further down or 
do I require MosFET switches or so?

Any comments welcome. Many thanks to all for helping to frame it. - Dirk

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
.. furthermore: I need to log date/time as well. Do I need the Crystal 
version of an A* ProMini? or is the runnaway neglectiable: some 
10minutes are no problem in a month I would say.

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@sid, sorry 3 different sensors to add in one project as said above. I 
do not get more information so far on the turbidity sensor. The other 2 
are a thermal resistor and a photoresistor (or photodiode). But I plan 
to have 3x the same setup built. Due to seaing topics I will not couple 
them. There is much more expensive turbidity sensors 200-5000 Euro 
though. I have seen other sensors where I have asked for quotes and data 
sheets. This is all I was able to investigate in the short time. But 
never mind. If the turbidity sensor turns out to be a bad one I may have 
to skip that one unfortunately or I find another in the mean time. I 
know that turbidity is not easy to measure.
Thanks for your comments . take care.
Rgds Dirk

von bananenbieger (Guest)


Rate this post
useful
not useful
Opacity : forget about that. Whatever surface will usually be covered 
with algae sooner or later.

von Diver (Guest)


Rate this post
useful
not useful
Check this blog out. This person has a lot of experience in low-cost 
underwater data loggers utilizing Arduinos:

https://thecavepearlproject.org/

von Diver (Guest)


Rate this post
useful
not useful

von Diver (Guest)


Rate this post
useful
not useful

von sid (Guest)


Rate this post
useful
not useful
okay for time_based logging;
@Dirk you didn't understand..
the exact sensor is important to get it's demand and respnse time 
properly.
"some photoresistor" is just not going to cut that.

Anyhow, you'll need to cover that battery reqquirement on your own once 
you get the infos yourself then.

Timely based logging:
No problem, just don't :D
Honestly, since you log in consecutive order (write storage in 
consecutive bytes) and you know the length of each dataset;
you can calculate the time of each entry with your reader later on and 
save a significant amount of storage
(say each set has 20 bytes) so the 400-420 block is the 20th reading and
with one reading every 4hrs it came in 80 hours after it's initial 
start.
(simple math easily to be done even in a simple spreadsheet excel like 
reading application)

In order to get the most accurate times, a RTC would come in handy..
most require a significant amount of juice unfortunately or get quite 
expensive easily.

So what I've seen to work well is a cheap LCD Quartz watch with an alarm 
function acting as a trigger.
it itself is powered by it's own tiny button cell (as usual)
with an alarm set every four hours.
the buzzer is replaced with a signal line to trigger the powerboard.
And the "alarm off" button is connected to a datapin on the arduino.

When the alarm goes off the powerboard then sends the 5V (or what have 
you) to the arduino,
which in turn holds the powerboard active and reports the "I'm awake 
stop beeping" buttonpress to the watch (to stop the alarm).
Once the arduino has done it's work and logged all data properly
it cuts it's own powerline to the powerboard which in turn then falls 
back to sleep automatically and neither the arduino nor it's attached 
sensors get any power.
So all you need is a low standby current powerboard, which should be 
fairly easy be done in <7µA or such..
IDK if there are any prefabbed chinese ones out there (I guess so) but 
plans on how to make one are widely spread over the internet.
(the infamous amazon order buttons used a very similar power-approach 
for example powering a wifi reporter with a single triple A over several 
thousand button presses)
And best of all the arduino's watchdog doesn't need to wake up every 
couple of seconds to count up to the four hours, but it just hangs there 
waiting for the alarm to tickle it'S power switch.
So all idle power is part of the cheap wristwatch movement.
even the lousiest LCD watches can last well over a year from those tiny 
button cells..
and if you worry about that,
you can just replace the buttoncell with a triple A to have it last for 
decades if you want.


'sid

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@bananenbieger - Yes, I am aware of the problem. We will be able to 
clean regularly - almost weekly but do not want to remove and readout 
all the time.

@Diver - The CavePearlProject and ESA Article are good input also using 
Arduino ProMini. Triggers ideas to isolate the sensors better in the two 
parts I have anyway with the diver´s egg.

@Sid - great input: 1. to use a separate watch to wake-up the board. It 
generates also more freedom with the sensors if needed to exchange. This 
is best input now and solves most of the problems on power!!!

2. to not log the date/time information. That reduces the storage down 
to ~34kByte for 1h logging and ~8kB for 4-hourly logging: Then it could 
already match into the Flash, but readout might be less comfortable than 
with SD cards. I wanted to mark them and can other people also to 
transport them. But with first approach it doesn´t matter too much 
anymore.

to the sensor topic: All 3 sensors would provide analog signals which I 
hope the Arduino resolution is sufficient to resolve. Specifcation says 
10bits which is each 1024 values for Temperature, Brightness and 
Turbidity. If I look at the tolerance of the sensor of 5% e.g. I do not 
need to store that many bits. 2 byte for temperature allows 0.5° in the 
range I need. and 1 byte each for brightness (sunny days vs. milky days 
+ turbidity) and turbidity (4.4 NTU would provide the 10 bit resolution 
- according to the data provided on the website - and the relevant area 
will be between 0.2 to 50 NTU max. => 4 bit sufficient =>1byte). 4 Bytes 
in total per log only!

I will go shopping now for the parts :-)

Many Thanks & Regards Dirk

von bananenbieger (Guest)


Rate this post
useful
not useful
An RTC perhaps a DS1302 or so takes far less current than anything self 
built. in the order of 400nA or less. There are RTCs which can provide a 
timer interrupt eg for wakeung up a controller.

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
Hi guys,
still searching for a useful clock which provides continues alarms like 
a programmable timer. The DS3231 has two alarms which on the one side it 
says "Two programmable time-of-day alarms". Does this mean 2 times per 
day only? I need to be able to get to e.g. each 1h or 2h or so.

On the other side the data sheet shows a table of timekeeping registers: 
There is function column saying "alarm 2 minutes, alarm 2 hours, alarm 
1h, ...".

Table2: ALarm Mask Bits: There it says ALARM RATE: Alarm when hours 
match. So it looks that it should work. But I am unclear whether only 
full time need to be set und therefore just one single time / day is the 
trigger finally?

"Alarms The DS3231 contains two time-of-day/date alarms. Alarm 1 can be 
set by writing to registers 07h to 0Ah. Alarm 2 can be set by writing to 
registers 0Bh to 0Dh. The alarms can be programmed (by the alarm enable 
and INTCN bits of the control register) to activate the INT/SQW output 
on an alarm match condition. "

I just don´t want to buy wrong device and wait another week or so to 
continue..

Many thanks for quick clarification: Does this 1h hour timer work with 
DS3231?

Dirk

von Toby P. (Guest)


Rate this post
useful
not useful
Dirk B. wrote:
> We will be cleaning
> the sensor from algae if necessary as well.

And reading the data during inspection is not an option?

Dirk B. wrote:
> almost weekly but do not want to remove and readout
> all the time.

Why? you can replace an external battery and SD card (and hold a backup 
in the probe).

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@Toby,

Well I do not want to open the box sealing regularly. The sealing will 
suffer too much and finally the electronics gets watered. :-(

The sensors I will put into Epoxy resin to isolate from internal 
electronics. The outside is the one which can be easily cleaned.

Dirk

p.s. any idea on the clock timer?

von rusty (Guest)


Rate this post
useful
not useful
Dirk B. wrote:

> 2. to not log the date/time information. That reduces the storage down
> to ~34kByte for 1h logging and ~8kB for 4-hourly logging: Then it could
> already match into the Flash, but readout might be less comfortable than
> with SD cards. I wanted to mark them and can other people also to
> transport them. But with first approach it doesn´t matter too much
> anymore.

This sounds to me that you plan to use the program flash of an ATMega328 
as data storage. Do you have some experience in doing that? It's 
possible but not a simple task.

If you do not want to use SD cards, why not just taking a separate SPI 
EEPROM to store the data. If you get a PDIP package and put it in a 
socket, you can just take it out and read the data externally.

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
@rusty, with external triggered wake up I do not need to look too much 
in the power down and will use SD Card for storage. Regards Dirk

von Toby P. (Guest)


Rate this post
useful
not useful
Dirk B. wrote:
> Well I do not want to open the box sealing regularly. The sealing will
> suffer too much and finally the electronics gets watered. :-(
>
> The sensors I will put into Epoxy resin to isolate from internal
> electronics. The outside is the one which can be easily cleaned.
>
> Dirk
>


Maybe a 2 part design with watertight connections makes sense. One with 
sensors and one with battery and memory. Than you can use enough power 
and gets rid of 1 year storage demand (and risks like data loss by 
device loss).

Doing this and long term storage and sensor operation demands are an 
option and nice to have.


Me think there are conflicting design goals. A very low power very 
special device made out of standard components. Designing that way runs 
often in unforeseen conditions that are hard to handle, lacks 
flexibility and ends in extensive component search.


> p.s. any idea on the clock timer?

Sorry no, i will made the whole project with an XLP PIC. Simply because 
i can. Last time i had sleep current below 100nA. Due to periodic wake 
up the clock timer is always included (or complimentary).

von Dirk (Guest)


Rate this post
useful
not useful
Hi,
I am in implementation phase. I have got a problem not yet solved with 
the alarm output from a DS3231 ZS-042 module: The alarm does not switch 
the SQW port. Now I am reading adverse information on removing 
resistances (there is a 4xCascade pullups or not.
PIN2 of Arduino mini can be switched an is set to HIGH as default.
Output of DS3231 stays at LOW. According to data sheet it says that 
output requires an external pullup resistor which I would say is the 
cascade. But stays on LOW. IT evens pulls down the Interrupt pin2 of the 
Arduino board. What´s wrong? THe clock generally works and gives out 
TIME, ...

I have used several implementation sketches.
So first question what to do with these resistance cascade?

Thks

von Dirk B. (Company: privat) (tulip)


Rate this post
useful
not useful
..continued: Alarms say that they are ACTIVE.
  Serial.println(Clock.checkAlarmEnabled(1)); = 1
  Serial.println(Clock.checkAlarmEnabled(2)); = 1

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.