728x90

728x90

Showing posts with label PIC16F88. Show all posts
Showing posts with label PIC16F88. Show all posts

Friday, July 11, 2025

DIY PICMicro Low Pin Count DIP Prototype Board

Overview 

Using a prototype board for micro-controller firmware testing could save time and safer. Putting an on-board device programmer with prototype board could be more satisfy for electronic hobbyists.

I have some PIC18 and PIC16 series of micro-controllers left from previous projects. I don't know what to do with them anymore. So I put them on single board to PIC program testing next time I need them without checking their pin diagram, and wiring them on bread board. 

DIY PICMicro Low Pin Count DIP Prototype Board
PCB Front View

DIY PICMicro Low Pin Count DIP Prototype Board
PCB Back View
 

I designed a PCB with a 

  1. PICKit2 device programmer (with AVR ISP header)
  2. +5VDC and +3.3VDC low drop out power supply
  3.  RS-232 to TTL logic converter
  4. I2C DS1307 RTC and 24LC08 EEPROM 
  5. 4-bit LCD (HD4478)
  6. 3-digit 056'common cathode multiplexing display 
  7. One passive buzzer with transistor driver (using CCP1 PWM output pin of PIC16F876A)
  8. 8-LED that connects to PORTC of PIC16F876A
  9. A 4x4 keypad matrix that connects to PORTB of PIC16F876A
  10. Three analog inputs (one LM35 and two potentiometers) that connect to RA0...RA1 of PIC16F876A. 
  11. A 28-pin IC socket for 28-pin PIC devices
  12. A 20-pin IC socket for 20-pin PIC devices
  13. A 18-pin IC socket for 18-pin PIC devices
  14. A 14-pin IC socket for 14-pin PIC devices
  15. And a 8-pin IC socket for 8-pin PIC devices

This board seem to be a large PCB with two copper layer near a size of an A4 paper that I'm not yet fabricate it. It need a PCB fabrication service.

Schematic

I use Protues VSM Release 8.16 SP3 to design draw its circuit diagram. Some components are not in its original libraries. So I find and download some devices symbol, footprints and 3D objects from snapeda website. I separate its schematic into A4 sheets. 



DIY PICMicro Low Pin Count DIP Prototype Board
Sheet #1

DIY PICMicro Low Pin Count DIP Prototype Board
Sheet #2

DIY PICMicro Low Pin Count DIP Prototype Board
Sheet #3

DIY PICMicro Low Pin Count DIP Prototype Board
Sheet #4

DIY PICMicro Low Pin Count DIP Prototype Board
Sheet #5

This board could fit,

  1. 28-pin PIC microcontrollers: PIC16F876A, PIC16F886, etc.
  2. 20-pin PIC microcontrollers: PIC16F1459(USB), PIC16F690, etc.
  3. 18-pin PIC microcontrollers: PIC16F1827, PIC16F84A, PIC16F818, etc.
  4. 14-pin PIC microcontrollers: PIC16F630, PIC16F676, etc.
  5. 8-pin PIC microcontrollers: PIC12F629, PIC12F675, PIC12F683, etc.

These are some mid-range PIC micro-controllers I have at my own workshop.

Printed Circuit Board (PCB)

This board size is 8.02x6.30 inches that could be a little bit expensive to order from any professional PCB fabrication service. But if we need to use it with classmate or friend the share cost is cheaper.

DIY PICMicro Low Pin Count DIP Prototype Board
Top Copper non-mirror


DIY PICMicro Low Pin Count DIP Prototype Board
Bottom Copper


DIY PICMicro Low Pin Count DIP Prototype Board
Top Silk

I preview this PCB on an online Gerber viewer software.

DIY PICMicro Low Pin Count DIP Prototype Board
Gerber View Top Copper

DIY PICMicro Low Pin Count DIP Prototype Board
Gerber View Bottom Copper


 Click here to download its design file.


PCB Fabrication

I have been using PCBWay for many years now. PCBWay fabricate PCBs at low cost, fast processing time for only 24 hours, and fast delivery time using any carrier options. This double side 10cmx10cm can be fabricate at only 5USD for 5 to 10pcs by PCBWay. It's a standard PCB with silk screen and solder mask.

