PIC Projects
OBDII Tacho, Diagnostic app
TFT Clock and Thermometer
WiFi, Ethernet
Doorbell with SD / EEPROM
SD FAT16/32 for .bmp
TFT Timer
TFT Oscilloscope
SD Talking Clock
SD Sound Recorder,
    FAT32 wav Player
LED Thermometer
LED Timer
LCD Timer

Frequency Counters
100KHz For PC
1MHz For PC
8 Digits LED 50 MHz
Scope Screen Display
LCD Module 10MHz
6MHz for Android
USB PIC18F2550
USB TFT display BMP
USB DS18B20 Sensor
USB Thermometer
USB Counter
USB Meter
USB Oscilloscope
USB Input-Output
USB 16x2 LCD

COM Ports
Serial TFT Text
Serial Inputs Outputs
Serial Port LCD
MCP3201 on Serial Port
Serial Thermometer
Analogue Signal to Serial
Serial Thermostat

MCP3201 on LPT
Analogue Signal to LPT
LCD Display on LPT
Water Softener
HP Stream 7 docking
3.7V to 5V
Solar Charger

Infrared Decoder
PIC Music

Code Lock
Code Lock with LCD
HOME MOBILE Technical Tips


USB thermometer DS18B20 temperature sensor. Included Visual Basic 6 software, Visual Studio 2005 C# code, PIC C code and a circuit diagram. The PIC interface to the PC is HID class.
The DS18B20 sensor has a range of -55 to 125 centigrade in accuracy of 0.5 degree and resolution of 9 to 12 bits. The interface to the pic is via one digital line, the 1 and 0 is determined by pulse duration. The code includes the commands to read temperature and set the resolution.
HID class (human interface device) is a class of devices like the mouse and the keyboard, the data transfer rate is limited to 64KB/S. The PC already has a driver for HID USB.
C# code is modified Microchip code from the USB framework, Microchip Solutions v2012-04-03.
VB6 code includes guidance to setting up the PC. The PC register the PID (Product ID) and VID (Vendor ID) of the USB device when it's plugged, the VB code uses these ID's to communicate with the device. For commercial VID it is needed to buy it from USB-IF, but in your lab you can use any number.
The source code is derived from freeware from these sources: http://janaxelson.com/usb.htm , http://openprog.altervista.org/USB_firm_eng.html
You are free to use the circuit diagram and the VB software with no limitations.

The C# and the VB6 applications are a combined digital and graphic thermometer.

Circuit Description
See also Technical Tips

Pin 14 is 3.3V internal supply for the USB transceiver.
Pins 15,16 are the data lines to the USB connector on the PC.
Pin 20 is the PC 5V powering the PIC. It is limited to 100mA by the PC. 0.47uF is for decoupling.
For USB wiring info: http://www.interfacebus.com/Design_Connector_USB.html

Any type of case can be used.


Comments and questions

Copy the number from the picture It stops net-robots from adding comments.

15.02.2019 - 19:48
Name: Dusajn
Comment: Excelent job, work in first plug :-)

08.02.2017 - 15:30
Name: Diego Zaldívar
Comment: mas que interesante, útil, saludos Diego.

26.01.2017 - 23:08
Name: Moty
Comment: De nada, Erasmo.

26.01.2017 - 20:14
Name: erasmo ayala yañez
Comment: muy buena informacion. gracias

06.02.2016 - 17:38
Name: khe
Comment: ok