m. How to read PWM temperature from Velleman K6001 kit?

K6001 kit enables one to build a relatively accurate digital thermometer with the temperature range from - 40°C to +150°C provided that the sensor is connected on a long enough wires not to expose the other parts of the circuit to the extreme temperatures.

The K6001 circuit has the following PWM characteristics: At -40°C Impulse width is 2 ms (+/- 0,5 ms adjustable offset) and 40 ms (+/- 2.5 ms adjustable offset). The PWM modulated digital signal has the range between 0 V and +5V. If you are using PIC18F2xJ50 basic circuit, you may connect the signal directly to the 5 V tolerant pins which are marked gray (see original Microchip documentation for PIC18), or you may add a proper voltage reducer from 5 V to 3.3 V. The latter can be made of two resistors or a 10 k trimmer with appropriate setting. The trimmer is usually a better option since the voltage reduction may be more accurate.

You can also use Velleman K8055 or K8055N board with a PIC18F2xJ50, which has the advanced firmware 2.x from the Downloads section installed. It is recommendable to connect the K6001 output to A/D 0 pin, A/D 1 pin or I5 pin. You must select the correct RPx input at the initialization time. Read Frequency and impulse width measurement subsection for details on measuring pulse width.

Here is a photo of the basic PIC18F2xJ50 circuit with a 10 k trimmer that enables connecting 5 V signal line from the K6001 circuit (connect OUT on K6001 to RP0 in PIC18F2xJ50 and GND to GND):