Build a lab-grade data logger with PIC microcontrolller and a 20-bit delta-sigma converter.
A new design of a lab-grade data logger has been developed using a PIC microcontroller and a 20-bit delta-sigma converter. The data logger provides 8-channel DC inputs and the optional digital inputs. The sampling interval can be programmed from 1min to 1Hr. The device uses a cheap memory card for data storage. In addition, the optional serial port also provides data stream for displaying real-time signal on the terminal.
Introduction
The new data converter technology using delta-sigma simplifies the design of high resolution data recording device. One of the interesting chip is Linear Technology LTC2400, 24-bit ADC. Some of my designs were used this converter. Another chip of interest is LTC2420, 20-bit ADC. The chip has pin and data output compatible to the LTC2400. I design the new data logger using the LTC2420 and use the cheap memory card for data storage.
Hardware description
The hardware schematic is shown in Figure 2. The microcontroller is the PIC18F45K20. The package is 40-pin PDIP. The chip runs with a 2MHz internal oscillator. The HS oscillator connected to OSC1 and OSC2 is optional. The low power oscillator using a 32,768Hz crystal is connected to RC0 and RC1. RC7 and RC6 are TTL level UART interface. It provides 9600bit/s data stream for connecting the PC. The SPI port, RC3/SCK, RC4/SDI and RC5/SDO are used to interface the memory card in SPI mode through the J2 memory card socket. RD5, RD6 and RD7 are software controlled SPI port for interfacing the delta-sigma converter, U5 LTC2420. D2 is a bandgap reference diode providing 1.2Vref for the analog to digital converter U5. The analog input multiplexer uses CMOS analog switch,U3 CD4051. CH1 to CH4 are 1V full scale. CH5 to CH8 are 10V full scale. CH5 to CH8 use the input voltage divider. The real-time clock is provided by U4, DS1302. BT1 is a super capacitor 0.33F for power backup to the RTC chip. The DS1302 is programmed to provide tickle charge to the BT1. U9 is TTL to RS232 converter using MAX3232. The power supply provides +5V and +3.3V logic. All logics are used +3.3V. The +5V is for sensor interfacing. The voltage regulators are fixed output linear regulators, LM1117, U7 for +3.3V and U8 for +5V. J7 is for dry cell battery connector. The recommended battery is +6V 2.8AH dry cell battery. U6 is current regulator built with LM317 and R19. It provides the battery charging current from the DC sources, i.e. AC adapter or small solar cell panel. The charging current is computed by 1.25V/Icharge.
Prototype
The PCB board is double layer. Figure 3 shows the component layer, the center chip is PIC18F45K20.
The bottom layer or soldering side is for input terminal and the memory card socket.
Analog input terminal
The analog input terminal is screw type. CH1-CH4 accepts 0-1VDC and CH5-CH8 for 0-10VDC single end input. Pin 16 provides +5V for sensors interfacing. The reading resolution for CH1-CH4 is 1 microvolt, and 10 microvolts for CH5-CH8.
The optional digital input signals is the bottom row terminal.
Each pin has its functional as described below.
- Pulse counter=TTL1 (CH16)
- Frequency counter=PULSE2 (CH17)
- Logic input=TTL1 (CH13)
- Logic input=TTL2 (CH14)
- Logic input=TTL3 (CH15)
TTL1, TTL2 and TTL3 can be used to monitor the contact status between 0V or +12V input. The value "1" shown in the record means +12V input and value "0" for 0V input.
For pulse signal, TTL1(pin4) accepts the TTL pulse. The counter for CH16 is 32-bit totallizer.
For frequency measurement, PULSE2 (pin2) accepts TTL signal with frequency from DC to 15kHz. The reading is +/-1Hz.
The digital terminals also provide optional 10-bit resolution ADC for 0-3VDC input at AN1(CH9), AN2(CH10), and AN3(CH11).
CH12 is battery voltage monitored by internal firmware.
Downloads
Quick Start Guide, Firmware - download
Part 2 - Configurations, Using the temperature sensor with G5-Data Logger, K6 version with RS232 port