A DIY dsPIC30F2010 and dsPIC30F1010 Prototype Board with Programmer
10 PCBs for only 5USD
 

For different size of PCB we can instantly quote on PCBWay website using a zip PCB Gerber file without account.


A DIY dsPIC30F2010 and dsPIC30F1010 Prototype Board with Programmer
PCBWay Instant Quote
 

We can accurately see the preview of fabricated PCB generated by the company's online Gerber file viewer.

PCBWay also offer PCBA assembly service at reasonable price.

A DIY dsPIC30F2010 and dsPIC30F1010 Prototype Board with Programmer
PCBWay PCB Assembly Service


Sunday, August 9, 2020

Making a temperature controller with LM35 and PIC16F88

Introduction

LM35 is an analog temperature sensor creating a linear analog voltage output of 10 mV per degree Celsius with the accuracy of 0.25 degree Celsius. Since the raw temperature data is analog voltage, reading temperature value accomplished by an ADC input of a microcontroller. Reading the temperature from this device is not complex as another digital temperature sensor with SPI, I2C or one-wire protocol. 

Making a temperature controller with LM35 and PIC16F88

This temperature sensor supplied the voltage between 4 to 30 V DC. It converts the temperature between -55 to 150 degree Celsius. Since it's linear, the output raw temperature voltage is negative whenever the temperature is below zero degree Celsius. For example, a -1 degree Celsius temperature creates an analog raw temperature voltage output of -0.01 V.

PIC16F88 Programming And Interfacing With CCS PICC

PIC16F88 comes with 10-bit ADC inside. Using a full +5 V voltage reference, the step voltage is 0.0048 V per step of the 1024 digital value. It has seven analog input channels, include it's two external voltage reference pins.

A reference image of PIC16F88-I/P. I posses one's
 bought from Futurlec.


This 18-pin small embedded controller fit to some small project like here. 

Making a temperature controller with LM35 and PIC16F88
Schematic Diagram

From this schematic diagram, I list some basic function of the MCU below.
  1. Creates an output PWM signal from RB0-CCP1 to fed the negative voltage converter. This negative voltage fed the VREF- pin of ADC Module inside the MCU itself. Because we need to read a negative raw voltage temperature data.
  2. Read the temperature voltage from LM35 fed to RA0-AN0, and convert it into a readable value in degree Celsius.
  3. Displays the temperature on a character LCD
  4. Tests the temperature input with the pre-set value store the the EEPROM. When it exceed the pre-set value, a relay driver connects to RA1 is set high. The preset value could be adjust using two buttons connect to RA6 and RA7, respectively.
Since we require two reference voltage VREF+ and VREF-. It's necessary to create a stable DC voltage. In this case, I only use two 2.5 V zener diodes to stabilize two voltage points:
  1. A -2.5 V terminal to fed VREF- pin
  2. A +2.5 V terminal to fed VREF+ pin
Making a temperature controller with LM35 and PIC16F88
Voltage references circuit

A positive +2.5 V reference voltage is created from the positive supply voltage VDD of +5 V. Another negative -2.5 V reference voltage is create from a negative -5 V voltage source. This -5 V voltage source created by the negative voltage creator. It's driven by the PWM signal generated by PIC16F88. The signal is 1 kHz in frequency and 10% duty cycles.

C source code lists below.

#include<16F88.h>
#device adc=10
#fuses INTRC_IO,NOWDT
#use delay(clock=8M)

/*Use CCP1 Module with the frequency of
1 kHz and 50% duty cycle*/
#use pwm(CCP1,FREQUENCY=1000,DUTY=10)


#define LCD_ENABLE_PIN  PIN_B3                                    
#define LCD_RS_PIN      PIN_B1                                    
#define LCD_RW_PIN      PIN_B2

#define LCD_DATA4       PIN_B4                                    
#define LCD_DATA5       PIN_B5                                    
#define LCD_DATA6       PIN_B6                                    
#define LCD_DATA7       PIN_B7                                   

#include<lcd.c>

#define INC (input(pin_A6))==0
#define DEC (input(pin_A7))==0

int8 temp=0;
char degree=223;
int16 readAdc;
float temperature;

