Wichit Sirichote, kswichit@kmitl.ac.th
Build your own a personal data logger for recording analog signal. The MiniLOGGER provides 8-channel analog input(-99mV to +999mV), 1-channel pulse input, battery backup 256kB SRAM, Real-time Clock, and RS232C. Start/Stop recording can be made by MANUAL switch or preprogrammed Start/Stop Time. The format of uploading data is ASCII format, suitable for importing and graphing by Excel or any Scientific Plot Program. Exemplary circuit used for measuring Insolation and Air Temperature vs. Time is included.

Direct connect to internet server for remote setting and data retrieving with Easy-Server V0.9


Introduction

I have designed the MiniLOGGER to be used as a data acquisition module for my experiment, "Long-term Evaluation of Grid Connected PV System". Formerly, there's a signal conditioner board having chopper stabilized DC amplifier for Pyranometer, HALL sensor, LM35, and kWhr sensor, it's called Solar-Logger. The firmware of Solar-Logger was written entirely in assembly code, very difficult for maintenance and modification. So I decided to rewrite using 'C' and to provide this page describing how to build the generic part, without analog signal conditioner, with new name, the MiniLOGGER. Those who interested, for her/his experiment can be made themselves, the analog conditioning board to suit their experiment easily. I shall provide the circuit of analog signal amplifier to be used with the MiniLOGGER on later.

