PDA

View Full Version : Some Adviced Needed Please.



sccsltd
- 16th January 2010, 20:46
Hi guys.

im still a relative newbie at pic programming.
i recently completed my ds18b20 temp monitor project.
it now monitors 9 sensors and logs to serial.

this brings me to my next project.

im looking to build a ds18b20 based temp logger.

heres what im planning.

has to be small. size of a chicken egg.
log 1 sensor every x seconds (dependant on memory storage)
a way to retrieve data on pc.

any suggestions?

im currently thinking...

12f683 / 12f629 / 16f628 as i have theses already
and possibly using a micro-sd card in spi mode for storage.

if anyone has any code or suggestions they are more than welcome..


Thanks.

Archangel
- 16th January 2010, 22:46
Size of a chicken egg huh? How big are the Chickens in your neighborhood ? Sounds like your instructor gave you some wiggle room there. Log how much data? will an eeprom do? This is the job of an engineer, Ask those questions and develop the answers, it is also where most engineers go astray and allow " Feature Bloat " to drive up their item's cost / complexity / difficulty of use. Look at the typical cell phone as an example. got more computer than my 5 year old desktop computer, and why? All it really needs to do is make and receive calls.
What will VISTA do that's so much better than a properly working WIN 98 SE system? I find most of those things just annoy me, I. E. Java apps that get in the way, Thank God for ADBLOCK !
So, I guess my question is . . . what are you looking for?
You already know how to measure the sensors , you already have an assortment of PICs with features, each a little different.
Roll up your sleeves and write some code and post it when you have problems, and ask about the problems.

sccsltd
- 16th January 2010, 23:18
thanks for the reply.

firstly this is not homework... and im not looking to have the code written for me im sure i can manage the code.

im looking more for the experience of you guys in a design capacity.
i have no brief to work to so am open to all options, the reason i was looking at sd cards was for storage space and being able to be read directly by the pc.

the idea is to place the completed project inside a fake egg to monitor temperatures in the nest of a peregrine falcon (captive bread not wild)
this would not be feasible with my original serial logging design

my objective is to log for long enough to reach max egg temp in the nest and also patterns of sitting and night/day temps

logging the temp in 12bit from the ds18b20 means using 2 bytes of memory for every temp logged.

so if i say log every 30secs, that would mean 2880 bytes for every 24hrs
that would be an ideal starting point.

so again suggestions welcome on what hardware to use most appreciated.

Melanie
- 16th January 2010, 23:41
Let's start by getting the maths right...

24 (Hours) * 60 (Minutes) * 2 (every 30 Seconds) * 2 (Bytes) = 5760 Bytes/Day

If you pick a 64kB Micropower 18F PIC and be frugal with your code and your Hardware usage, you could record ten days worth of Data with an on-board 3v Lithium Battery... unless of course your nest happens to be adjacent to a convenient tree-top Power outlet.

I can envisage some problems with the Thermal Dynamic properties of your 'egg' material affecting the temperature readings. If you make it thermally conductive (ideal), the bird will detect it as alien and throw it out of the nest. If you make it look, feel and weigh akin it's own eggs, it won't have great thermal properties (and it'll still chuck it out of the nest when it doesn't hatch!).

Good Luck!

BTW... I recall seeing 'plastic eggs' being used in the Food Industry for Data-Logging fridge temperatures more than ten years ago.

Archangel
- 17th January 2010, 03:29
thanks for the reply.

firstly this is not homework... and im not looking to have the code written for me im sure i can manage the code.

Good, My Apologies, I thought maybe it was. :o We see many of those appear about finals time.


. . . the reason i was looking at sd cards was for storage space and being able to be read directly by the pc.

And the reason I was <b>not</b> thinking SD cards is their size and added complexity of the device.



the idea is to place the completed project inside a fake egg to monitor temperatures in the nest of a peregrine falcon (captive bread not wild)
this would not be feasible with my original serial logging design

my objective is to log for long enough to reach max egg temp in the nest and also patterns of sitting and night/day temps

logging the temp in 12bit from the ds18b20 means using 2 bytes of memory for every temp logged.

so if i say log every 30secs, that would mean 2880 bytes for every 24hrs
that would be an ideal starting point.

so again suggestions welcome on what hardware to use most appreciated.
Several options, Melanie (as always) laid out a good one. There are some very small RF Transmitters, if storing or retrieving data "OFF EGG" is permissible. You could transmit data and clear eeprom after for continuous monitoring, of coarse now the device is getting crowded in that egg. It sounds like a worthwhile project, keep us posted.
One more thought: What about those passive infrared point and check thermometers ? Maybe easier to hoodwink the Falcon into thinking it is a nest stick . . .

