Shop OBEX P1 Docs P2 Docs Learn Events
It's a logger — Parallax Forums

It's a logger

RandyRandy Posts: 79
edited 2007-07-21 00:22 in Robotics
A data logger.
·
This project has been growing for a couple of years. In its current form I use it for monitoring temperatures of some heating and cooling equipment with the hope I can change the slopes that determine needed temperatures of the water loops that provide a comfortable environment. The ultimate idea is to save energy. If you are not familiar with the idea, commercial buildings often use outside air temperature to determine what temperatures the boilers and chillers need to run at to provide comfort at maximum efficiency. Insulation, doors and windows, lights, equipment, occupancy, etc make this a guessing game. Many newer buildings have intelligent systems that have a bevy of sensors that help make decisions. I am in an older building that was probably very efficient when built but is a little lacking today. Retro fitting estimates show a payback time that is likely to exceed the life of the existing equipment or usefulness of the building. I am hoping that by manually changing the slope, monitoring the comfort in different parts of the building and logging water temperatures that I can find a better slope than we are using as well as pinpoint areas or equipment that need attention. Anyway enough about what I am doing, on to the project.
·
Temperatures from up to eleven LM34 temperature sensors are feed to a TLC1543 analog to digital converter. I used CAT5 telephone/data cable with a sensor soldered to one end and a three terminal jack on the other end for the temperature inputs. ·A Basic Stamp 2pe will tell the TLC1543 what channel to read, do a little math to the info and it will compare that information to previous information stored in the Scratch Pad RAM. Depending on the comparison the Stamp will either display the information on an LCD as well as sending it to StampDAQ’s message board or it will store the information in a 24LC128 EEPROM. There is a DS1302 clock that will provide time for a date stamp to the EEPROM. The EEPROM addresses are also stored in the clock RAM so they are not lost with a power outage. The clock has a 1F super cap for back up power. I have had the power off for over a week and all the time and data were still intact. ·A MAX1480BEPI isolated RS485/422 data interface is used to connect with a computer that is running StampDAQ. Prompts from StampDAQ will direct the Stamp to download stored data from the EEPROM.
·
The Stamp program consists of five slots. Slot 0 to initialize the LCD, the clock and to get things going. Slot 1 is for setting the clock. It is a lot of program but I like how it works. It will accommodate leap years but I stayed away from Daylight Savings changes as not everyone uses it and who knows when it might be in a few years. Slot 2 is where temperature measurements, corrections and comparisons are made. This is the heart of the program as everything is directed from here. ·Slot 3 is for reading data from the EEPROM and sending it to StampDAQ. Slot 4 displays data on the LCD. The temperatures from all the channels will scroll on the LCD or there are groups of two temperatures that can be displayed continuously for monitoring while making changes to equipment. This slot needs some work. Between Stamps not supporting interrupts and cobbling together code from something I wrote a long time ago when I really didn’t know what I was doing this is not to be proud of. There is room for about two nibbles of code and lots of improvement. It was not my focus and it works so I moved on. It just requires some patience to get where you’re going. ·Slot 5 is for writing data to the EEPROM. This too needs to be reworked. I am wasting lots of storage by using 32 for a counter when I have 17 bytes of data. I have some suggested ideas I received by posting a question on the Parallax forum but have yet to do anything with them. I am not logging data often enough for the amount of memory to be an issue.
·
Where I am in Colorado we can have temperatures down to 25 degrees below 0 Fahrenheit. The LM34 will measure negative temperatures but the Stamp doesn’t like negative voltages. An OPAMP provides 0.32 volts that is fed to the ground terminals of the LM34’s causing their output to be 0.32 volts or 32 degrees above ground reference. Subtracting 32 from the reading gives the correct temperature. I also don’t expect a boiler to be above 222 degrees that would exceed the 2.55 volt upper reference. Safeties should have shut it down before then. Readings outside this range would indicate a shorted or opened sensor. There is a three or four degree bounce in temperatures that I have yet to figure out but by discarding the first two reads and taking twenty five readings and averaging them the temperatures consistently are within one degree. I also have a correction for each sensor so they match a standard. Better than 80% of my readings are exact. The remainder of the readings are one degree high or low.
·
·
There are three push buttons. One is on/off (SET/RUN) the other two are momentary on when pushed. With the SET/RUN in the on or SET position the clock can be set. One of the time, date or day of week elements will be flashing on the LCD. It can be incremented by pushing the UP button. The DOWN button should be referred to as advance. Pushing it will cause the flashing element to change to the next element allowing it to be incremented with the UP button. When the clock is set a push of the SET/RUN button to the off or RUN position will exit the set routine and the program will jump to slot 2 and run. Pushing the UP or incorrectly marked DOWN button while in the RUN mode will eventually bring up to the LCD a number called “view”. ·This number can be changed using the DOWN button. The number chosen will determine what information is displayed. The first or default view will scroll through all of the temperatures, give the time and date and the percentage of full that the EEPROM is at. If data is being saved to the EEPROM it will say so. Most of the data is displayed two channels at a time and grouped together so the supply and return of a loop are visible at the same time. I currently have a sensor just outside the housing to measure room temperature and one in the enclosure to read the environment housing the electronics. I haven’t had and don’t expect a problem but mechanical rooms can get pretty hot in the summer. Advancing the view number with the DOWN – or advance button will change the display to one of the loop pairs and stop the scrolling. This will allow troubleshooting or equipment set point changes to be made without the other data scrolling by.
·
This project is located in a mechanical room that is several hundred feet from the computer that is running StampDAQ. As the electric supplies and grounds are not common and there is potential for a lot of noise and spikes from motors and relays I am using a MAX1480 isolated RS485/422 for the data transfer to the computer. (I just noticed I called it RS484 on the schematic). Realistically I should have one at the computer as that is what I wish to protect. There is a 4pole double throw switch allowing the choice of programming the Stamp or running StampDAQ, both via the serial port. The MAX1480 is bypassed when the switch is in the program selection and the ATN pin is activated. I have not tried programming the Stamp from distance and would have my doubts about the success. StampDAQ has been flawless.
·
I have been putting this together in one form or another for years. As I learned to program Stamps and use other chips I kept looking for a use for these experiments. It has been through many changes, additions, locations, rewrites and merging of code. Especially the code. I have often gotten sloppy with formatting and notes. I have never figured how often the SCRAM is written to or if I am going to wear something out. I would like to figure out why the temperature readings vary necessitating the averaging. A volt meter reads rock steady to a tenth of a degree or volt while 8, 10 or 12 bits (using a TLC2543) of data give the first 7 bits okay and the remainder all over creation. I only need 8 bits, good ones. I have tried different value capacitors and resisters, no capacitors or resisters, breadboards, printed circuit boards, different physical environments and the results never change. Taking several reads and averaging them gives good results but it is not the answer.
·
I am calling this a finished project. But I am thinking about alarms!

