Data Logger with Serial Interface

31,237

Circuit Image

The data logger comprises a basic operational amplifier (op-amp) circuit that amplifies the input signal and transmits it to a PIC16F688 microcontroller for digitization, serialization, and subsequent transmission to a computer's serial port through a MAX232 serial driver. Some unusual configurations in the analog section of the schematic diagram arise from the voltage differences between the analog and digital components: the op-amps operate at 12V, while the microcontroller and serial driver function at 5V. Additionally, these configurations facilitate the connection of various sensors. The input IN1 is a direct current (DC) input with a voltage range of 1-11V, where the applied voltage is directly fed into the amplifier. It is advisable to center the voltage around the 6V point for optimal performance. Input IN2 is an alternating current (AC) input with a self-centering range of ±5V, with a trimmer potentiometer (R1) connected to this input to center the signal at 6V when the sensor signal remains stable. Input selection is accomplished by shorting the JP1 jumper, which can be manually switched or integrated into the connectors for the sensors. An optional amplifier (OP2) is located in the lower section of the diagram, which is beneficial for sensors based on a voltage divider; it is most effective when the voltage is split near the midpoint. For instance, in a resistor/photoresistor bridge, if the photoresistor has a resistance of 10k, a corresponding 10k resistor will yield a stronger signal. The trimmer potentiometer (R10) is used to set the desired center point, and LED1 indicates when the center point is crossed, aiding in sensor adjustment. Amplification is regulated by adjusting R4; higher values for this potentiometer will increase amplification but may introduce more noise. The output from OP1 is directed to the microcontroller through a voltage divider formed by resistors R5, R6, and R7, ensuring that the signal sent to the analog input AN4 does not exceed 5V. Prior to connecting the microcontroller, R6 should be adjusted so that when OP1's output reaches its maximum range, the voltage from R1 remains just below 5V. The PIC16F688 microcontroller digitizes the signal from AN4, applies checksum information, and transmits the serialized data at a rate of 1200 bps to the MAX232 serial driver. Following this, a serial cable can be connected to the computer to run the logger script (logger.pl) for data recording.

The data logger circuit is designed to provide a reliable means of signal amplification and digitization, allowing for the integration of various sensor types. The use of dual voltage levels (12V for the op-amps and 5V for the digital components) is critical in ensuring compatibility and functionality across different parts of the system. The choice of the PIC16F688 microcontroller is appropriate due to its capabilities in processing analog signals and communicating via serial protocols.

The operational amplifier (op-amp) configuration is pivotal in ensuring that the input signals are adequately amplified before reaching the microcontroller. The selection of trimmer potentiometers (R1 and R10) allows for fine-tuning of the signal levels, which is essential for maintaining accuracy in sensor readings. The LED indicator (LED1) serves not only as a visual feedback mechanism but also assists in the calibration process by providing real-time information on signal levels.

The voltage divider network formed by resistors R5, R6, and R7 is a critical safety feature that protects the microcontroller from over-voltage conditions, thereby enhancing the longevity and reliability of the circuit. The overall design emphasizes flexibility and user-friendliness, allowing for easy integration of various sensors and straightforward adjustments to accommodate different operational conditions. The serial communication facilitated by the MAX232 driver ensures that the digitized data can be easily transmitted and logged on a computer, making this data logger a versatile tool for various applications in data acquisition and monitoring systems.The data logger consists of a simple op-amp amplifier circuit that amplifies the signal and sends it to be digitized by a PIC16F688 microcontroller, serialized, and sent to the computer`s serial port via a MAX232 serial driver: I guess you are already wondering about some of the unusual arrangmenents in the analog part in the schematic diagram abo ve. Part of it is because of the voltage differences between the analog and digital part: the op-amps work on 12V while the microcontroller and the serial driver require 5V. Part of it is to make the different kind of sensors I plan to use easier to connect. Finally, this is partly because I`m really lazy and when I got the things to work to my satisfaction I refused to change anything.

The point is - unusual or not, it works. IN1 is a DC-input with a range of 1-11V. Whatever voltage is applied to IN1 is directly passed to the amplifier. Try to keep the voltage centered around the 6V point for best results. IN2 is an AC (self-centering) input with a range of ±5V. The trimmer potentiometer R1 connected to this input centers the signal at 6V when the sensor signal is not changing. Switching between inputs is done by shorting the JP1 jumper. You can either use a switch there and do this manually, or wire JP1 into the connectors you use to plug-in your sensors (which is the way I did it).

Before finishing with the input part, notice the optional amplifier OP2 in the lower part of the diagram. Some sensors based on a voltage divider work best when the voltage is split close to the half point - in other words, if you have a resistor/photoresistor bridge and in the particular conditions the photoresistor has 10k resistance, the signal will be stronger if the other resistor in the bridge is also around 10k.

Use the trimmer potentiometer R10 to set the desired center point. Afterwards, LED1 will switch on and off when the center point is crossed, helping you adjust your sensor correspondingly. Amplification is controlled by adjusting R4. If you wish, you can use a higher value for this potentiometer - this will give you higher amplification, but at the cost of more noise.

The output from OP1 is passed to the microcontroller through the voltage divider composed of R5, R6, and R7. The voltage divider is here to assure that the signal passed to the analog input AN4 never goes above 5V.

Before plugging in the microcontroller, adjust R6 so when the output from OP1 is at it`s top range, the voltage out of R1 is just below 5V. The PIC16F688 microcontroller digitizes the signal from AN4, applies checksum information and passes the serialized data at 1200 bps to the MAX232 serial driver.

From there, it`s just a matter of plugging a serial cable in your computer and running the logger script logger. pl to record the data. 🔗 External reference