Академический Документы
Профессиональный Документы
Культура Документы
H I GH S PEE D PC
I NTE RFAC E
ATHARVA INAMDAR
CANDIDATE NO# 0088
CENTRE NO# 52103
AYLESBURY GRAMMAR SCHOOL
2
TABLE OF CONTENTS
SUMMARY .................................................................................................................................................................... 3
BRIEF ............................................................................................................................................................................. 4
SPECIFICATION .......................................................................................................................................................... 4
BLOCK DIAGRAM....................................................................................................................................................... 4
EQUIPMENT ................................................................................................................................................................. 5
SYSTEMS ....................................................................................................................................................................... 6
ANALOGUE-TO-DIGITAL CONVERTER (ADC) ................................................................................................................. 6
Subsystem 1: Clock ................................................................................................................................................... 6
Subsystem 2: Counter ............................................................................................................................................... 8
Subsystem 3: Digital-to-Analogue converter (dac) ................................................................................................. 10
PARALLEL-TO-SERIAL CONVERTER ............................................................................................................................. 12
subsystem 4: Parallel-to-serial converter (piso)..................................................................................................... 12
DATA STORAGE AND TRANSMISSION........................................................................................................................... 14
subsystem 5: Sensor Data storage and transmission .............................................................................................. 14
DATA OUTPUT ............................................................................................................................................................ 16
subsystem 6: user interface ..................................................................................................................................... 16
END RESULT .............................................................................................................................................................. 18
CIRCUIT DIAGRAM ...................................................................................................................................................... 18
FULLY FUNCTIONAL BREADBOARD PHOTO: ................................................................................................................ 19
REVIEW AND EVALUATION .................................................................................................................................. 20
BIBLIOGRAPHY ........................................................................................................................................................ 21
ACKNOWLEDGEMENTS ......................................................................................................................................... 21
APPENDIX I................................................................................................................................................................. 22
APPENDIX 2: ............................................................................................................................................................... 23
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
3
S U M M A RY
I set out to design and build a data logging system for an analogue input. This system would consist of an
analogue to digital converter and a microprocessor to store data on an EEPROM and communicate with a PC. At
the end of this project, I have achieved all of the above. However, the data stored is raw data and is not calibrated.
It is intended that the user calibrated this data logger to their specific sensor. I have successfully met all the
specification points.
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
4
BR I E F
In schools sometimes it is necessary for pupils to record data at specific intervals for a long period of time such as, in a
Physics experiment recording the time. I will be developing a Data logger, which will be able to communicate with a PC
using a high-speed interface.
SPECIFICATION
Data Logger
o One Analogue input
E.g. Thermistor
8-bit resolution
o Store data for Analogue input
o Display data stored in PIC memory (buffer) or an EEPROM depending on user‟s need of data retention
Data from PIC memory buffer will be transmitted in real-time to the PC
o Record data at a frequency of 1Hz
PC interface
o Serial interface with PC
o Transmit data stored in the EEPROM using Serial or USB connection
To be used with applications such as HyperTerminal
Communication uses 4800bits/s with no parity and 1 stop bit
BL O C K D I A G R A M
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
5
EQUIPMENT
Multimeter
PC with RS232 port
Set of coloured wires
o Red: positive power supply
o Green: 8 bit data connection
o Yellow: Interconnect subsystems
o Blue: Serial Comms with PC
o Brown: Clock
o Orange: general connections
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
6
SY STEMS
SUBSYSTEM 1: CLOCK
Advantages Disadvantages
Crystal Oscillator Accurate, clean and stable Difficult to buy a 4kHz crystal.
waveform
A relaxation oscillator is sufficient for the needs of this data-logger. It is a cheap solution which has no major
disadvantages over a Crystal oscillator.
Circuit Diagram:
Component Values:
Capacitor: 1nF; Resistor: 35k
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
7
Testing:
Testing was conducted using a frequency meter. The output was a stable frequency of 4kHz.
Photos:
40106B Hex
Schmitt
Trigger
Variable
1nF ceramic resistor
capacitor 35k
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
8
SUBSYSTEM 2: COUNTER
Advantages Disadvantages
Small footprint
S-R Flip Flop (setup as T-type) Are building blocks of a digital No advantage over using 4029B IC
binary counter
Footprint is extremely large for
consideration of practical or even
prototype application (Eight ICs
needed)
4029B is a dedicated counter IC and is the best solution for a data-logger. Using S-R flip-flops set up as T-Type
increases the footprint and performs the same function.
Circuit Diagram:
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
9
Component Values:
P1-P4, LD, EN are all connected to 0V. Clock for both counters is connected to the output of subsystem 1. U/D AND
B/D is connected to +5V to count UP. Carry from counter #1 is connected to Enable of counter #2.
Testing:
Testing was done using 8 LEDs connected to the outputs. The clock pulses were provided by using a push-to-make switch
connected between the clock pin and +5V rail. The order of LEDs lighting up was checked. (see photo below showing
153rd stage 10011001).
Photos:
4029B
Binary up
counter
Green LEDs
for 1st
counter IC
Red LEDs
for 2nd
counter IC
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
10
Specifications: Convert a 8-bit parallel word into and analogue output of corresponding value in real time
Advantages Disadvantages
A summing Amplifier was chosen as it can provide a large voltage output range and can be controlled. The
output provided is an accurate representation of the Digital 8-bit word. PICAXE-28X is too expensive for such an
application.
Circuit Diagram:
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
11
Component Values:
Input Resistors: 1kΩ, 2kΩ, 4kΩ, 8kΩ, 16kΩ, 32kΩ, 64kΩ. 128kΩ
o These values are chosen to keep the current drawn minimal
Op-amp(summing amp): feedback resistor: 502 , input resistance = 1.5T , output resistance = 60
Inverting amplifier: gain = -1, input resistor = 1k , feedback resistor = 1 , input resistance = 1.5T , output
resistance = 60
Testing:
This was tested using a voltmeter on the output of the Summing amplifier. As the counter counted up the voltage was seen
to rise steadily
Problems:
Summing amplifier was saturating to 13V. the gain was decreased by using a 502 feedback resistor
Photos:
CA3140E
Feedback
resistors
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
12
PARALLEL-TO-SERIAL CONVERTER
Specifications: To convert a 8-bit parallel word to a serial stream including 1 start and 1 stop bit
Advantages Disadvantages
4014B 8 stage Shift Register Dedicated shift register for Start and stop bits are not included
conversion of a 8-bit parallel word in the serial data stream
to a serial stream
Very difficult to add a start/stop
Can output as 6/7/8 bits serially bit to the stream
PICAXE-28A was the only alternative, which can add a start and stop bit to a data stream while acting as an 8-
stage shift register. The dedicated 4014B shift Register was not able to add start and stop bits to the data stream.
Circuit Diagram:
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
13
Component Values:
8bit inputs are connected directly to the inputs of the PICAXE-28X
4k7 pull up resistor is used for the reset pin
Impedance (PIC):
o Input: 2M minimum at 4.5V VCC.
o Output: 233 when Output state = 1; 71 when output state = 0
Testing:
By programming a PICAXE-18X to display the value of the serial number on a LCD. The input to the PICAXE-28X was
manually held high or low and the output was compared with the input. This functioned as desired.
Photos:
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
14
Specifications: To write a 8-bit word into EEPROM and read data to transmit to PC using a serial link of the
following format: 4800-8-n-1
Advantages Disadvantages
I2C EEPROM (24C64WP) Permanent data storage Slow read and write times
I2C RAM Fast read and write times Only temporary data storage
EEPROM was selected due to its ability of retaining the data on power down and thus is useful in the situation of
remote data collection.
Circuit Diagram:
Component Values:
4k7 pulled resistor for the reset pin on the PICAXE
Clock and data are synchronised through SLA and SDC pins on the PICAXE with same pins on the RAM.
o Pull-up resistors (10kΩ) on SDA & SCL
Connection from PICAXE-28A is direct without any need for discrete components.
EEPROM write control impedance > 500kΩ
o SDA & SCL i/p, o/p impedance = 4k7Ω (set by pull up resistors on line
Impedance (PIC):
o Input: 2M minimum at 4.5V VCC.
o Output: 233 when Output state = 1; 71 when output state = 0
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
15
How a PICAXE-18X is used to store data in I 2C EEPROM and transmit it to the PC:
A digital number transmitted by the shift register serially is read by the PICAXE. This is stored in the accumulator and
using the I2C protocol transferred to the RAM. The RAM stores this raw number (in binary) starting from its first memory
location (00h). Program attached in Appendix 1.
Testing:
A program was written in PIC BASIC and was simulated. The simulation was successful on a PC and was then tested using
PICAXE-18X on a breadboard. The display was first tested by severing the input and connections with the EEPROM. As
the photo below shows the display was functioning as desired.
Problems:
During the first testing stage with a PICAXE it was found that whenever a command to write to the LCD was sent the
previous display was not cleared, thus ghosting was occurring for unused matrices at the end of the string. This was
corrected by a simple clear screen command (serout 7,N2400,(254,1)). Initially, 100 F capacitor was used for decoupling; it
was found that the charge up and down times were too long so a 1nF capacitor was used.
Photos:
LCD Display
16x2
PCAXE-18X
Decoupling
Capacitor 1nF
Write Control
I2C
EEPROM
SDA/SCL 64Kbits
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
16
DATA OUTPUT
Specifications: to display a menu and current task being carried out. If data is being recorded, the raw data value should
also be displayed.
Advantages Disadvantages
LED matrix Can customise to any matrix size Need a custom driver board
possible
Extremely low resolution
Range of colours for LEDs
Extremely high power
consumption
LCD screen is the only practical alternative as it is dedicated display unit with built in driver circuit.
Component Values:
Impedance:
o Input: 2M minimum at 4.5V VCC.
o Output: 233 when Output state = 1; 71 when output state = 0
Testing:
A simple program was written to display the message “Hello World!” and tested.
********
pause 10
main: serout 7,N2400, (254,128,”Hello World!”)
serout 7, N2400, (254,192, “Hello World!”)
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
17
goto main
********
This program functioned as desired and the LCD was displaying all the characters correctly.
Photos:
(see previous subsystem photo)
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
18
E N D R E S U LT
CIRCUIT DIAGRAM
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
19
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
20
R E V I E W A N D E VA L UA T I O N
Data logger at the start displays first message after the delay of the one-second. This delay is may be due to initial charging
of the coupling capacitors, which are across the LCD power supply. “GO” switch is to initiate the analogue to digital
conversion. At the press of “Go” 8bit digital signal is converted into serial stream with start and stop bits. When "Record"
is toggled, the current data point and its value, which is being stored in EEPROM is displayed and the data is also sent to
PC at the same time. The display returns to menu again on toggling “Record”. Pressing "Send to PC", transmitted data
from EEPROM to the PC. During this function data is read from location 0 till the last point it was recorded. On the press
of ERASE EEPROM, data values at all location are be replaced by zero.
Photos:
The following shows photos of me operating the Data logger:
Recording Data: Erase EEPROM: Data sent to PC:
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
21
BIBLIOGRAPHY
ACKNOWLEDGEMENTS
Mr. M Harvey
PICAXE.com forum members
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
22
APPENDIX I
'Start low 0
'pin2 = input gosub clr_scn
'pin0 = record serout 7, N2400, (254,128, " MEMORY FULL!
'pin1 = erase mem ")
'pin7 = serial send data to PC serout 7, N2400, (254,192, " :( ")
'pin6 = read from mem button wait 5
'output 0 = record for tristate (write-protect) gosub clr_scn
'serout for LCD and PC goto main
'b2 = erase ram flag „read from mem
'b3 = data to send to PC mem_pc:
pause 50 gosub clr_scn
init: let b0 =0 serout 7, N2400, (254,128, "Send data to PC?")
high 0 serout 7, N2400, (254,192, " ")
serout 7, N2400, (254,1) if pin7 = 1 then
main: sertxd (13,10,"Recieving Data...",13,10, "No#
serout 7, N2400, (254,128,"Record Data? ") Data",13,10)
serout 7, N2400, (254,192,"Send to PC? ") serout 7, N2400, (254,128, "Sending Data")
if pin0 = 1 then record serout 7, N2400, (254,192, "Do NOT
if pin7 = 1 then mem_PC Disconnect")
if pin1 = 1 then erase_mem for b0 = 0 to 184 step 1
goto main i2cslave %10100001, i2cfast8, i2cword
clr_scn: readi2c b0,(b3)
serout 7, N2400, (254,1) sertxd (#b0, " ", #b3,13,10)
return next b0
record: sertxd ("Data Recieved Successfully")
if b0 = 185 then elseif pin7=0 then
let b0 = 0 goto mem_pc
endif endif
gosub clr_scn gosub clr_scn
low 0 serout 7, N2400, (254,128, "Data sent!")
sertxd ("No# Data", 13,10) serout 7, N2400, (254,192, " ")
for b0 = b0 to 185 step 1 wait 1
if pin0 = 1 then goto main
if b0 = 185 then mem_error
'let b1 = pin2 erase_mem:
i2cslave %10100001, i2cfast8, i2cword serout 7, N2400, (254,128,"Mem Full! DEL?")
serin 2,4800,b1 serout 7, N2400, (254,192,"Press Record")
serout 7, N2400, (254,128,#b0,"= ", #b1, " ") pause 2000
serout 7, N2400, (254,192,"Recording... ") gosub clr_scn
writei2c b0, (b1) if pin1 = 1 then
sertxd (#b0, " ", #b1,13,10) low 0
pause 990 b1 = 0
elseif pin0 = 0 then for b0 = 0 to 185 step 1
high 0 serout 7,N2400,(254,128,"Erasing MEM")
goto main serout 7, N2400, (254,192, "Do NOT Power Off")
endif writei2c b0, (0)
next b0 next b0
goto main let b0 = 0
mem_error: Endif
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531
23
APPENDIX 2:
'Start of program
pause 10
main:
'collect each bit in seperate variables
let b0 = pins & %1111111
'shift each bit through serout pin 4800-8-n-1 with start and stop bits
sertxd (b0)
wait 1
goto main 'loop
'End of program
Atharva Inamdar Candidate no# 0088 Centre no# 52103 Unit 2531