/*A function to read and convert temperature*/
void tempConvert(void){
    readadc=read_adc(ADC_START_AND_READ);
    while(!adc_done());
    temperature=(readadc*5.0)/1024;
    temperature=temperature-2.5;
    temperature*=100;
    lcd_gotoxy(1,2);
    printf(LCD_PUTC,"%0.2f %cC",temperature,degree);
}

/*Restore LCD text string*/
void lcdRestore(void){
   lcd_gotoxy(1,1);
   printf(LCD_PUTC,"Temperature    ");
}

/*Display temperature at second line*/
void tempDisplay(void){
   lcd_gotoxy(1,1);
   printf(LCD_PUTC,"Set Temperature   ");
   lcd_gotoxy(1,2);
   printf(LCD_PUTC,"%d %cC           ",temp,degree);
}

/*Setting the temperature point to turn on
fan and store in EEPROM*/
void temperatureSetup(void){
/*Increment*/
   if(INC){
      temp+=1;
      tempDisplay();
      write_eeprom(0,temp);
      delay_ms(500);
      lcdRestore();
   }

/*Decrement*/
   if(DEC){
      temp-=1;
      tempDisplay();
      write_eeprom(0,temp);
      delay_ms(500);
      lcdRestore();
   }
}


void main(void){
   int16 tempSetter;
   /*Optional parameter for setting up
   the internal oscillator*/
   setup_oscillator(OSC_8MHz);
   output_B(0x00);
   output_A(0x00);
   /*RA1 is output*/
   set_tris_A(0xFD);
   set_tris_b(0x00);
   lcd_init();
   pwm_on();
   setup_adc_ports(sAN0|VREF_VREF);
   setup_adc(adc_clock_internal);
   set_adc_channel(0);
   delay_ms(100);
   lcdRestore();
   
   delay_ms(100);
   temp=read_eeprom(0);
   while(1){
      tempConvert();
      temperatureSetup();
      tempSetter=(int)temperature;
      if(tempSetter>temp) output_high(pin_A1);
      else output_low(pin_A1);
      delay_ms(50);
   }
}

I made a screen copy of this program.

Making a temperature controller with LM35 and PIC16F88 CCS PICC negative voltage regulator pwm Proteus EEPROM zener diode charge pump temperature sensor thermometer
A screen shot of this program

 The overall program requires 50% of Flash memory and 12% of on-chip RAM. For more efficiency, choosing another MCU with smaller flash size is a good option.

A successfully built program statistic

320x50

Search This Blog

Labels

25AA010A (1) 8051 (7) 93AA46B (1) ADC (30) Analog Comparator (1) Arduino (15) ARM (6) AT89C52 (7) ATMega32 (57) AVR (58) CCS PICC (28) DAC (1) DHT11 (2) Display (106) Distance Sensor (3) DS18B20 (3) dsPIC (3) dsPIC30F1010 (3) dsPIC30F2010 (1) EEPROM (5) Environment Sensor (4) esp8266 (1) I2C (29) Input/Output (68) Interrupt (19) Keil (5) Keypad (10) LCD (48) Master/Slave (1) MAX7221 (1) MCP23017 (5) MCP23S17 (4) Meter (3) MikroC (2) Motor (15) MPLABX (73) Nokia 5110 LCD (3) OLED (2) One-Wire (6) Oscillator (8) PCB (10) PCD8544 (3) PCF8574 (5) PIC (108) PIC12F (3) PIC16F628A (3) PIC16F630 (2) PIC16F716 (4) PIC16F818 (11) PIC16F818/819 (3) PIC16F84A (16) PIC16F876A (2) PIC16F877A (9) PIC16F88 (2) PIC16F887 (60) PIC18 (19) PIC18F1220 (5) PIC18F2550 (5) PIC18F4550 (12) PICKit2 (1) PWM (11) RTC (9) Sensor (11) SH1106 (1) Shift Register (11) Shift Registers (3) SPI (24) STM32 (6) STM32 Blue Pill (6) STM32CubeIDE (6) STM32F103C8T6 (6) SysTick (3) temperature sensor (11) Thermometer (21) Timer/Counter (31) TM1637 (2) UART (7) Ultrasonic (4) Voltmeter (7) WDT (1) XC16 (2) XC8 (96)

tyro-728x90