Features of the MiniLOGGER V1.0 are as follows:

  • Analog input: 8-channel single-end -99mV to + 999mV
  • Analog-to-Digital Converter: integrated type converter, CA3162, with 1mV resolution at 4Hz sampling rate
  • Pulse input: 1-channel TTL input
  • Memory: battery backup SRAM 628128x2, 256kB (using MAX691 and +3V Lithium battery)
  • RTC: battery backup DS1202
  • Interval between sample: 10s to 600s
  • Serial port: 9,600 baud for uploading the records
  • Manual start/stop recording for standalone use
  • Automatic start/stop recording with clock setting for daily measurement, say start 06:00 and stop 18:00
  • Direct connected to WWW server for remote data retrieving
  • ASCII formatted record for easily importing to EXCEL or any Scientific Plot Program
  • Figure 1: Block Diagram of the Mini LOGGER V1.0
    A simplified block diagram of the MiniLOGGER is shown in Figure 1. The CMOS analog multiplexer, 4051 provides the output for 8-channel single-end input to an analog-to-digital converter chip, CA3162. The CA3162 is connected in free running mode. The digital output is 4-bit BCD started with MSD, NSD, and LSD. The pulse period of MSD is 2ms. The 89C2051 runs solar3.hex, the firmware that controls 8-channel reading and receives external pulse. When  the chip was triggered by INT0 signal, it will send the digital value in ASCII format through TxD pin;
    *20819004722513922007403400000015

    The format is in short form started with * then analog channel 0, 208mV, channel 1, 190mV and so on. The number 000000 is number of pulse input.

    The 89C55 reads such record with time stamped read from DS1202 and saved into SRAM. Now it saves also DATE/TIME and provides comma for each channel separation.

    26/12/99,22:16:24,208,190,047,225,139,220,074,034,000000

    There's also a supervisory and power supply chip, MAX691 for battery backup to SRAM and RTC, MAX232 for RS232 converter, and ICL7660 negative voltage converter.

    Constructing the Board

    My prototype board shown in Figure 2 was made with point-to-point soldering using wire-wrap wire, seems difficult for beginner. My suggestion for making the circuit is to build part-by-part, let first build an ADC board that comprising CD4051 MUX, CA3162, 89C2051 with solar3.hex and a regulator 7805.
    Figure 2: My prototype MiniLOGGER using universal PCB, DS5000 was used while developing the firmware, see later, example of measuring Insolation, the MiniLOGGER used 89c52 instead.

    Checking for ADC board step by step would be as follows;

  • without any chip on the board, check +5V for every Vcc and GND pins,
  • now put the ICL7660 into the board, measure -5V,
  • put 89C2051, CA3162 and MUX 4051 into the board,
  • use a logic probe check the packet of digital data converted by CA3162 when short pin 6(INT0) to GND, that all.
  • Figure 3: Circuit Diagram of ADC Board
    After success build the ADC board, now for the CPU board, similarly;
    Figure 4: Circuit Diagram of CPU Board. My prototype used 75188 and 75189 for RS232C level shifter. You can modify for MAX232 instead.
    Download Firmware
     
    Source File
    HEX file
    Chip
    HEX Code Writer
    Assembler/Compiler
    remark
    N/A
    Solar3.hex
    89C2051
    Easy-Downloader V1.1
     C32
     
    Mini.c
    Mini.hex
       89C55(20kB)
    Easy-Downloader V2.0
     DDS Micro-C TINY model
    free code space ~12kB
    Mini1.c
    Mini1.hex
    89C52(8kB)
    Easy-Downloader V2.0
    DDS Micro-C TINY model with optimizer
    limited to 8kB, no help menu

    Download Data Sheets

    Using the MiniLOGGER

    Commanding

    Run terminal emulation program, say HyperTerminal configured with 9600 bps 8n1, Xon/Xoff flow control, connect RS232C serial port of the MiniLOGGER to COM1. After put a DC adapter, press enter, MiniLOGGER will send title message. Try with '?' help command. The MiniLOGGER accepts single letter command as describe in help command.


    Figure 6: Using HyperTerminal with 9600bps 8n1 Xon/Xoff flow control
    Recording

    Manual START/STOP recording is the easiest way of using in standalone mode, i.e., without connecting to web server. Manual switch connected to P3.2 provides a logic '0' making the MiniLOGGER started to record and when open, P3.2 be a logic '1', stop recording. In this mode, user must set START/STOP TIME to 99:99 to disable automatic mode. The interval between sample that saved in NVSRAM is restored the last set when power up the LOGGER again.

    In Automatic mode, the LOGGER will start record when time of clock read from DS1202 is equal to preset START time and stop record when equal to preset STOP time. During in recording, after finish saving each record, the number of record will send through TxD pin. In both mode, while in standby or stop recording, the LED will blink at 1Hz rate, but while recording, the blink rate will be 3Hz.

    When using manual mode, after setting interval with 'i' command, and set START/STOP TIME to 99:99 by using a PC, we may turn the power supply off. Take the MiniLOGGER to the place for experiment, turn the power on, the LED will blink at 1Hz rate. To start recording, just close MANUAL switch, the LED will blink every 3 sec. When finished logging the data, turn MANUAL switch open, turn the power off, take to the lab connecting to a terminal for uploading with 'r' and 'a' command.

    Uploading

    Uploading and capturing the recorded data is easily be made by using Capture Text. After put a name of capture text file, enter >>a , All read command, all records will then be saved into capturefile.txt


    Figure 7: Enter New Record and Capturing Text file of the records

    Example of Measuring Insolation and Air Temperature vs. Time

    Figure 5 depicts a simple DC amplifier for Pyranometer and LM35 temperature sensor IC. The amplifier is configured to be non-inverting DC amplifier using chopperless precision opamp, OP07. The sensitivity of Pyranometer is 14uV/ W/m2, to amplify for 1mV/W/m2, the gain should be approx. 71. Since the gain of noninverting type is approx. (1+Rf/1k), where Rf is 10 turn 100k variable resistor. A 1k and 10uF forms a low-pass filter. Air temperature is easily be measured by using LM35 IC. However, biasing of the LM35 is done with single-end supply, thus the circuit shown in Figure 5 can be used for measuring temperature from 0 - 50C, say.

    Figure 5: Example circuit of LM35 temperature sensor and a chopperless DC amplifier for Pyranometer
    Graphing

    The ASCII text file of the record can be easily imported into Excel worksheet. Figure 8 shows example graphing of real data taken from two channels, analog signal used in Figure 5.


    Figure 8: Example of graphing using Excel, 89c52 limited firmware version was used.
    Another example is to use GraphPad Prism for insolation plotting from 6:00 to 18:00 at my hometown, Korat province. Click here GraphPad Prism to download FREE Evaluation GraphPad.

     Figure 9: Example of plotting graph using GraphPad Prism
    Connecting MiniLOGGER with Easy-Server V0.9
    Credit

    Thanks to Wanlop(Tea'), wrote for me a nice circuit diagram, Figure 1 and 2.
     

    What I want to tell you?
    I took a couple of year searching for a MacDraw-like program that run on Windows. One day, after logging temperature data with the MiniLOGGER, I need a Scientific Plot Program for graphing my data, I started to use google search engine, www.google.com, first found was GraphPad Prism evaluation version. It produces a very nice graph. In the GraphPad, there's a tool that used to draw a simple diagram on the graph. I thought it works like MacDraw that I love the way it does. I finally be lucky again, yes I found the icon that used to insert SmartDraw picture. The google doesn't me make me sad, just a second, I got the SmartDraw4, I'm very happy of using the SmartDraw, thanks for a very nice Draw Program.

    Many have asked me why do I provide in details of uC circuit on internet? The answer is "it was my happiness", and it was also be in part of the lecture and laboratory for my students.

    Fred Martin 's Miniboard homepage is a good example webpage describing how to build the 68HC11 based controller board for robot project. I've got the idea of expressing useful information say, for public, sharing knowledge among hobbyists, and practicing ourselves, from his page. This led me to provide the page " Build Your Own uC Projects" eventually.


    updated, 11 Feb 2543