Android Oscilloscope
OBD2 Engine Rev Counter
OBD2 Diagnostic app
TFT Clock and Thermometer
WiFi, Ethernet
WiFi Thermometer
WiFi ESP8266
Doorbell with SD / EEPROM
SD FAT16/32 for .bmp
PETIT FAT bmp Display
TFT Timer, Thermometer
TFT Oscilloscope
SD Talking Clock
Android Talking Clock
SD Sound Recorder
SD FAT32 wav Player
SD Arduino Recorder
LED Thermometer
LED Timer
LCD Timer
TFT 10MHz Counter
100KHz Counter For PC
1MHz Counter For PC
8 Digits LED Counter
Scope Screen Counter
LCD Module Counter
LCD Arduino Counter
6MHz Android Counter
NIXIE Android Counter
Bluetooth Counters
USB Counter
USB TFT display BMP
USB DS18B20 Sensor
USB Thermometer
USB Meter
USB Oscilloscope
USB Input-Output
USB Input-Output Android
USB 16x2 LCD
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   Technical Tips


Compiling and Programming
The PIC12 and PIC16 projects are compiled with HI-TECH C compiler or XC8. PIC18 projects are compiled with MICROCHIP C18 compiler ver. 3.30 or 3.43 or XC8. MPLAB8.x or MPLAB X are used.

PIC16F628A: Programming pic16f628 with PICKIT2 requires settings in PICKIT2 Aplication. In TOOL menu select: Use VPP First Program Entry, and deselect: Enable Code Protect, Enable Data Protect.

Sourcing componemts: some components can be bought directly from China because the price is more sensible. It is important to note that most products sold on the net by Chinese are defective, you only have to hope that the one you receive after 4 weeks is the second hand one and not the one that partly defective or doesn't work at all. Whichever way it is, forget about refund. Don't buy from when you order small quantity they label you as not valuable customer and send you rubbish out of their bin.

I use breadboard to develop the circuits on, and find it easy to use stripboard to build the projects on.

Where it is possible I choose components that are widely available, where the value and type isn't very critical to the operation of the circuit. In digital circuits values aren't critical because most resistors are used for pull up or current limit.

Resistors are 0.5 - 0.25 watt, carbon film, 5% tolerance. Metal film resistors can be used too.

Polarized capacitors are electrolytic, 10V or higher. Capacitors of values between 1uF to 1nF are either plastic film or ceramic. Values in pF (used for the oscillator) are ceramic. The voltage can be 10V upwards.

Transistors are plastic package, TO92 or similar, unless otherwise stated in the project.

Sourcing components vary greatly between countries so it's hard to give good tips, Ebay can be a good source, you may also find on the right hand side some websites for local components suppliers.

If you recycle components from old projects or old appliances you might be helping the environment and your pocket too.

Analogue voltage input
To increase the input voltage range use a voltage divider.

R2 can be up to 10K.
R1 = (Vin - 5) * R2 / 5

R2 = Vin =

Use metal film resistors for better temperature stability. If Vin is a multiplications of 5 you can use R1 made of serially connected resistors with the same value of R2, and in this case you can use 5% carbon film resistors.
Example: for Vin = 20V, R2 = 10K and R1 = 3 resistors of 10K in series.
The measured voltage is as accurate as the 5V supply because the Vref is connected to the Vcc. If your supply voltage isn't 5V you can compensate for the error in the VB application.
1N4148 diodes (or equivalents) and 1K resistor protect the input of the IC, they are recommended option.

Three common ways of pic output drive:
driving relay,
driving power mosfet to switch high DC current,
driving opto-isolated triac to switch AC.  2008-2020