I believe the five slots and the schematic will exceed the attachment allotment. I will post "It's a logger 2" with the extra attachments.
·
Randy

Comments

  • RandyRandy Posts: 79
    edited 2007-05-01 00:41
    I am having a little trouble adding the two additional attachments for slots 4 and 5. Hopefully this will add them.

    Randy
  • RandyRandy Posts: 79
    edited 2007-05-01 00:43
    Yes I can not count. There are six slots. Zero is a number.

    Randy
  • RandyRandy Posts: 79
    edited 2007-05-03 01:08
    Pay no attention to the man behind the curtain!

    Boy am I embarassed. In my constant quest to figure out why I am getting the erratic data from the TLC1543 analog to digital conversion I made some additions to the slot that does the temperature grabing routine for observation. It was not supposed to be in the final program. It won't hurt anything, but it·just might add some confusion. Hopefully there are no other mistakes. I guess I shouldn't post things when I am rushed and getting interupted, but then nothing would get posted. Deleat the like named program slot and replace it with this one.

    I will try to add pictures in a few days.

    Randy
  • Nick WaldvogelNick Waldvogel Posts: 71
    edited 2007-05-10 13:13
    Very Nice!· I can't wait to see the pictures!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • RandyRandy Posts: 79
    edited 2007-07-17 02:54
    Well it has been a "few" days but I finally have some pictures. I also have a good understanding of the comments about how difficult it is to get good pictures.

    I have made a change in the code of the temperature routine - slot 2. When I broke a connection to one of the sensors it started logging several times a minute. As I am writing this and am about to post the correction that I made, I found a flaw in my correction. I am most baffeled as the correction worked when tested but upon reading it logic tells me it shouldn't. I need to do some more testing. Once I am comfortable with the change I will post it.

    Meanwhile I will attach the photos.

    Randy
    640 x 480 - 75K
    2272 x 1704 - 1M
    2272 x 1704 - 2M
    2272 x 1704 - 2M
  • steve_bsteve_b Posts: 1,563
    edited 2007-07-17 14:29
    Very cool!
    When I first looked at Im0929, I thought it said Child Support 50degF [noparse];)[/noparse]

    Looks good....only recommendation is to socket those BS2's. Can't tell what the other IC's are, but I'd socket any opto's too!

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • RandyRandy Posts: 79
    edited 2007-07-21 00:22
    Thanks Steve,

    You probably figured out that the abbreviation is Chilled Supply and Chilled Return.

    In an earlier version I used a socket so I could remove the Stamp for reprograming. Opening the box, getting my fingers in there, taking the chip elsewhere for programing, exposing it to static, lining it up to reinsert and yadda yadda. I did a pretty good job of abusing that version and this one and have not had a failure. To not have to do that is much of why I built this so it can be reprogramed with the turn of the rotory switch. A mistake I did make was in using solid wire cat5 cable for the probes. It was cheap and I had a bunch on hand. Flex it too far or too much and it breaks. If you are gentile with the bending when you put it in and you are going to leave it be it is fine. I am forever moving the probes or the box to different locations as I can't leave well enough alone. New probes will get stranded wire.

    Randy
Sign In or Register to comment.