MOBILE HOME Technical Tips  

SELF POWERED ADC INTERFACE TO PARALLEL PORT

Project for connecting analogue signal to LPT printer port. Included Visual Basic 6 software and a circuit diagram. The MCP3201 is a micro-power 12 bit analogue to digital converter. The conversion selector selects the MSB when it sets to 8 Bit or 10 Bit and ignores the rest of the bits. With less resolution the reading is more stable. The supply to the circuit is via the 5V at pins that are switched to logic high by the software.
The VB6 software includes a freeware DLL from http://logix4u.net/ ,keep the .dll file and the .exe file in the same folder.
Datasheet for the MCP3201 can be downloaded from http://ww1.microchip.com/downloads/en/DeviceDoc/21290D.pdf
VB6 code (30KB). You are free to use the circuit diagram and the VB software with no limitations.

The VB6 application is a combined digital and analogue voltmeter.

Circuit Description
See also Technical Tips

MCP3201
Input at pin 2 of the ADC is 0 to 2.5 volts full range positive voltage only. The chip over voltage protection is 5V max.
Pin 8 is the supply to the IC and it is about 3.2 V.
Pin 1 is reference voltage for the ADC and cannot be changed because it regulates the supply to the IC.
Pin 6 is the serial data out of the ADC, BC237 is a TTL level drive.
Pin 7 is the clock for reading the data, 100pF is for filtering crosstalk from the cable.
Pin 5 is the Chip Select.
100R resistors and diodes on these lines are for clipping the voltage to the Vcc of the IC.

LPT plug
Pins 23,34,25 are earth. Pins 1,11,14 are inputs and outputs used for reading the ADC data. Pins 8,9 are switched to 5 V ,output high, by the software and are used for powering the circuit.





Name:

Comments and questions

Copy the number from the picture It stops net-robots from adding comments.



24.05.2015 - 15:56
Name: Ram
Comment: very clean, i like this idea, Thank you very much!!!

16.12.2010 - 14:15
Name:
Comment:

Name: Jeff
Comment: I just found your circuit and software really interesting as I'm just learning these types of projects. Would you have the time to document the lines of vb code for me because I really dont understand what the heck is going on "I'm lost".I am trying to construct a 12v car battery voltmeter for home use. Any help would be appreciated more that you know. Thanks Jeff

Name: Moty
Comment: Hi Jeff I've added comments to the VB code, download it again please, hope it helps. I used simple math but it is always a straggle to follow other people's way of thinking. The project is intended for using your computer to measure voltage. If you wish to measure voltages over 2.5V you need a voltage divider at the analogue input of the ADC. For example a resistor of 10K from input to earth and a second resistor of 100K from input to the measured voltage will give you a measuring range of 27.5V. When you change the value of 2.5 to 27.5 in the VB code the meters will read full scale of 27.5V Good luck, If you need more help don't hesitate to ask.

Name: Jeff
Comment: Moty, Thanks for the help you made my day.I ordered the parts to construct the circuit today but there are a few things I still dont understand within the software. The command "If GetPortBit(889, 7) = True" confuses me. As far as I can tell you are reading pins 10,11 and 12 of the status port where 889 is the status port address and 7 in binary is "111" but you are only using pin 11 in the circuit. Could you explain what is really going on? I also understand the next command mathematically "bit = 2 ^ bitcount" , but why do we need it, why do you have to square the bitcount? can you please help? I have another question, but lets save it for later. Thanks Again, Jeff

Name: Jeff
Comment: Moty, Thanks for the help you made my day.I ordered the parts to construct the circuit today but there are a few things I still dont understand within the software. The command "If GetPortBit(889, 7) = True" confuses me. As far as I can tell you are reading pins 10,11 and 12 of the status port where 889 is the status port address and 7 in binary is "111" but you are only using pin 11 in the circuit. Could you explain what is really going on? I also understand the next command mathematically "bit = 2 ^ bitcount" , but why do we need it, why do you have to square the bitcount? can you please help? I have another question, but lets save it for later. Thanks Again, Jeff

Name: Moty
Comment: You are welcome, Jeff. Function GetPortBit(889, 7) reads decimal port 889 (status register) 7th bit at pin 11 of the LPT. This pin has the data from the ADC. bit = 2 ^ bitcount converts binary number into decimal. The LSB (least significant bit) + second bit * 2 + third bit *2 ^ 2 + forth bit * 2 ^ 3, and so on.

Name: Jeff
Comment: Moty, Good Day, and thanks again. I have some questions about the circuit itself and I was wondering if it would be alright to e-mail you an Excel file that is marked up with my questions.I think it would be an easy way to find out what I need and only use a minimal amount of your time. If this is o.k. then send me an e-mail and I'll reply so you dont have to put your e-mail out for everybody to see.

Name: Gokkul
Comment: Thanks man :-0