Skip to content

1-Chip 4-Channel PIC16F886 Data Logger

March 23, 2008

This project has only a few modifications from the “Single Chip, Four Channel Datalogger” article by Dan Gravatt in the 2008 January Issue of Nuts&Volts (page 42), so I won’t go into much detail.

Below is the schematic.  The changes from Dan’s datalogger are that I used the PIC16F886, which is pin-compatible with the PIC 16F876.  I also used the PIC’s hardware serial I/O channels (pins 17 and 18) and I added an indicator LED that indicates logging in progress and the log interval (pin 22).  The switch sets the mode between logging and writing data over the serial port.


1-chip datalogger schematic



The C data logger code is available here as is a hex file with 1 s log interval. I used the CCS compiler. This makes reading and writing program memory very straight forward with commands like write_program_eeprom( prog_mem_adr, value ) and read_program_eeprom(prog_mem_adr). The 16F886 has 8192 total program flash words. The total time of logging is determined by the delay setting at line 64 of main.c.  Use a frequency counter at the indicator LED to set the desired logging interval. If you don’t add any lines to the code, you can increase the memory used for logging by setting START_ADR to the lowest open memory address. You can get this information with, e.g., the PICKit2 programming application or whatever your favorite PIC programmer provides.

Here’s the completed logger with a LM35 temperature sensor (suspended in the foreground) and a 7805 regulator (on the back left corner of the board) with a 9V battery attached.

1-chip data logger
2 Comments leave one →
  1. rustyvz permalink
    October 2, 2009 9:12 pm

    Hello, I have tried twice to download your zip file for the 1 chip 4 channel PIC16F886 data logger, but it is showing as being corrupt and no files can be extracted. I am on Windows XP.
    Could you check the file and possibly let me know if you are able to replace the files?
    Thanks! Excellent looking project!


  2. October 3, 2009 8:03 am


    Sorry for the inconvenience. I think the binary transfer from my old blog host corrupted the file. I have uploaded a new version that seems to work now.

    Best of luck,



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: