Interfacing MSP430 to analog AC-rated humitidy resistive sensor HCZ-H8

26,030

Circuit Image

If a sensor is resistive, an alternating current (AC) is equivalent to pulsed direct current (DC), and the sensor will degrade based on the root mean square (RMS) value of the AC signal. Applying 1V AC RMS is effectively the same as applying 1V DC. In the case of using an ADC10 or ADC12, samples are taken sequentially (most devices with an SD16 only support simultaneous sampling for energy metering). When sampling sequentially and calculating the time shift, it is possible to sample the result directly since the input signal is generated by a digital-to-analog converter (DAC), and the input voltage is known (provided calibration is done). For resistive sensors, a different approach is recommended: establish a small constant current source that can be controlled by a microcontroller (MSP) port pin. The current source should be activated every millisecond to sample the voltage across the sensor, then turned off to prevent sensor heating. If the current source drives 1mA through the sensor and the voltage reading is 1V, then the sensor resistance is calculated to be 1kΩ. It is assumed that the calibration table accounts for sensor heating due to the measuring voltage, but only for a specific environmental temperature. To simulate this, the power applied to the sensor under the calibration conditions should be calculated, and a constant current that results in the same power dissipation should be used. The readings should match under these conditions. The current source does not need to be turned on and off continuously (except for power-saving purposes, although initial readings after reactivation may be inaccurate), making the process simpler: read the voltage and convert it to a temperature using a lookup table. Quick scans of the documentation are recommended before reporting bugs or seeking help, as this applies to any issue reporting on forums. If a private discussion is necessary, users can initiate a conversation by clicking on the name of the person they wish to contact, but this should be reserved for situations where public discussion is not feasible. The potential for a resistive sensor to become polarized may arise from electrochemical factors, such as the separation of water molecules into hydrogen and oxygen, leading to an uneven distribution on the electrodes when a DC component is applied. It is believed that applying 1mA of DC periodically to the sensor will not cause significant degradation, as it will self-depolarize during inactivity. Alternatively, inverted pulses can be applied. However, supplying AC power requires generating a negative voltage (the DAC typically only produces positive voltages relative to the MSP ground) or utilizing a virtual ground that maintains a stable voltage within the measurement range, which consumes power. Generating a sinusoidal waveform of fixed frequency using a DAC can be complex. Instead of maintaining a sinusoidal waveform, applying a voltage and measuring the response directly is more straightforward, as the applied voltage is already known. Calibration concerns may arise when sampling from different input channels, as discrepancies in calibration between channels could impact results. When applying a current pulse, there is ample time to take two samples until the pulse concludes, but obtaining a second sample can be challenging since only one voltage can be sampled when a current is applied.

A comprehensive electronic schematic for the described circuit would consist of a resistive sensor, a microcontroller (MSP), a digital-to-analog converter (DAC), an analog-to-digital converter (ADC), and a constant current source. The resistive sensor will be connected to the current source, which is controlled by the MSP port pin. The current source can be implemented using a transistor or an operational amplifier configured to provide a constant current output. A timing circuit, possibly utilizing a timer interrupt or a direct memory access (DMA) transfer, will allow for precise control of the sampling intervals, ensuring that the current is applied for a specified duration before being turned off.

The DAC will generate the necessary voltage signals for testing and calibration purposes, while the ADC will be used to capture the voltage across the sensor during sampling. A calibration table stored in the microcontroller's memory will facilitate the conversion of voltage readings to temperature values. The circuit should also include necessary protection components, such as diodes to prevent reverse polarity and capacitors to filter out noise.

Power supply considerations are essential, as the circuit may require a stable voltage reference for accurate measurements. The design may also incorporate a feedback mechanism to adjust the current source based on real-time readings, ensuring consistent performance across varying environmental conditions. This comprehensive approach will allow for accurate and efficient measurements from resistive sensors while minimizing potential degradation and ensuring reliability in data acquisition.Hmmm, if it is resistive, AC is equivalent to pulsed DC and the sensor is degraded in any case with the RMS value of the AC signal. If you appy 1VAC RMS, you could as well apply 1V DC. If you use an ADC10 or ADC12, the samples are take one after another (also for most devices with an SD16, only the devices for energy metering support simultaneous

sampling). And if you`re already samling one after another and have to calculate the time shift, you can as well just sample the result, as it was you who created the input signal with the DAC, so you KNOW the input voltage (calibration provided). For resistive sensors, however, I would go a different approach: set up a small constant current source that can be switched on and off by an MSP port pin.

Every millisecond switch it on, take a sample of the resulting voltage across the sensor, then switch it off again, to avoid sensor heating. if your current source forces 1mA through the sensor and the voltage reading is 1V then the sensor resistance is 1kOhm.

I guess the calibration table takes the sensor heating caused by the measuring voltage into account. but only for a given environment temperature. To simulate it, calculate the power applied to the sensor under the the conditions of the calibration table, and apply a constant current that causes the same power loss on the sensor. The readings should be equal. Then the current source does not need to be switche on and off (except to save power, but then the first readings after turnign it on again will be inaccurate) and things are even easier: read teh voltage and convert it into a temperature by a table.

Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here. If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then `start conversation`. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too. Okay, that`s a possibility. I don`t know why a resistive sensor might become polarized, but it might have electrochemical reasons (e.

g. the water molecules being separated to H and O2, and for a DC compoenent this will give an uneven distribution of the two on the electrodes- if there is such a thing). I think that in your approach 1mA of DC periodically applied to the sensor will not degrade it too much as it will self depolarize during the period of inactivity.

Or you can apply inverted pulses. However, AC power supply reauires either a negative voltage somehow generated (the DAC will only generate positive voltages relative the MSp GND) or the device provided with a virtual ground that is effectively a stabilized voltage hovering in the middle of the measurement range. This consumes power. IIRC, Ithis remark was referring to the setup with a DAC generated waveform. It`s noteasy to generate a sinusodial wave generation of a fixed frequency if you set a value and then sample it and then set the next, in this order.

(this would rather be done with a timer interupt that controls the DAC output, or a timed DMA transfer), but I on`t think it`s necessary to keep a sinusodial waveform and timing at all. But then, if you just apply a voltage and then measure, you already know the voltage you applied. You only need to sample the result. If you worry about possible calibration issues: sampling two voltages would be from two different input channels, and calibrations differences between the two channels would affect your result too.

If you apply the current pulse, then of course you have all the time until the pulse ends (which you control) to take the two samples. But where to get the second sample from You do not apply a voltage, you apply a current. So there is only one voltage to be sampled: the 🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713