Jerson
- 17th January 2010, 04:08
"The size of an egg?" surely you don't want to check on the hen and her brood.

I would consider the use of a 24C512 EEPROM to get 64kB of storage and use RS232 for interface to the PC. If that is not enough, a removable micro SD card will definitely be a good bet. However, if you think FAT12 / FAT16 for the SD card, I am sure it will not fit into a small PIC. You may have to go with an 18F series with at least 8K flash(it's just a hunch, I have no experience with FAT on PIC) A proprietary file handling on the SD card, on the other hand, will allow you to work with it on your PIC in SPI mode.

sccsltd
- 17th January 2010, 08:56
Let's start by getting the maths right...

24 (Hours) * 60 (Minutes) * 2 (every 30 Seconds) * 2 (Bytes) = 5760 Bytes/Day

If you pick a 64kB Micropower 18F PIC and be frugal with your code and your Hardware usage, you could record ten days worth of Data with an on-board 3v Lithium Battery... unless of course your nest happens to be adjacent to a convenient tree-top Power outlet.

I can envisage some problems with the Thermal Dynamic properties of your 'egg' material affecting the temperature readings. If you make it thermally conductive (ideal), the bird will detect it as alien and throw it out of the nest. If you make it look, feel and weigh akin it's own eggs, it won't have great thermal properties (and it'll still chuck it out of the nest when it doesn't hatch!).

Good Luck!

BTW... I recall seeing 'plastic eggs' being used in the Food Industry for Data-Logging fridge temperatures more than ten years ago.

oops my bad, forgot to add a 2, thanks for pointing it out, i will look into the 18f PIC's, the advantage i have with the fake egg is that the bird is fully imprinted meaning the eggs can be deposited and retrieved at any-point, we use fake eggs at the moment to replace the ones taken for incubation, so i know the idea will work ok if i can get it built small enough.



Good, My Apologies, I thought maybe it was. :o We see many of those appear about finals time.

And the reason I was <b>not</b> thinking SD cards is their size and added complexity of the device.

Several options, Melanie (as always) laid out a good one. There are some very small RF Transmitters, if storing or retrieving data "OFF EGG" is permissible. You could transmit data and clear eeprom after for continuous monitoring, of coarse now the device is getting crowded in that egg. It sounds like a worthwhile project, keep us posted.
One more thought: What about those passive infrared point and check thermometers ? Maybe easier to hoodwink the Falcon into thinking it is a nest stick . . .

yes i too have noticed that ALOT of people asking for help are doing finals or homework. ill have a look into the rf side and see if i can build anything small enough,

also cost is a major factor at the moment, if costs go too high then it would be more economical to get something like http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4088

with the sd cards i understand that the code gets quite extensive and the need to have a extra 256bit memory device for storage before transfer to the sd card, altho i wasn't looking at using a file system on the card just write the data to the card and retrieve it later using my hex editor, i can the write a .net app to handle the conversion from dump to usable data.


"The size of an egg?" surely you don't want to check on the hen and her brood.

I would consider the use of a 24C512 EEPROM to get 64kB of storage and use RS232 for interface to the PC. If that is not enough, a removable micro SD card will definitely be a good bet. However, if you think FAT12 / FAT16 for the SD card, I am sure it will not fit into a small PIC. You may have to go with an 18F series with at least 8K flash(it's just a hunch, I have no experience with FAT on PIC) A proprietary file handling on the SD card, on the other hand, will allow you to work with it on your PIC in SPI mode.

that's exactly what we want to do, we cannot use rs232 because the egg must be free moving and not on a tether/umbilical it has to be self contained
yes i had read they dealing with fat/16/32 requires a lot of coding, which is why as i said above i was thinking of no fs at all just raw data on the card, treat it like a giant spi eeprom i can worry about retrieving the data at another time. i have software that allows raw access to any memory card or drive i use in the pc. so i can just use this to dump the data from the card and into a .net app to decode and plot graphs etc.

thanks again for all the replies,

sccsltd
- 17th January 2010, 09:58
found this
http://www.gedanken.demon.co.uk/temperature-recorder/
so looks like my idea is totally feasible.

his code is in asm so not much use to me but the idea is there, a 24C512 and a pic12f638/629
going to use that as a start point and see how i get on,