Sensor Interfaces

Sensor Description Resources
Pressure
Pressure Sensor
There are a lot of different format pressure sensors. Many need only a ADC on the PIC® MCU to read. For classroom use the air sensor referenced to the right is easy to use and hook up to various sources. The weight sensor requires an op-amp and it not all that accurate but otherwise easy to use with a PIC® MCU. The load cell is the gold standard for weight measurement. A PIC® ADC can be used but a higher resolution external ADC is usually used in the real world.
Temperature
Temperature Sensor
Using a thermistor in a voltage divider configuration connected to the PIC® ADC is cheep and easy. It will require firmware to calibrate the sensor and deal with the curve of the output. The LM34 is a calibrated semiconductor version of the thermistor. Digital sensors output I2C or SPI and are easy and accurate to use. Thermocouples are used for sensing temperatures over an extreme range (like fire and the north pole). They require an instrumentation amp before the PIC® MCU can read the voltage.
Humidity
Humidity Sensor
Many sensors output a frequency or PWM signal, some have an analog voltage or impedance change and you can also find I2C and SPI units.
Current
The most common sensor is a simple resistor (small) and the voltage drop is measured across the resistor. To reduce the impact to the circuit the resistors are small and sometimes that means an op-amp is needed to make the small voltage visible to the PIC® MCU. A second type better for larger and alternating currents measures the magnetic effect from a conductor.
Compass
Usually you get two analog signals out to figure out magnetic North.
Accelerometer
Accelerometer Sensor
Now popular in tablets so they know how you are holding them and in video games where hand held devices can determine speed and direction of movement. Output is 2 or 3 analog or digital signals to indicate acceleration in 2 or 3 planes. Many good software project possibilities here.
Ultrasonic Distance
Ultrasonic Distance Sensor
An ultrasonic transducer is used to send out a short burst (50khz or 125khz) and then the same transducer is used to listen for the resonance. The time to respond is the distance. Many good opportunities for algorithm development. A common fish finder transducer will work.
Optical Encoding
Various methods are used to identify the distance something moves. Frequently a simple plastic wheel on a motor shaft with slots can be used to determine the amount the motor moves. One slot larger than the others can be used as a double check to be sure a slot was not missed. Two optical sensors can be used to also determine direction. The optical sensors are usually a digital input to the PIC® MCU. Programming challenges involve timing the pulses to determine distance and speed. Some applications only care about speed.
  • Development Kits
    • Not yet available but in the works, contact CCS for status.
  • Example Code
    • EX_ENCODE.c

Sensors Explorer Kit
The sensors shown in the image below are included in the Sensors Explorer Kit. Scroll up to see the table for more information about various sensors.

Sensors