Wichit Sirichote, firstname.lastname@example.org
New design MiniLogger V3.0, 4-channel differential MUX, 12-bit integrating type ADC, 128/512kB battery backup, built-in LCD and key settings.
I had requested by head of the department of Applied Physics to design a low-cost device for the workshop on "Building Simple Instrument for Physics Lab" held in August 1, 2003 at the Faculty of Science, KMITL. The workshop has 29 participants. All of them are from high school physics teachers. The project was the cooperation between Institute of Science and Technology Teaching Promotion and the Faculty of Science, KMITL. Basic concept of the hardware is not so different from the Minilogger V1.0. However new version has a 12-bit dual slope converter, ICL7109, my favorite classical converter. I added the LCD and key settings for easy setup. The analog input is + 400.0mV with 0.1mV resolution! The input range is not so high, not so low, you may provide your own sensor circuitry that has output in such analog range easily.
Figure 1: The MiniLogger V3.0.
The MiniLogger V3.0 features;
- CPU: T89C51RD2, PLCC44, 64kB Code memory @11.0592MHz
- MEMORY: 64kB code memory
- 128/512kB battery backup SRAM: capacity 2,500 records for 128kB SRAM and 10,000 records for 512kB.
- GPIO: 5-bit output port, TTL compatible
- 4-bit input port, TTL compatible
- MEMORY and I/O Decoder: GAL16V8D
- RTC: Real-time clock, DS1307 with +3V Lithium backup
- ADC: ICL7109, 12-bit dual-slope converter, +400.0mV 0.1mV resolution, ~12.5 conversions/s
- MUX: 4-channel differential analog input
- Sampling LED: single dot LED
- Keypad and LCD: 4-bit keypad and 16x1 LCD
- Serial Interface: RS232C 9600 8n1, XON/XOFF flow control
- Firmware: Mini3.c
Let make the hardcopy of the complete schematic beforehand. You may follow my description with the schematic in hand. The micorcontroller is U3, T89C51RD2, or shortly RD2 chip. It has a nice feature with 64kB flash memory. We can load the machine code in application board with the help of internal boot loader. The machine code can be downloaded by FLIP software, you can get the latest version of FLIP freely from ATMEL website. To activate it into boot mode, you just make JP1 tie to GND, on the board you can select FLIP position. The software will direct you the steps how to program the RD2 easily.
Figure 2: Schematic of the MiniLogger V3.0 (click for complete schematic).
1MB Memory space
I decided to provide 128kB or 512kB SRAM for external memory space. However the memory needs A0-A18 for address lines. Since the RD2 chip can access only 64kB with A0-A15. So I added more address lines, A16-A19. This makes the RD2 can access 1MB external memory. Such address lines are borrowed from P1.0-P1.3. These lines are commonly known as page selector under software control. With 1MB space, I can also have more space for memory mapped i/o. Figure 3 shows the external memory map. The space from 00000H-7FFFFH is for SRAM with maximum capacity is 512kB. From 80000H to E0000H is for i/o devices. To access 1MB space, we need to write the 4-bit page selector to P10-P1.3 before we can access the corrected space!
Figure 3: 1MB external memory map.
I tied the ICL7109, 12-bit ADC converter to the RD2 memory bus directly. The chip enabled signals included *CE, *LBEN and *HBEN. The *CE signal activates when the address 8000xH is accessed. However low byte and high byte are selected by A0 and A1 respectively. The chip runs by external RC oscillator with 100k resistor and 50pF cap. The oscillation frequency is approx. 80kHz. This provides approx. 12.5 conversions/s. That is fast enough for DC slowly varying signals. If you need high CMRR for 60Hz rejection, you can use a low-cost xtal, 3.59MHz and modify the oscillator circuit for xtal from the datasheet. The reference voltage was set to 204.8mV, you may see the test point on the board, TP4 and TP5. These points are used to access by multimeter to check the reference voltage. Don't measure at the pin 39 and pin 36. Pin 39 is next to pin 40 which is +5V supply. If you short pin40 and pin 39 accidentally, the chip will be permanent destroyed!
Status pin (2) ties to INT0, when conversion completed, it generates active low pulse to interrupt RD2 chip. Study the firmware in interrupt function, see how the low and high byte are read and processed.
The MUX is 4052 differential analog multiplexer. Each channel was selected by 2-bit GPIO output port. The analog input range is +400.0mV.
16x1 Built-in LCD
The LCD also ties to the RD2 bus directly. The enable signal E which is activated for both Read and Write was generated by logical AND equation in PLD. A0 address line uses for selecting data and control register. A1 address line uses for selecting read or write mode.
The minilogger hardware provides general purpose i/o pins for both input and output port. The output port was made using 8-bit D-FF, 74HC573. The latch signal was derived from *WR and address enable signal at C0000H. The OE signal always ties to GND to enable the output line. Some i/o bits, were used to select MUX input. Five output bits are tied to JP4. The 8-bit input port was made with tristate buffer, 74LS244. Four bits were used for board setting keys and four bit are left for user at JP4. However, the current version of firmware does not provide the command to access these GPIO's line. You may develop your own commands.
After I implemented the decoder logic using PLD with 8051SBC, I also used it for the minilogger. It is very fun and easy to use PLD for memory and i/o decoder. Refer to Fig.3 for external memory map, only A17, A18 and A19 are needed to decode such space. The control signals for both read and write are *RD and *WR signals. Since A19 can use to select the RAM from address 00000H to 7FFFFH, so I tied it to *CS signal through the MAX691 for battery backup. When A19 becomes '1', or from address 80000H to FFFFFH, the memory space will be a memory mapped i/o space. The output of PLD chip, then provides only for ADC (80000H-80002H), LCD enable signal (A0000H-A0003H), 8-bit latch for output port (C0000H) and 8-bit tristate input port (E0000H).
Equation for PLD
Figure 4 shows the logic equation that accepts A17, A18, A19, *RD, *WR and produces enable signals for ADC, LCD, GPIO1 and GPIO2.
; MiniLogger V3.0 PLD Equation
; External memory and i/o decoder for Minilogger V3.0
; Wichit Sirichote, email@example.com
; June 6, 2003
; PLD: Lattice GAL16V8D
; * AND, + OR, / NOT
CHIP minilogger GAL16V8
a19=1 a18=8 a17=9 rd=2 wr=3 adc=12 lcd_e=13 gpio1=14 gpio2=15
adc = /a19 + a18 + a17 + rd
/lcd_e = rd * wr + /a19 + a18 + /a17
/gpio1 = /a19 + /a18 + a17 + wr
gpio2 = /a19 + /a18 + /a17 + rd
Note. * is logical AND, + is logical OR and / is logical NOT.
Figure 4: Logic equation for GAL16V8D.
The JEDEC file generated by the assembler is shown in Figure 5. The file is quite small and can be used to program GAL16V8D.
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Assembled from "D:\C52EVBV3\O\MINI3.EQN". Date: 6-7-103
NOTE PINS a19:1 rd:2 wr:3 a18:8 a17:9 adc:12 lcd_e:13 gpio1:14*
NOTE PINS gpio2:15*
NOTE GALMODE SMALL*
Figure 5: JEDEC file generated by PLD assembler.
The code memory of RD2 chip has 64kB, quite big for the minilogger project, but it allows the developer to add more function or commands. The current version was developed with Micro-C for 8051. Developers can study and modify the source code, or use another c compiler easily.
The firmware for minilogger V3.0 is as follows;
After power on reset, enter commands ? for help menu.
MiniLOGGER V3.0 (C) 2003 W.SIRICHOTE Dept.of Applied Physics KMITL
/ read once
t TIME set
d DATE set
c Clock display
s START/STOP recording time
= setting parameters
r number of record
b terminal connection
n New record
a ALL read: sample real-time and data
x Read All: sample and data
u About MiniLOGGER V3.0
The simple operation is MANUAL mode, use command s to set start/stop recording everyday to 99:99, 99:99, then the mode will change from AUTO to MANUAL. Try with commands i for interval between each sampling.
START 10:00 >99:99
STOP 04:80 >99:99
interval 1-600 sec > 10
SAMPLING INTERVAL(sec) = 10
Now move the jumper from stop to start position. The blink rate of LED will change from 1Hz to 1/3Hz.
Figure 6: Jumper for manual START/STOP.
We can check the number of record by command r, and use command a to read all records. The printout of all records are ASCII text format, so it can be captured using Capture text in Transfer menu of the hyperterminal. The captured text can be imported into Excel for graphing and data analysis.
32 records available
0 03-08-03 10:54:29 2866 2826 -1 3056
1 03-08-03 10:54:40 2972 2937 -1 3057
2 03-08-03 10:54:50 2884 2849 -2 3055
3 03-08-03 10:55:01 2878 2842 -2 3055
4 03-08-03 10:55:11 2877 2827 -1 3054
5 03-08-03 10:55:21 2875 2834 -1 3056
6 03-08-03 10:55:31 2878 2843 -2 3056
7 03-08-03 10:55:42 2880 2841 -2 3056
7 03-08-03 10:55:42 2880 2841 -2 3056
9 03-08-03 10:56:02 2886 2839 -1 3052
10 03-08-03 10:56:13 2885 2849 -2 3051
11 03-08-03 10:56:23 2883 2839 -2 3049
12 03-08-03 10:56:33 2882 2835 -1 3048
13 03-08-03 10:56:43 2880 2838 -1 3048
14 03-08-03 10:56:54 2874 2830 -1 3047
15 03-08-03 10:57:04 2874 2838 -1 3047
16 03-08-03 10:57:15 2872 2832 -2 3046
17 03-08-03 10:57:25 2869 2822 -1 3045
18 03-08-03 10:57:35 2871 2834 -1 3045
19 03-08-03 10:57:46 2871 2826 -1 3045
20 03-08-03 10:57:56 2866 2821 -1 3045
21 03-08-03 10:58:06 2863 2827 -1 3045
22 03-08-03 10:58:16 2868 2824 -1 3043
23 03-08-03 10:58:27 2866 2823 -1 3043
24 03-08-03 10:58:37 2865 2824 -2 3043
25 03-08-03 10:58:47 2861 2825 -2 3042
26 03-08-03 10:58:57 2864 2827 -1 3042
27 03-08-03 10:59:08 2864 2827 -1 3042
28 03-08-03 10:59:18 2860 2824 -2 3043
29 03-08-03 10:59:28 2856 2813 -1 3043
30 03-08-03 10:59:38 2850 2807 -2 3041
31 03-08-03 10:59:49 2845 2799 -1 3041
Figure 7 shows a sample of graphing with Excel, the sampling data can plot with time. Axis Y is output from LM35, temperature sensor, the reading is 24.00C for 240.0mV. We can compare the resolution between 10-bit ADC on minilogger V1.0 and a 12-bit ADC in minilogger V3.0.
Figure 7: Sample of graphing with Excel.
Figure 8 and 9 show the use of minilogger for daily insolation experiment. The total radiation was measured by a pyranometer shown in Figure 9. The output is about 5uV/Wm^2. The instrumentation DC amplifier, INA101 was used to amplify to provide 100uV/Wm^2 for minilogger ADC.
Figure 8: Minilogger was installed under PV frame.
Figure 9: 3kW single axis N-S follower for utility backup photovoltaic power system.
Schematic loggerV3.pdf Firmware Mini3.c
User's Manual (THAI)
Quick Start (ENGLISH)
PCB gerber files gerber OrCAD 9.1 MAX file NA OrCAD 9.1 Schematic and Netlist files NA Minilogger V3.0 BOM loggerv3.bom Equation and JEDEC file for GAL16V8D mini3.eqn
The problem on Auto mode was fixed. For now you can use Auto mode for a given period recording!. For example, you may set the start and stop time to 6:00 and 18:00. The record will be saved only that period.
Jun 17, 2004 : mini4.c mini4.hex minilcd.c
Sep 6, 2004 : mini4_1.c mini4_1.hex restore flag1 after power was recovered, suppose the power was failed while recording in AUTO mode, the minilogger will continue recording!
Nov 17, 2004: mini5.c mini5.hex use Manual Start/Stop as the external trigger read. The active low signal will reload interval value and start counting down, when time is over, the record will be saved.
DC Amplifier for Pyranometer Instrumentaion amplifer circuit for pyranometer!
April 22, 2005 : mini6.c mini6.hex display the reading value in mV unit. I have tied the negative input of channel1-4 to the GND for single-end input signal.
MiniLOGGER V3.3 (? help)
22-04-05 16:31:49 -15.2 999.9 999.9 54.8
0 22-04-05 16:20:43 -32.9 999.9 999.9 55.7
1 22-04-05 16:20:44 -31.1 999.9 999.9 54.3
2 22-04-05 16:20:45 -51.9 999.9 999.9 53.4
3 22-04-05 16:20:46 -43.7 999.9 999.9 53.5
Measuring room temperature with LM35
After firmware was modified, I tested the hardware with LM35. The circuit is simple, since the output of LM35 is 10mV/C. At the time of writing, my home (approx. 15 degrees north latitude) is very near to the Sun, April 22. The reading showed 358.8mV, I checked it with mercury thermometer. The temperature was 36C!
The reading on terminal also shows in mV unit.
MiniLOGGER V3.3 (? help)
22-04-05 16:47:04 0.5 0.5 0.0 358.8
Below graph shows recording of electronic temperature controlled by air-conditioning. Nice graph was made with Origin50.
You may have the +1.5V battery and simple voltage divider using 20 turns POT. I tested it on channel 2.
Recovered 17 December 2015