HOME fr Technical Tips  
OLED Current Meter PIC12F675
Picture Frame PIC16F690
Talking Clock PIC16F628A
OLED Thermometer PIC12F629
OLED Thermostat PIC16F628A
TFT Counter PIC16F628A
SSD1306 Counter PIC16F628A
SSD1331 Counter PIC16F628A
Color OLED Picture Frame
Arduino Counter for PC
Arduino Oled Code Lock
PC digital I/O without MCU
PC Analog Input without MCU
Arduino Oscilloscope for PC
Arduino OLED Oscilloscope
Arduino Picture Frame
OLED Bitmap Arduino / PIC
OLED Arduino Counter
OLED Timer Thermometer
OLED Frequency Counter
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 16 x 2 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
3.7V to 5V
Solar Charger
Infrared Decoder
PIC Music
Code Lock
Code Lock with LCD


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.

Sourcing componemts: some components can be bought directly from China because the price is more sensible. Don't buy from http://www.banggood.com 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.

iconFlag Countermoty22.co.uk  2008-2022