In article Rotating office chair angular position and rotation speed measurement using gyroscope and ATmega16 we explained how to use gyroscope LISY300 and atmega16. If you are interesting how gyroscope works, read previous linked articles. In this article we will give you same project but reprogrammed for dsPIC30F4013. This is also example how to use Serial Peripheral Interface (SPI) module for dsPIC30F series of microcontrollers. More about basic SPI configuration and functions, read in article dsPIC30F4013 Serial Peripheral Interface (SPI) example.
More information about NDIR sensors are avaiable in article Non-Dispersive Infrared (NDIR) gas sensors. The IR gas sensor contains a lamp which is pulsed at low frequency by a lamp drive circuit. The pulses of infrared radiation reflect internally to provide a long path through the target gas. Pyroelectric detectors (pyros) are used to detect the change in infrared signal. The active pyro is sensitive to changes at IR wavelengths which are typically absorbed by the gas being detected. The reference pyro is sensitive to changes at a nearby IR wavelength which is not absorbed by the gas being detected.
It is well known that many gas molecules can absorb radiation in the infrared portion of the electromagnetic spectrum. When infrared radiation is incident on the gas, the energy states of atoms vibrating in the molecules change in discrete steps when the wavelength of the infrared matches the molecules natural frequencies or resonances. Put simply, the vibrations of atoms held in their chemical bonds increase when excited by light of the right wavelength.
The 12-bit Analog-to-Digital Converter (ADC) allows conversion of an analog input signal to a 12-bit digital number. This module is based on a Successive Approximation Register (SAR) architecture and provides a maximum sampling rate of 200 ksps. The A/D module has up to 16 analog inputs which are multiplexed into a sample and hold amplifier. The output of the sample and hold is the input into the converter which generates the result.