# CPF-LOGGER-Lite: Simple DIY Data Logger for CPFers



## djpark (Jan 17, 2005)

_* edit *

- There are information not included in this main post. Read through the thread for more information on timer calibration and other useful information by cpfers.
- PEU pointed out the TX to be connected to serial port pin 2 instead of 3. This now corrected as circuit ver 1.0a and reflected in this main post. The respective file names are changed with "10a" surfix.
- Slightly modified circuit version 1.1 is posted in the new post below. This is a maintenance change. Circuit files carry "11" surfix.
_


* Introduction *

Introducing CPF-LOGGER-Lite: A PIC based simple DIY datalogger for cpfers of all age!

This post is far overdue and I owe a few people, but didn't have time to sit down to write the post. Now I feel the pressure and turn it to the pleasure to present this simple data logger hoping it would benefit many cpfers.

Full source code for both PIC and PC are provided for unlimited modification.

I am not claiming any credit or fame since all the information used are always available in the PIC datasheet and other materials, I just applied only. It suite me for my cpf related logging purpose, but it may not serve you well, I am not offering any warranty for the proper operation. I will not accept any claim against potential data loss or damage to your hardware which may be caused by the use of this logger, either.

For impatient people, here is the zip file of everything in this section.

all files zipped - cpf-logger-lite-all-10a.zip 

all files zipped - cpf-logger-lite-all-11.zip 


* Features * <ul type="square"> [*]Very simpe logger with minimum parts required 
[*]4 analog voltage input (1 used for brightness) 
[*]Attch to PC serial port to collect data 
[*]Take power from serial port 
[*]Minimum feature for simple opertion 

[*]Not an oscilloscope 
[*]Not highly accurate (does not replace DMM) 
[*]Not industrial measurement equipment 

[*]Measure 0 - 5V
[*]Input impedance max 10K (not so good)
[*]Send measured voltage from 4 inputs to PC every second at 9600 baud
[*]Each output is average of 128 samplings
[*]optional digital low pass filter (enable during compile time)
[*]Use TI OPT101 for light measurement (highly linear) [/list]
It is meant to provide minimum yet sufficient means to measure the data needed for most logging done by cpfers with minimum parts to build. It is not meant to be used as measuring instruments.


* Version *

This model is called CPF-Logger-Lite. Lite is added because it is something really light weight with minimum parts and minimum feature. It only has 10 bit ADC which is expanded to 12 bit value with averaging.

I have plan for CPF-LOGGER-Regular which uses 12 bit ADC and also accurate time base using a crystal. Also planned is CPF-LOGGER-Pro with self contained datalogger which will log into its own memory without a PC connected.

Just hope I can find sometime to do all that...


* PIC Side *

Here is the circuit diagram used. This gif file may not be clear, so the hi resoultion version is added for downloading below or in the all file. You can print or zoom in.







PIC12F675 is running on internal 4MHz clock. The datasheet says it is calibrated to be less than 1% accuracy. The particular PIC I used has about 0.44% time drift and the compensation can be made in the source code.

The power is taken from the PC serial port (DTR and RTS) and regulated to 5V with 78L05. My DMM shows 5.01V, so don't expect it to be industrial grade accuracy.

All voltage inputs are filtered with 4.7K resistor and 0.1uF capacitor since many output from the lights are in pulse form. This resistor also serves as current limiting to the PIC input.

The switch toggles between 1 second data sending or 1/8 second data sending. Sometimes it is desireable to see more rapid data during the adjustment before actual logging.

The serial output is sent to the PC serial port directly through a red led. Most PC serial ports accept the serial data happily even though it is not a true RS-232 signal. The red led indicates the data transmission to PC.

The light is sensed using TI OPT101 chip. Since 5V power is supplied, it produces max 3.5V when the light is saturated. The voltage output is bery linear to the amount of light thrown. I use a piece of plastic to cover the sensor to limit the light input to avoid saturation.

I didn't have time to draw the pcb arrangement, but I believe that those who understand the circuit shall be able to make the pcb themself. I used perforated board.






When it is completed and put into a box, it looks like this.






Here is the source code for the PIC. It is compiled with CCS PCM compiler. For those who doesn't have the compiler, pre-compiled hex file is also provided.

high resolution circuit schematic - cpf-logger-lite-citcuit-10a-hires.gif 
source code - cpf-logger-lite-pic.c 
pre-complied hex file - cpf-logger-lite-pic.hex 

For those who want to get pre-programmed PIC, you may want to contact me or Roberto ( cgapeanut ).


* PC Side *

I am a legacy programmer and most my programs are meant to run on UNIX machine. Since I don't write MS based Windows program, I did it using CYGWIN environment.

source code - cpf-logger-lite-pc.c 
pre-complied exe file - cpf-logger-lite-pc.exe 
cygwin runtime library (zipped) 

This program displays what comes from the logger through the serial port and capture it to the text file. I use MS Excel to chart.

I was half way through to write a LabView program to display the chart as the data come in, but had to stop due to the time constrain. I am suggesting someone who has programming knowlege to write VB or other programs to do so.

During the logging, the PC displays as this:

<font class="small">Code:</font><hr /><pre>0.00:00:00 1351 0000 0000 0008 1.649 0.000 0.000 0.010 0.000 0.0
0.00:00:01 1596 0000 0000 0008 1.948 0.000 0.000 0.010 0.000 0.0
0.00:00:02 1072 0000 0000 0008 1.309 0.000 0.000 0.010 0.000 0.0
0.00:00:03 0728 0000 0000 0008 0.889 0.000 0.000 0.010 0.000 0.0 </pre><hr />

The first column is the elapsed time since logging start, next 4 columns are the ADC counts followed by converted voltage respectively. The last 2 columns are current flow and the percentage of the light calculated. More note below about them.

The captured format is as follows: It is ready as CSV format for a spreadsheet.

<font class="small">Code:</font><hr /><pre>Time,A1,A2,A3,A4,V1,V2,V3,V4,C,L
0.00:00:00,1229,0000,0000,0008,1.500,0.000,0.000,0.010,0.000,0.0
0.00:00:01,1241,0000,0000,0008,1.515,0.000,0.000,0.010,0.000,0.0
0.00:00:02,0706,0000,0000,0008,0.862,0.000,0.000,0.010,0.000,0.0
0.00:00:03,1333,0000,0000,0008,1.627,0.000,0.000,0.010,0.000,0.0 </pre><hr /> 

It has the following command line options.

<font class="small">Code:</font><hr /><pre>
usage: cpf-log [options [parameter]] [log_filename]
options: -h display this text
-p i com port (1)
-b l baud rate (9600)
-r raw output mode (vs processed output)
-c count mode in log file
-t i count between logging in file (1)
-v d reference voltage (5.0)
-a i adc max count (4096)
-l i  light adc max count (0)
-s d current sense resistor (0.16) </pre><hr />

I don't have enough time to explain all here, I will have to write a manual for it. But I am sure it is very simple to understand. Most time, you don't need to add an option. Please refer to the source code for actual usage.


* Operation *

It is just upto the user's imagination. It can simply measure 3 voltages and a brightness level. I usually measure the battery voltage and the brightness from the light for run time charting. Any of input can be used for voltage input.

For current recording, I use 0.16 ohm 1% resistor in series to the battery and measure the voltage of both end of the resistor. This is the smallest resistor I have from an broken DMM. The displayed current is caulated from the voltage difference between input 2 and 3. The resistor value can be set using "-s" option.

For more accurate current logging, MAX471 IC can be used as high side current sensor. It measures the current with internal 35 mili-ohm resistor and opamp, and outputs 500uA current for each A current flow upto 3A. A resistor connected to the output of this IC can set the voltage for each A current. "-S" is planned to set this resistor value.

Here are some loggings done with this logger.































Do I expect a flood of run time charts from now on?

-- dj


----------



## koala (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

cool, this is something I am looking for! Do you need someone to help write software for the PC side? *wink *wink


----------



## djpark (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*koala said:*
cool, this is something I am looking for! Do you need someone to help write software for the PC side? *wink *wink 

[/ QUOTE ]

Sure. I just don't have time (excuse, actually skill) to write one for PC. Since the guts are all open and seen, I wish you can help out.

-- dj


----------



## koala (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

You sure put alot of effort in this. Good job there. I will try to port the codes to vc++ mswin. I am not so much of a hardware device programmer I have some questions..

i)What sort of databit, parity and stopbit you think will work. Or we don't need it in this circuit?

Options
-------
[ QUOTE ]
-s d current sense register (0.16)

[/ QUOTE ]

ii) Your option says *register* but I assume it's a typo? What sort of ohmic range(min & max) can the current sense resistor be? 

[ QUOTE ]
-v d reference voltage (5.0)

[/ QUOTE ]
iii) Regarding the reference voltage of 5v is this from the 78L05? If so, what is the purpose of this function? Does it mean the circuit can be powered by other means of power supply. If so, what sort of voltage range(min,max) is safe for operation.

iv) you have a voltage measurement range of 0V to 5V(very nice good for alki, nimh and single lithium /ubbthreads/images/graemlins/thumbsup.gif) what if some one put a 50v? Do we need protection from over current? I am worried about frying the com port and magic smoke out of the CPU heh /ubbthreads/images/graemlins/crazy.gif

I haven't read the whole thing yet so some questions might be redundant. Ok I don't know how to program in GTK,QT so for those nix guys gotta wait a while till I pick up. Or even better someone else do it. For time being I find the cpf-logger-lite-pc.c shouldn't be hard to use if you are shell geek.

My initial plan as I see this, is a GUI window with 4 seperate views. 3 voltage/current meter and 1 brightness meter. The display will update in realtime and able to save the samplings in the exact format according to dj design. I will try to code as close as dj's c program.

hey dj - malaysia boleh! /ubbthreads/images/graemlins/grin.gif

-vince.


----------



## PEU (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Thanks DJ!!!

making the part list in my PDA /ubbthreads/images/graemlins/smile.gif

EDIT: I can't see clearly the parts in the schematics /ubbthreads/images/graemlins/frown.gif can you clarify? /ubbthreads/images/graemlins/smile.gif, I'm building the part list from the explanation.


Pablo


----------



## Ralf (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Nice project,

and I like programms for UNIX  ...

Cheers
Ralf
ps: command line rules ...


----------



## PEU (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Is this lisk OK?

Datalogger:
PIC12F675
78L05 regulator
TI OPT101

1n4148 (x2)
Red Led

4K7 (x4)
1K (x2)

0.1uF (x6) tantalum
10uFx16 (x2)

4 aligator clips (diff colors)
2 meters tester type cable
pcb connector for te wires
simple switch
9pin DB9 connector for chassis
Small Cabinet


Pablo


----------



## jtice (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

NICE work dj !!!!!!!!!!!! /ubbthreads/images/graemlins/bowdown.gif /ubbthreads/images/graemlins/buttrock.gif

heh, nice timming, I just ordered a $50 USB datalogger last night! /ubbthreads/images/graemlins/twakfl.gif hehe
oh well, now I will have two /ubbthreads/images/graemlins/smile.gif I will build one of these also, I think it would be a great learning tool.
Last night I also started reading up on electrical schematics so I can start building some of these great things you guys come up with.

Well worth the wait dj !! /ubbthreads/images/graemlins/thumbsup.gif
Thanks for all the hard work and time you put into this.

~John


----------



## cgpeanut (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ,

You are ahead of the gane as always /ubbthreads/images/graemlins/grin.gif Thank you /ubbthreads/images/graemlins/bowdown.gif 

You can get free PIC12F675 samples here:

PIC12F675 

I have 8 new ones avialable ibut 4 will be used in my POPL -S mod so 4 PIC12F675 is readily avialable now. If demand is good I will order from digikey and keep them in stock.


----------



## djpark (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Vince.

[ QUOTE ]
*koala said:*
i)What sort of databit, parity and stopbit you think will work. Or we don't need it in this circuit?

[/ QUOTE ]

The logger pumps out 9600,8,n,1 format. On PC, it is taken care in the cpf-logger-lite-pc.c and it should work in Linux as well. (actually a UNIX code using termio library)

Thta was the fastest speed I could go without any error using software bitbang with not so accurate internal RC oscillator of PIC. Next version will use external crystal for accuracy.

[ QUOTE ]
ii) Your option says *register* but I assume it's a typo? What sort of ohmic range(min & max) can the current sense resistor be? 

[/ QUOTE ]

Real typo which was not noticed almost forever. It is "resistor". You can choose the value based on a common sense. If too big, too big voltage drop and too small, too hard to get enough resoultion though more desireable.

I use 0.16 ohm from a DMM and you should be able to get 0.1 ohm as well. With 0.16 ohm, the current measurement is on 16mA resoultion.

In fact I use a DMM 10A current measurement mode as a current sensing resistor since it gives about 0.2 ohm value. So I can calibrate the value by changing -s value. As a bonux, you have vidual display of current to confirm the ADC throughout the logging.

[ QUOTE ]
iii) Regarding the reference voltage of 5v is this from the 78L05? If so, what is the purpose of this function? Does it mean the circuit can be powered by other means of power supply. If so, what sort of voltage range(min,max) is safe for operation.

[/ QUOTE ]

If you hook another power source, it shall work. The reason for this option is to compensate the variation of voltage output by 78L05. I get between 5.0V and 5.1V from different samples. If you measure the voltage applied to the PIC with your trusted DMM or scope, you can overide it with this option.

Also it is to prepare for future version of logger where an external voltage reference may be used such as 4.096V.

[ QUOTE ]
iv) you have a voltage measurement range of 0V to 5V(very nice good for alki, nimh and single lithium /ubbthreads/images/graemlins/thumbsup.gif) what if some one put a 50v? Do we need protection from over current? I am worried about frying the com port and magic smoke out of the CPU heh /ubbthreads/images/graemlins/crazy.gif

[/ QUOTE ]

That's why it is called cpf-logger-lite. It is not meant for a big time measurement of HID. But you can use a voltage divider to drop voltage whthin this range and use software to convert. But since the max input impedance is 10K, you may need to add an opamp.

[ QUOTE ]
My initial plan as I see this, is a GUI window with 4 seperate views. 3 voltage/current meter and 1 brightness meter. The display will update in realtime and able to save the samplings in the exact format according to dj design. I will try to code as close as dj's c program.

[/ QUOTE ]

Hmmm, the realtime graphic display is something I wish, but I don't have such skill. So I am excited to see your program coming out. Since current can be calculated from the 2 voltage input, you may want to add such option later.

[ QUOTE ]
hey dj - malaysia boleh! /ubbthreads/images/graemlins/grin.gif

[/ QUOTE ]

Thanks! Though I am a Korean, I dedicate your "boleh" to my Malaysian friends.

-- dj


----------



## djpark (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
Thanks DJ!!!

making the part list in my PDA /ubbthreads/images/graemlins/smile.gif

EDIT: I can't see clearly the parts in the schematics /ubbthreads/images/graemlins/frown.gif can you clarify? /ubbthreads/images/graemlins/smile.gif, I'm building the part list from the explanation.


Pablo 

[/ QUOTE ]

Pablo,

I added hi-res gif file in the list for downloading.

Nonetheless, I am listing what I am seeing within my own drawing.

J1: DB9f
D1, D2: any rectifier
D3: red led (you can skip this)
C1, C2: 10uF (any value electrolyte)
C3, C4: 0.1uF (better ceramic or tantalum)
C5, C6, C7, C8: 0.1uF (tantalum)
R1: 10K (any value between 5K & 100k)
R2, R3, R4, R5: 1k
U1: PIC12F675
U2: OPT101
U3: 78L05

D1 + D2 & U3 can provide quite handsome mA for this whole thing to work. C1 and C2 don't have to be very big since the DC from PC is already rectified.

C3 & C4 are decoupling capacitor and ceramic is better. But with the low current consumption of the PIC and OPT101, you may not be so much concerned about them. Just add something similar.

R1 is a pullup resistor and practically 1k to 1M can work, but I chose 10k as commonly used.

R2-R5 1k and C5-C8 0.1uF are used as hardware low pass filter. I mentioned in the main post as 5k by mistake. But there is no harm to use 5k. It will provide smoother voltage transition as result. Actually R2-R5 serve as current limiter to avoid damage to the PIC.

You can get U2 OPT101 as sample from TI. If you don't have, you can use a led as sensor and use a transistor to amplify the voltage output.

I used the audio cable provided with CD-ROM as test cable. It is thin yet quite strong. Even the connector is nice to use.

You may want to add a stereo audio jack so that the light sensor can be connected externally, it will be easier to position against the light. You can use microphone cable which is usually used for PC sound card. Most has 2 cores for power and signal plus ground.

I hope this clear.

-- dj


----------



## cgpeanut (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ Said:

This program displays what comes from the logger through the serial port and capture it to the text file. I use MS Excel to chart.

I was half way through to write a LabView program to display the chart as the data come in, but had to stop due to the time constrain. I am suggesting someone who has programming knowlege to write VB or other programs to do so.

DJ, 

Let me try and build the data and use MRTG (Multi Router Traffic Grapher) to display it in a webpage format.

MRTG 

It saves the data as gifs and displays it as a webpage in real-time. I've used this approach at work graphing temperature and humidty in vairous locations here in our production facilities, Here's the actual readings for zone1 for example. 






I'll have to dig up the code but it should be straight forward using linux of course. but you can also configure for windoze OS


----------



## jtice (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Do any of you know how to make Excel import the data,,, REALTIME?

I have an Excel templete I made that auto scales etc, and will take out, and ignore any blank cells.

And I know I can simply import the text file that loggers make, but, I would really like to get it to do it real time.

I can send one of you my template if you want to see if you can get it to work.


----------



## Ralf (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

If you are on a unix system, just use gnuplot for displaying
the data ...

Cheers
Ralf


----------



## MrAl (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hello again,

dj:
Very nice project here! Im very interested.
One need i have is to be able to 'adjust' the upper and
lower limits of the input voltage range so as to increase
the resolution over a limited input range.
For example, if it now has a 5v reference that makes
each step about 5mv. I'd like to be able to adjust
the lower limit to say 1 volt, and the upper limit to
say 2 volts, which would make each step resolution about
1mv which would be just what i need.
I havent studied the circuit in great detail yet...
is this possible by modifying the circuit a little and
using two voltage references (1v and 2v for that example)?


Great project, and thanks for taking the time to
share it with us!

Take care,
Al


----------



## koala (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

hey ralf,
I know how to use gnuplot but is there a gtk version for windows?

Vince.


----------



## jtice (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
If you are on a unix system, just use gnuplot for displaying
the data ...

Cheers
Ralf 

[/ QUOTE ]

If you were talking to me...
Im using windows XP.


----------



## Zelandeth (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Off the top of my head, I don't know how to do realtime data importing, but my partner is a true Excel wizard (i.e. some of his spreadsheets keep Volkswagen's financial department moving), will quiz him on it when I next get a chance, and will get back to you with the results.


----------



## cgpeanut (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hey Guys,

I was able to compile and execute the cpf-logger-lite-pc.c in linux (fedora core 3) All I did was change the com_port from /dev/com1 to /dev/ttyS0, you can find what serial device you have by typing dmesg | grep tty.

So I wondered why not build a GUI for the cpf-logger-lite-pc.c prog DJ created? I used xforms and plan to display the graph on the white screen. 






There's still a lot of work that needs to be done and since I don't have the circuit built yet I have to stop. I made provisions for a database interface that would use mysql to store the data MRTG and rrdtool to graph it etc.


----------



## djpark (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*MrAl said:*
One need i have is to be able to 'adjust' the upper and
lower limits of the input voltage range so as to increase
the resolution over a limited input range.
For example, if it now has a 5v reference that makes
each step about 5mv. I'd like to be able to adjust
the lower limit to say 1 volt, and the upper limit to
say 2 volts, which would make each step resolution about
1mv which would be just what i need.
I havent studied the circuit in great detail yet...
is this possible by modifying the circuit a little and
using two voltage references (1v and 2v for that example)?


[/ QUOTE ]

MrAl, it is not meant to be industrial grade measuring equipment. This small PIC doesn't have any more pin to add external voltage reference, but next version will have.

Meantime your best bet would be using an opamp to pull the inpuit range to 0-5V.

-- dj


----------



## djpark (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Roberto,

You are quick and you have an awesome program coming out.

In fact the source is copied from part of my Linux project and it should compile on almost any UNIX machine with different com port name. Surprisingly we have many UNIX programmers here.

I am sure there are many WIN32 programmers who can also write PC based real time chart.

-- dj


----------



## koala (Jan 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yeah I bet there are alot of windows programmers around. Feel free to do it I wont' be able to until next two weeks.


----------



## Ralf (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@jitice No I haven't talked only to you but to all out there /ubbthreads/images/graemlins/smile.gif 
and there is actually a gnuplot version for windows as well
Gnuplot for Windows 

@Mr. Al how to do a selection of input range? I am not familiar with the Pics but for the AVR uCs the low potential for on chip ADC is alwas Analog GND which has to be equal potential to digital GND

Its awesome how much good stuff is out there from cpf members. I like to do the same thing with my AVR as I
have all the development stuff for this uC. But I like
to see your "data format" as a "cpf standard" for 
cpflogger of all flavours. Then the Programms at the
pc side could share all logger Information. It is already
cool how much software work have been done from the various
cpf members /ubbthreads/images/graemlins/happy14.gif

Cheers
Ralf


----------



## djpark (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Ralf,

[ QUOTE ]
there is actually a gnuplot version for windows as well Gnuplot for Windows 

[/ QUOTE ]

I use gnuplot for my project. It generates gif file for web page from the data collected from mSQL. Is there a way to redraw as new records are added?

-- dj


----------



## cgpeanut (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ, 

I've have not touch gnuplot but in MRTG I just redraw or update the graph in crontab to whatever mins, secs you desire, I think this can also be done in windows using the "at" command.

I think it's best to store the data in mysql then use perl DBI-DBD for output I got the perl scripts to hit the database. 

DJ any chance you can share the mysql tables?


----------



## Ralf (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi djpark,

suppose your data file is named qwe. create a controlfile controlqwe with the following inside
set xdata time
plot 'qwe' using 0:1
pause 10
reread


in gnuplot just do a load "controlqwe".
Your data will be redisplayed every 10seconds ...

Cheers
Ralf


----------



## Ralf (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

cgpeanut, 

I like the keep it simple approach and I think
it is very easy to reread the files with gnuplot.
If you like using a mySQL database, why not, but
setup a mySQL just for displaying logger data is
a bit an overhead. But you could do this database approach then for
your webpage and cpf community could join online
your runtime tests /ubbthreads/images/graemlins/blush.gif 

Cheers
Ralf


----------



## lymph (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Great job djpark! You inspired me in a previous post to get the OPT101 and now I'm working on using it with my dataq di-194 ADC. I thought about writing a GTK+ font end for it (another unix guy here) but realized that using a simpler console program and gnuplot serves my needs well enough.


----------



## cgpeanut (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Ralf ,

OK, now you got me reading man pages of the gnuplot program shame on you! /ubbthreads/images/graemlins/smile.gif 

I may have to pick your brains a bit in case I have questions, 
gnuplot would work too lets try it.


----------



## cgpeanut (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK, 

I got the domain name setup and asked my buddy to host it temporarily http://www.cgpeanut.com 

But first things first, need to build the circuit , Got the OPT101 samples ordered from TI and the parts from rat shack except the 7805 voltage regulator. Does anyone know if rat shack carry these or do I have to go to digikey?

Anyone tried the dry transfers stickers use to build pcbs? Are they worth it? or would it be better to just hard wire it on a pref board.

What have I gotten myself into now /ubbthreads/images/graemlins/hahaha.gif


----------



## was_jlh (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

* deleted *


----------



## dat2zip (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

This is a cool project. I've been following this and the graphs from it on and off.

I can make avaialable boards for folks. Maybe 10-20 of them. I'd keep one for myself and share the rest with the group.

I would need some assistance in parts, dimensional information, holes, connecters and such. I won't be able to start work on it till after ShotShow, so, if you can wait till I get back from ShotShow I can schedule some time and I'll front the cost of the raw boards.

BTW: The smaller the board is the cheaper it will be to make (for me at least). If we can live without soldermask and silscreen that will again save $$. Just some food for thought. Any thoughts or suggestions appreciated.


----------



## cgpeanut (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

was_jlh,

Thanks for the info found some at another rat shack store. /ubbthreads/images/graemlins/buttrock.gif

dat2zip,

Thanks I'll take that offer! Even better! just tell me what parts you need and how many and I'll do my best to hook you up, I do know your boards will look way better than what I would make /ubbthreads/images/graemlins/smile.gif probably function a lot better too /ubbthreads/images/graemlins/grin.gif

As far as soldermask and silscreen what's the price diff? couple of bucks? or a hundred? If it's just a few bucks I'd say yeah doit but that's me.


----------



## dat2zip (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK, I'm having trouble accessing the files.

If someone has the complete zip file and could email it to me, I'll commit the rest of today and whip something together.

my email is [email protected]

If someone could identify the capacitors that will be targeted (SMT, throughhole) and the actual Digikey part number that would be great.

I think if someone doesn't do that, I'll make the BOM using digikey part numbers as reference. At least that is where I do most of my shopping and I seem to shop there all the time, so, it wouldn't be too long before I place another order.

Some logistics in distribution I might not want to be involved in. Maybe, cpeanut or someone else can be the recepient of all the raw boards and can handle the kitting or distribution.

Another possibility is we can trust the honor system, I can put up a zero cost part on the shoppe and you would only have to pay for shipping.

Of course this lends itself to the next question of why don't I go the next step and offer the complete kit of parts too? ... OK, too much to commit to for now. I'll focus on making the boards and we can work out the logistics later.


----------



## pbarrette (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Wayne,

I actually started an Eagle layout for this thing. If you like, I could pretty it up some and make it available for download.

I also did some preliminary parts research on Digikey already as well with an interest in keeping costs low. I didn't source the resistors since they would be available at rat-shack (minus the Isense), but I could source the whole thing on Digikey if needed.

I was also considering coding a Windows interface program (C# .NET) to go along with it, but I need to brush up on serial port interfacing in .NET and build an actual, working board to test with first.

pb


----------



## dat2zip (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK, 

Here's the initial schematic. I guessed at some pinnouts, but, for now I can move on to the layout and fix any schematic errrors.

If someone could review the schematic and verify the DB9 connector I'd appreciate it. Also, review the two ICs and verify I hooked everything up correctly.

cpf_logger_lite schematic

OK, I edited the schematic with some minor changes and winged some parts on the board.

Here's the placement using some SMT components. The major components are through hole and some of the discretes are SMT.


----------



## was_jlh (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

cgpeanut, pm sent


----------



## cgpeanut (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

was_jlh,

Thanks got your message I think it will work either way.

Wayne,

I'd be happy to do the ktting and or distribution for anyone intrested. Ordered the 20 PIC12F275's from digikey just now and will start programming them when they arrive. 

I might consider programming the interface in GTK+ or Qt we'll see, I think these GUI tools have windoze counterparts? Ohh, great more manuals to read /ubbthreads/images/graemlins/grin.gif Oh well, we learn something everyday.


----------



## pbarrette (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Wayne,

The DB9 connections look good to me in both the schematic and the prelim board layout.

The OPT101 is an 8-pin DIP package, not a SIP, so you're going to have to change the footprint on that one. Unless, of course, it's just a pin header so people can attach and remove the sensor or have it mounted in a different portion of the case.

Actually, now that I think about it, a terminal block might be the way to go on this one depending on user case. I'm not sure if any components would need to be changed due to possible noise or signal loss though.. Should be ok since it's just getting a reference voltage and outputting a low current voltage signal.

Are those SMT resistors on that board? If they are, then why aren't the diodes SMT as well? IMO, it should be one or the other for the common components. People can go buy the resistors at RS just as easily as the diodes.

But going SMT has advantages too. It means a larger total Digikey order which means we are more likely to hit the $25 "magic number" on shipping. It also means that we could likely find a dual rectifier diode in a single package.

Some digikey on-hand part numbers I found are:
10uF Cap - 493-1036-ND (Electrolytic $0.20ea)
.1uF Cap - 399-1644-1-ND (Tantalum, $0.19ea)
1k R - 311-1.0KECT-ND (SMT, 1206 case, $0.078ea, min 10)
10k R - 311-10.0KFCT-ND (SMT, 1206 case, $0.088ea, min 10)
Diode - BAV70FSCT-ND (SOT-23 dual 1n4148, $0.22ea)
Regulator - NJM78L05UA-ND (SOT-89 78L05, $0.39ea)
OPT101 - OPT101P-ND ($5.50ea)
DB9 - 177-809F-ND (right angle pcb mount $5.74ea)
DIP Socket - A24794-ND (8-pin, through hole, $0.36ea)

Hope this helps,
pb


----------



## PEU (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I use Gaim IM which uses GTK under winXP. Not sure if its a direct recompile.

I'm in for one if the price is right.


Pablo


----------



## dat2zip (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

pb,

Thanks for reviewing the board. That's great feedback. Funny the proto image doesn't look like a dip for the opt, but, OK. I had it a 8 pin dip and then changed it. 

Yes, a dual diode might be in order. Maybe, a SOT23 dual diode? Would that be too small to solder for some folks?


Not sure why I used through hole. Guess, I'm not too clear what can be surface mount and what can't.

Just let me know what to change and I'll do it. Do you need mounting holes? What box will this go in?

I have a window of tonight to try to finish. Sorry, if I'm being 
a PIA... Tomorrow I'll be hammered with a pile of stuff to do.

edited...
OK, from the BOM above, I'd like to substitute:
311-1179-1-ND 0.1uF CER 1206 50V X7R instead of the Tantalum uF.


----------



## dat2zip (Jan 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I was able to keep the whole layout constrained to one layer so that this could be made at home using standard Toner xfer method or photo resist exposure method.

Less holes = less drilling.

Currently the layout is topside. This could be mirrored so that it was etched on the backside leaving the topside blank. If it was done bottomside, then the SMT components would be on the bottom. No biggie, but, it would still only be a single sided board. I say this because if you did this as a topside trace layer, then you would have a bear of a time soldering the through hole components. About the only one you might get soldered on is the TO92 since it will be standing off the board some distance.

Rough estimate is ~10.00/bd raw no soldermaks, no silkscreen. Adding soldermask + silkscreen will add a few bucks per board.

If I moved all the traces to the backside, then it's possible to have it fabbed as a single sided board and it might cost less.

In any case, I'm committing the resource to have the board made within reason and given a small qty.

It's the group call on silkscreen, soldermask, topside traces or bottomside.

Please review the layout. In particular the DB9 is hanging off the edge of the board. I'm assuming cheating a bit here and pressing the DB9 a cutout in the box which will provide mechanical support.

Wayne


----------



## PEU (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Maybe for version 2 some USB tranceiver may be considered (IE: MAX3346e)


Thanks for doing this


Pablo


----------



## pbarrette (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Wayne.

The DB9 hanging off the edge shouldn't be a problem assuming that holes are drilled at the "M1" and "M2" mount points and the connector is bolted to the board. That should give enough mechanical strength even without using the mounting holes on the other axis (vertical at the connector from your board proto pic).

I know that ceramic is probably better for the two caps mentioned in this instance, but I was trying to keep differentiation in parts low in case minimum quantitiy/price was an issue. Apparently it isn't since your part above is $0.098ea min 10 which comes to a whopping additional $0.98 cents.

Nice board BTW.. What layout software are you using?

pb


----------



## Ralf (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@djpark,

one question to the software for the pic.
there is a software low pass filter, which is a
good thing (nyquist came in mind ..), but it is
disabled by default in your code? Is there some reason.
Although I think all measurements in the flashlight
area are steady curves and it is not a critical thing.

Cheers
Ralf


----------



## dat2zip (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

pb,

Ah, good point. I moved to a ceramic for size.

Sorry, I tend to look at the qty discount since I seem to be buying bulk most of the time.

I use Orcad version 9.2. It's old, but, reliable. I've been using it for years now so I know all the tricks and gotchas.

I noticed after the fact that I could move the SOT23 diodes down a bit and move the upper bypass capacitor closer to the IC.

All discretes are currently 1206 with the exception of the 10uF capacitors. If I read the datasheet correctly it's a 0.2 dia with a 0.075 lead to lead spacing. I used a 0.2Dia 0.1" lead to lead. That should be close enough. If you splay the leads slightly you should be able to get the capacitor loaded. It just won't go all the way down and bottom out with the different lead spacing.

I can fix that if that is indeed the case. This one was the closest I could find in a pinch and I can modify this one to correct it if someone else could confirm the 10uF footprint.

Cool!!!. I just checked PCB single sided PCB and with soldermask and silkscreen it's under one Benjamin for 20 boards. This is great and that includes shipping. If someone wants, I can have it dropped shipped directly to them if someone is going to handle the kitting and such.

I might go a tad bigger and space things out a bit.

OK, where's the box this is going to go in?

Let me know of any changes or additions and I'll get them incorporated into the board.

There looks like some space on the board to silkscreen or etch into copper some text. Maybe, the project name and revision?


----------



## Hallis (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Whoever is willing to build one of these complete i would like to purchase one. I can also help test on either a Linux or WinXP machine, I typically run SuSE but cant seem to find a more recent version than 7.2 /ubbthreads/images/graemlins/frown.gif Will have to dig out my SuSE DVD's and see if i have anything more recent.

Shane


----------



## Ralf (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hallis, you should able
to compile this programm on almost
every unix system; up to date linux
is not necessary. I compiled it with
Debian 2.2 ...

Cheers
Ralf


----------



## Hallis (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

cool. now all i need is the hardware, I am not Mr. Solder so i dont wanna build my own /ubbthreads/images/graemlins/blush.gif

Shane


----------



## cgpeanut (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Anyone considered mounting the board on rubber pads? so we don't have to put it in an enclosure?

If we use plastic bolts for the DB9 connector that should secure it.


----------



## Hallis (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Id still be worried about breaking a component off of the board if i accidently dropped it. Would rather have an enclosure.

Shane


----------



## cgpeanut (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Well,

I went to rat-shack's web site. and found these encliosures that are reasonable i.e: below 3 bucks.





cat #:270-238
• All-aluminum construction
• Measures 5¼x3x2&#8539;" (13.3x7.6x5.4cm)
• Includes four screws

.




cat #: 270-1803
• Measures 5x2.5x2" (12.7x6.4x5cm)
• Enclosure includes slots to mount a PC board horizontally or vertically
• Aluminum lid and plastic lid are supplied with partial cutouts for DB-9 and HD-15 computer connectors





cat #: 270-1801
• Measures 3x2x1" (7.6x5x2.5cm)
• Enclosure includes slots to mount a PC board horizontally or vertically
• An aluminum lid and a plastic lid are included

at first glance looks like cat #: 270-1803 has DB9 cutouts which is good.

Wayne, 

I would like mine to be with soldermask and silkscreen if possible but would abide by the final groups decision. I got (4) PIC's programmed last night using the K150.

Question on the ktting: Are these all the parts we need? This info was posted by pbarrette

Some digikey on-hand part numbers I found are:

10uF Cap - 493-1036-ND (Electrolytic $0.20ea)
.1uF Cap - 399-1644-1-ND (Tantalum, $0.19ea)
1k R - 311-1.0KECT-ND (SMT, 1206 case, $0.078ea, min 10)
10k R - 311-10.0KFCT-ND (SMT, 1206 case, $0.088ea, min 10)
Diode - BAV70FSCT-ND (SOT-23 dual 1n4148, $0.22ea)
Regulator - NJM78L05UA-ND (SOT-89 78L05, $0.39ea)
OPT101 - OPT101P-ND ($5.50ea)
DB9 - 177-809F-ND (right angle pcb mount $5.74ea)
DIP Socket - A24794-ND (8-pin, through hole, $0.36ea)

or were there any changes on digikey part numbers etc.


----------



## cgpeanut (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@DJ,

Looks like the Wayne's pcb will be using PDIP for the PIC12F675 we can substitue PIC12F629 correct? 

quick galnce at the code (broke my eye-glasses) and I did not see any reference to a 10-bit Analog-to-Digital (A/D) converter which is the only difference between the two PICS


----------



## djpark (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*cgpeanut said:*
Looks like the Wayne's pcb will be using PDIP for the PIC12F675 we can substitue PIC12F629 correct? 


[/ QUOTE ]

Roberto,

PIC12F629 does not have ADC and can't be used. PDIP with socket will be easier to remove and reprogram for timer calibration. (I thought he used SOIC?)

More expensive PIC12F683 may be used, but the speed in the C program needs to be changed since it runs at 8MHz instead of 4MHz.

I will post soon about how to calibrate and compensate the timer for more accurate record interval.

-- dj


----------



## dat2zip (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I see a mistake on my part.

I used the TO92 through hole for the regulator as in the original photo of the prototype. I see the BOM (Bill of Materials) calls out a SOT89.

I put a PDIP for both the uP and the OPT, since, both could be socketed for easy removal and since the PIC needs to be programmed first, it would be rather hard if it was a SOIC version.

On the RS box, I don't see the DB9 partial cuttouts? If this is on the top, then the board will stick down vertically? Maybe, I'll run down to the local RS and pick one up and see what it looks like.

My other project boards came in today, so, as expected I'll be in a real crunch to assemble and test two of these new boards and I'm hoping to get the Constant Current Load box functionally going enough to take it to Shot Show and give it to JS to help him test and characterize his batteries.


----------



## cgpeanut (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@DJ,

I emailed Wayne regarding the final package of the PIC12F675. I agree with you on the PDIP, it should be socketed that way it would be easier to program/re-calibarte etc we don't have to fabricate a special jig.for the SOIC Also, software upgrades would be easier aswell..

@DJ again, 

Question on the OPT101. In the image ofthe actual product, it looks like the version with less pins is used? Is that correct?

In the image ofthe actual product, it looks like the version with less pins is used? Is that correct?

Which OPT101 version did you use OPT101P or OPT101P-J


----------



## cgpeanut (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I got word from Wayne:

He's changing the regulator footprint to SOT89 as per the BOM. 
and using PDIPs for both uPIC and light sensor (OPT101).

If we use the RS enclosure with DB connectors 

That would put the board vertically and also mean the light sensor would 
then be facing one of the sides and not towards the top of the box.

We may want to take this into consideration since I think it would make 
more sense if the sensor faced upwards. This would make the box more 
stable sitting like this rather on one of it's sides to point the sensor 
upwards.

Then again, pointing the light source on axis with the table might 
actually be easier to use. Elevate the box a few inches and then lay 
the flashlight you want on the table and you would be good to go.

Having it face upwards would mean floating the light above the table 
somehow or rotating the box on it's side to shoot horizontal.

Commets? Suggestion?


----------



## PEU (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Wayne: From the DJ schematic C3 & C4 seem to be in parallel, are both really needed?


Pablo


----------



## dat2zip (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Peu,

That's correct that C3 and C4 are from the 5V (VCC) to GND. C3 and C4 are actually bypass capacitors for each IC and each one is physically located as close to each IC as possible. That's the recommended practice is to put one 0.1uF at the VCC and GND pin of every IC.


----------



## PEU (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Oops /ubbthreads/images/graemlins/smile.gif Didn't know that.

I was wondering that shipping to Argentina would kill the good price, so just in case, I drawed the board without SMD components (I cannot solder SMD /ubbthreads/images/graemlins/banghead.gif )

Also I managed to use the same size as Wayne's board (36x36mm)















Pablo


----------



## djpark (Jan 19, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Roberto,

From my experience of having the OPT101 standing within the box, I could set the logger box on the table (actually under the table) and put the light infront set on a vice.

But the problem I face almost every time is the consistency of the light measurement. If by any reason the light or box is touched, the direction of the light pointing to change slightly and the measurement may change. Or when I toggle the switch to reset the time counter, the same thing can happen.

Either having the light sensor facing upward or side way, you will face the same problem unless you can fix them on a same frame firmly.

My idea is to make the light senser as external probe (look similar to the small microphone) and you can tie to a stick or other thing together with the light.

To all:

This simple logger started as my pet project for PIC proramming study and yet it served me quite well in the cpf logging, so I thought it would benefit the others, too.

As it was meant for a simple solution, it doesn't offer much and doesn't have hi-tech. But I am so amazed with the all hi-tech efforts poured in by many respected cpfers and at the same feeling shame of putting not enough effort to improve with different design.

Nonetheless, I see the true cpf spirit of sharing knowledge and wish that this trend can continue for the benefit of other cpfers.

God bless you all!

-- dj


----------



## dat2zip (Jan 20, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Just FYI,

Here's one of my current projects. I'm still working on it. It's now my third or fourth proto of this.







It's an ATMEGA48 uP, 2X16 LCD display and some analog circuitry to control a FET to simulate a load for battery tester.

There's an IC that's not loaded and it's a Maxim temperature/fan controller IC that eventually I'd like to monitor the heatsink temperature and have it control a fan to keep the heatsink cool.

I'm hoping to get this working before I leave on Sunday to Las Vegas and I'll give it to JS.


----------



## Ralf (Jan 20, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Good to see other Atmel AVR users around
here ...

Have you designed the Board by yourself?

Cheers
Ralf


----------



## PEU (Jan 20, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

what if you use for the OPT101 an uncoated or painted black reflector? that should shield it from outside light.


Pablo


----------



## cgpeanut (Jan 20, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ,

Glad to be of service /ubbthreads/images/graemlins/smile.gif 

PEU,

Why not black non reflective electrical tape instead of paint? It would be less destructive IMHO.


----------



## PEU (Jan 20, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I will build this circuit next week, since I have all the parts ready or coming.

Since I have a LM631 meter, I was thinking why not use the pic leg attached to the OPT101 as an extra log input, but keeping it functional. 

So I simply added a switch, one side you use the internal light meter, other side you have an extra logger input /ubbthreads/images/graemlins/smile.gif 







Pablo


----------



## Hallis (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

but the big question is.....

Who's going to build me one? /ubbthreads/images/graemlins/smile.gif

Shane


----------



## dat2zip (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I might have an update by the weekend. I'd like to order the boards when I get back on the 30th. 

I think I'll move the SMT to the backside along with the traces so that if someone makes this board at home it will be doable.

I think I'll also add any comments, suggestions or recomendations and I think I can add the vertical OPT footprint on the board allowing either part to be loaded hopefully before I leave.

I'll be leaving Sunday and will be back the following Sunday.

Wayne


----------



## pbarrette (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi all,

When I sourced the SMT components I did my best to keep the prices low and the sizes high. I know that some of you don't do much soldering with SMT components, so that was a factor in the Digikey sourcing.

The resistors are all 1206 cases, while the smallest component (for soldering purposes) is probably the SOT-23 diode package. A good photo guide to these sizes is here to give you an idea of the sizes.

I find that with an X-acto knife or a micro screwdriver, I can pretty easily solder these components in place. However, if your hand isn't as steady (like mine when I've had too much coffee), using one hand to hold the soldering iron, while resting your wrist on your fist works pretty well. You can also use a small dab of superglue to hold the component in place while you solder, just be careful of the fumes. Normally, I scrape some of the adhesive from a post-it note with my X-acto and use that to hold the component, but it isn't as secure.

As for the OPT, why not have a footprint for both the DIP-8 socket and solder points for through-hole wire. Then you could mount the OPT in the socket on the board, or solder wires to the holes and mount the OPT remotely. I don't think you can do a true vertical layout on the board since it's an 8 pin DIP and it uses contacts on both sides of the package. Maybe a through-hole pin header that could mate to a plug? Then you could just use wires, or solder your own pin header to the board and use a plug if desired.

BTW, these are some great board layouts you guys are coming up with. I've been trying to do a board in Eagle and the routing is such a pain. I still haven't figured out how to do a nice wide ground path that snakes around the signal paths.

Also, DJ.. You said something about being ashamed that you haven't done more. Don't worry about that at all. What you've done already is more than can be expected or wanted. You started this ball rolling with your ideas and your freely given schematics, PIC code and app source code. It's that kind of open sharing that shows the "true CPF spirit" and encourages the others here to openly share their knowledge and talents. You've created a firestorm here. Had you built and sold these for ~$30/ea or more, people would have bought them like hotcakes, but instead you chose to openly share with the world. If anyone should be ashamed, it's the rest of us. Thanks Dj.

pb


----------



## NewBie (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

For 19.99 you can buy a datalogger with additional features:

- with 4 Mb flash, 
- a LCD display
- joystick user interface
- piezo speaker for alert or end of test
- built in light sensor
- temperature sensor
- runs off a coin cell that is in the holder

Plus it can function as a:
&#8226; Clock with calendar function 
&#8226; Digital thermometer 
&#8226; Light intensity measurement 
&#8226; Digital name tag 
&#8226; Jukebox

You can also rig it to do many other things, measure current, voltage, time, with very little additional circuitry.

Butterfly Evaluation Kit
The AVR Butterfly can be used by customers to gain familiarity with the AVR architecture, 
evaluate the capability of the LCD family or as a hardware platform
for code development.

ATAVRBFLY-ND Butterfly Evaluation Kit ..........$19.99

You can purchase it from DigiKey for this price.


----------



## jtice (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

sounds cool Jar, 

but it also sounds like you will have to spend alot of time learning to program it, and become firmilar with its architecture.

I like all these little circuits comming out, and more so, the ones ppl are making up on their own.

I think these little guys are great ways to learn this stuff, I plan to make a bunch of little simple things, that should teach me a good bit.

Actually, I have been wanting to make a post, to gather info on such small kits. think Ill do that now /ubbthreads/images/graemlins/smile.gif


----------



## PEU (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

looks nice, but for using it we would need code development /ubbthreads/images/graemlins/frown.gif


Pablo


----------



## pbarrette (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Newbie,

This really does look like a great little tool at a great price if you plan on doing AVR development. But as an out-of-the-box data logger or even as a roll-your-own kit, it's not as useful as Dj's.

First of all, ignoring the programming aspect, the temperature sensing is almost totally useless. They are using a SMT thermistor, carefully calibrated with voltage divider network, etc, but it is on-board. So it's about as useful as a $3 digital desk thermometer from Wal-Mart.

Also, they are using a non-linear, on-board light meter based on an unknown photoresistor with unknown wavelength response. I mean, I could always just use the red LED hooked up to my multimeter, but this project and the OPT101 was supposed to fix the irregularities that you pointed out with that setup.

Then, with the thermistor and light meter taking up 2 of the A/D ports, it seems that there is only one user port left for voltage measurement. On top of that, the manual isn't particularly clear as to whether that voltage data is stored in memory or just updated to the one-line display. If it's just updated, then I have a multimeter already. If it's stored, it may be more useful, but there aren't any instructions in the manual on how to retrieve that data, nor does it state whether you can feed it back through the serial interface real-time.

Now, I'm sure if I were willing to learn to program the AVR series chips, wrote my own program, then finally built on more hardware of my own, I could get it to read 3 separate voltage levels while having it measure light intensity from the OPT101 at the same time.. But that's what Dj's design already does.

I think if Dj's design is lacking anything, it would be two more A/D inputs. Then we could measure Iin, Vin, Iout, Vout, Lux and Temp simultaneously. But in the meantime, I'll "settle" for Lux, Vin, Iin, Iout and Vout for my light tests.

pb


----------



## Ralf (Jan 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Its easy,

folks who don't wan't to learn programming uCs just
use DJs cpfLoggerlite. The ones who still can programming
will likely use there existing equipment (actually I have
the AVR flow running here). So everyone is served.

This thread is a big help in getting ideas done the
right way and for those who don't want to do their
own. I think there will be soon assembled and programmed
units to buy.

Go ahead. Great job.
cheers
Ralf


----------



## NewBie (Jan 22, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*pbarrette said:*
Hi Newbie,

This really does look like a great little tool at a great price if you plan on doing AVR development. But as an out-of-the-box data logger or even as a roll-your-own kit, it's not as useful as Dj's.

First of all, ignoring the programming aspect, the temperature sensing is almost totally useless. They are using a SMT thermistor, carefully calibrated with voltage divider network, etc, but it is on-board. So it's about as useful as a $3 digital desk thermometer from Wal-Mart.

Also, they are using a non-linear, on-board light meter based on an unknown photoresistor with unknown wavelength response. I mean, I could always just use the red LED hooked up to my multimeter, but this project and the OPT101 was supposed to fix the irregularities that you pointed out with that setup.

Then, with the thermistor and light meter taking up 2 of the A/D ports, it seems that there is only one user port left for voltage measurement. On top of that, the manual isn't particularly clear as to whether that voltage data is stored in memory or just updated to the one-line display. If it's just updated, then I have a multimeter already. If it's stored, it may be more useful, but there aren't any instructions in the manual on how to retrieve that data, nor does it state whether you can feed it back through the serial interface real-time.

Now, I'm sure if I were willing to learn to program the AVR series chips, wrote my own program, then finally built on more hardware of my own, I could get it to read 3 separate voltage levels while having it measure light intensity from the OPT101 at the same time.. But that's what Dj's design already does.

I think if Dj's design is lacking anything, it would be two more A/D inputs. Then we could measure Iin, Vin, Iout, Vout, Lux and Temp simultaneously. But in the meantime, I'll "settle" for Lux, Vin, Iin, Iout and Vout for my light tests.

pb 

[/ QUOTE ]


With very little skill, a person could twist up two strands of magnet wire and remotely locate the +/- 1C accuracy thermistor. Or they could buy a cheap thermistor with the same resistance and temperature co-efficient.

You could replace the CdS with whatever light sensor circuit you wanted.

Many code kiddies could figure out how to program the AVR, and there are pre-made examples on how to pass the data through RS-232. There is also a huge online board with plenty of folks willing to guide you and assist when you have problems. www.avrfreaks.com 40,000 active users, and 3,000 daily hits, +130,000 posts and over 23,000 topics.

You'll also notice it has a UART and designed to be connected to a RS-232 serial port (standard computer serial port), page 23, http://www.atmel.com/dyn/resources/prod_documents/doc4271.pdf This can also be utilized to program the part.


----------



## djpark (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
suppose your data file is named qwe. create a controlfile controlqwe with the following inside
set xdata time
plot 'qwe' using 0:1
pause 10
reread


[/ QUOTE ]

Ralf,

I have been using gnuplot for many years to generate dynamic chart for web pages, but haven't used it to generate (semi) real time charting on win32. But as I tried, it seems working very fine.

I will add an option to PC version of software to generate white space delimeted text file rather than comma since gnuplot wants it. Or is there an option to tell gnuplot to use comma (,) as delimeter instead of white space?

For different usage/configuration of logging, create different control file, a good and working idea. How do I pass the data file name to a control file?

BTW, your url has double http:// tag and it causes error.

-- dj


----------



## djpark (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Newbie,

The avr kit seems very interesting and surely I hope to learn to use avr some day. Meantime, I am just starting to use PIC and will provably use it for a while.

You have been providing much valuable information to cpfers in many areas and we are very grateful to your effort. For those who can't get enough with this simple logger, how about you providing a simple program so that cpfers can have different options?

--dj


----------



## djpark (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

This is additional information on the cpf-logger concerning timer calibration.

The PIC12F675 datasheet mentions that the internal RC oscillator is factory calibrated within 1% accuracy. From my experience with a few different chips, I got 0.3 - 0.5% time drift.

<font class="small">Code:</font><hr /><pre>time = 2005-01-18,19:22:38 (16695 seconds elapsed)
record = 16633 (-63 of 16695 seconds -0.38% drifted)</pre><hr />

This statement was added at the end of the logging when ctrl-c is pressed. Your PIC will give you different value. That means PIC generated 16633 records (16632 seconds) during the time of 16695 seconds (measured by PC), so 63 records less giving 0.38% slower timing.

This can be corrected by changing 1 byte in the eeprom data of the PIC. You can follow this calculation.

Each instruction cycle of PIC runs 1/4 of the clock speed and in this case it is 1usec from 1MHz. Without going through the detail explanation, fill the figure in this fomular. The idea is to make the timer interrupt to happen faster or slower.

63 / 16695 * 1000000 usec / 8 / 8 = 58.96 rounded to 59

Replace the value 63 and 16695 from your own logging result.

Then insert this value into the variable in the cpf-logger-lite-pic.c program. It is at the beginning of the program.

<font class="small">Code:</font><hr /><pre>#rom 0x2100 = { 59 } // compensate (make it faster)
#rom 0x2101 = { 0 } // compensate (make it slower)</pre><hr />

If your PIC is going too fast and want to slow down, insert the calculated value at 0x2101 location instead.

For those who doesn't have the compiler but have PIC programmer, you can manually insert this value at the location 0 or 1 of the built-in data eeprom flash respectively before you program.

Another thing to remember is that PIC12F675 has OSCAL (factory OSC calibration data) located at the end of program flash (location 0x03ff) and it needs to be preserved during the programming into PIC. Most modern programmers do this, or else you need to read this location manually and isnert into the hex file to burn.

After this calibration, this is what I get.

<font class="small">Code:</font><hr /><pre>time = 2005-01-24,15:55:59 (11544 seconds elapsed)
record = 11544 (-1 of 11544 seconds -0.01% drifted)</pre><hr />

Just 1 second short during 3 hours logging and it is 0.01% error. I think I will just keep it at this value.

-- dj


----------



## Ralf (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

djpark,

As of my knowledge, Gnuplot has no option for "," 
but in the unix way you could just use awk or perl
to preprocess the file .

But it would be great if your pc software would have
the option for " " as delimiter ... 

Cheers 
Ralf


----------



## PEU (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Dj,

Can you post the modified HEX file? I'll have my pic programmed by a friend this week.

Thanks


Pablo


----------



## djpark (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
Can you post the modified HEX file? I'll have my pic programmed by a friend this week.


[/ QUOTE ]

Different PIC has different clock oscillator speed and needs to be calibrated individually. So the value I used is specific to the PIC I am using and yours will have different value.

So it has to be programmed with 0 modifier and run for a while to find out the drift. Then calculate using the method I posted and reprogram the same PIC with timer modifier.

You don't need to make another hex file, you can just insert the new value during the programming. Don't forget to convert to hex value from the calculated decimal value.

-- dj


----------



## bikeNomad (Jan 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*pbarrette said:*
Hi all,

When I sourced the SMT components I did my best to keep the prices low and the sizes high. I know that some of you don't do much soldering with SMT components, so that was a factor in the Digikey sourcing.

The resistors are all 1206 cases, while the smallest component (for soldering purposes) is probably the SOT-23 diode package. A good photo guide to these sizes is here to give you an idea of the sizes.


[/ QUOTE ]
How did you get such huge components? It's growing increasingly difficult to find capacitors, especially, in 1206 packages. You can still get high-power resistors (0.25W /ubbthreads/images/graemlins/grin.gif) in that size, but it's really hard to find the usual caps like 100nF or even 10nF in 1206 packages. I find that I'm usually getting 0603 caps and longing for the good old days of the big 0805 packages.
[ QUOTE ]

I find that with an X-acto knife or a micro screwdriver, I can pretty easily solder these components in place. However, if your hand isn't as steady (like mine when I've had too much coffee), using one hand to hold the soldering iron, while resting your wrist on your fist works pretty well. You can also use a small dab of superglue to hold the component in place while you solder, just be careful of the fumes. Normally, I scrape some of the adhesive from a post-it note with my X-acto and use that to hold the component, but it isn't as secure.


[/ QUOTE ]
A couple of handy tricks:

<ul type="square">[*] You can make a component holder for SMD soldering easily. Just drill a hole in a piece of wood and use a piece of bent wire to hold the components down:





[*] Bigger components can be held on with "tack'n'stick" or "blue tack" rubber adhesive stuff.
[/list]


----------



## pbarrette (Jan 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi BikeNomad,

Re - "Huge" components..
Digikey. I just did a parametric search for capacitors/resistors of the specified values and waded through the pages of components to find a decent mix of size vs price.

I still hate the fact that Digikey lets you sort by almost everything except price. I'm usually willing to sacrifice, say, .01-Vf on a diode if one is $.50 and the other is $5. That lack of price sorting is usually what ends up taking the longest when looking through Digikey.

pb


----------



## cgpeanut (Jan 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I've revisted the CPF-LOGGER-Lite GUI build in linux and added a setup button that would allow you to change pre-determined values using slider buttons.

Basically you would be presented with the main program and when the setup button is pressed, a new window pops up which will allow you to change vref, baud rate etc.

But then half way through coding, it occurred to me we can all do this from the command line /ubbthreads/images/graemlins/frown.gif maybe to much work for just a little eye candy?


----------



## Ralf (Jan 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I just thinking of building my own one,
but I cannot find this OPT101 Sensor over
here in Germany in single Quantities for hobbiests ...

Is there an alternative?

Cheers
Ralf


----------



## PEU (Jan 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I asked TI for samples, and those were sent to a friend in Miami who forwarded them to me a week ago. 
You should be able to ask for samples form Germany I guess

You can fill your order with li-ion charge regulators, step-ups, etc (hint hint)

This is what I asked:

Part Number Qty Status
BQ24003PWP 5 5 items shipped on 1/7/2005
OPT101P 5 5 items shipped on 1/7/2005
TPS1101D 5 5 items shipped on 1/7/2005
TPS61020DRCR 5 5 items shipped on 1/7/2005
TPS61030PWPR 5 5 items shipped on 1/7/2005
TPS61030RSAR 5 5 items shipped on 1/7/2005
TPS72501DCQR 5 5 items shipped on 1/7/2005
TPS73601DBVR 5 5 items shipped on 1/7/2005

step up regulators, mosfets, opt101 and some li-ion chargers /ubbthreads/images/graemlins/smile.gif

OPT101 page 


Pablo


----------



## Ralf (Jan 29, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Thanks Pablo,

Just ordered five samples of the OPT101, hope they
find their way to germany . Maybe I have to pay
customs, but it should not be to high ...

If this does not work out, I found the OPT101 at the
commercial distributors Spoerle, Farnell etc. but at
a price tag of 8EUR for 1pcs.

I ordered the SMD version and I like to give the sensor
an extra pcb. Then it is possible to mount the sensor 
at a wall etc. ...

Cheers
Ralf


----------



## Ralf (Jan 30, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@pbarette,

To draw a ground plane ... Just draw a Polygone,
were you like to have your ground plane. Then
do the Ratsnest command. If you like your resulting
plane connected to e.g. GND net, just do a NAME command
and select your ground plane ...

I took me a rather long time to figure this out /ubbthreads/images/graemlins/rolleyes.gif

Cheers
Ralf


----------



## dat2zip (Jan 30, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK, I'm back from Shot Show.

Is there still interest if I make some boards or is everyone just on their own?

What sayeth ye?


----------



## TORCH_BOY (Jan 30, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Interesting circuit,


----------



## cgpeanut (Jan 31, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Wayne,

I would like two please.


----------



## cgpeanut (Feb 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yippee!! /ubbthreads/images/graemlins/grin.gif

Got my cpf-logger circuit done, 






It was not as hard as it seems but be prepared, took me almost 4 hrs. 






On the upper right is the LT4054 li-on charger which will be hooked via detachable jumper wires to the cpf-logger.






I've also made provisons to build the POP-L circiuit on the space provided on the lower right.

And yes most parts are SMD components except for the (2) 10uF caps and voltage regulator. Got some smd caps and 78L05's on order and will make another one with all SMD's

Those smd resistors are really small I think I inhaled a few when I was building the circuit,

@DJ,

I also ported the pc logger code to run the officiial Solaris 10 release running on a sun ultra 10 at home. Figured will run it 24x7 in a web server configuration using Perl, apache, gnuplot, rrdtool, mysql etc but that's another project /ubbthreads/images/graemlins/grin.gif

And yes I got the VisualBasic development suite and may try to develop the GUI in VB maybe /ubbthreads/images/graemlins/smile.gif

I'll be out of touch the rest of the day attending an oracle developers conference will check back later tonight.


----------



## pbarrette (Feb 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Wayne, all,

If you're still interested in making the boards, I'm certainly in.

I'm also in for a pre-programmed PIC, if that idea still has life. I think it was cgpeanut who was offering that one.

I don't recall if there was a whole parts package kit or not. I'm in for that if it exists, but no problem if not. I have some other stuff to order on Digikey either way.

pb

EDIT: Forgot to mention.. On boards/pics/etc I'm in for 2 if it's still going forward.


----------



## djpark (Feb 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Roberto,

You really take the making seriously with all the smt caps. I always try to go simple with common things I can get.

I will add an option to the logging host program to use white space as field delimeter instead of the current coma. This will allow the drawing of the chart (almost) real-time using gnuplot, thanks to Ralf's help to guide me to get it done.

To all:
Ralf is also working on his AVR version which is equivalent to my PIC version. By using the same data output format, the host program can use either one. This is a good news to many AVR users in cpf.

He will either post here or start a new thread. So watch the thread for his announcement.

-- dj


----------



## cgpeanut (Feb 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yes, I'm still interested in Wyanes' boards. I'd like two please /ubbthreads/images/graemlins/smile.gif also I think klaus wants one aswell.

and Yes I'd be happy to program the pic 12F675's, I have 5 PDIP's on hand right now and can order some more just pm and let me know.

DJ, the proto board I got was designed for smd's it's a lot easier for me to do since I'm familiar with the boards layout, plus I have the benefit of adding other circuits aswell, maybe a smart charger based on microchip's mcp7384x hint, hint. /ubbthreads/images/graemlins/grin.gif


----------



## dat2zip (Feb 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK, here's the final draft of the PCB. I added the serial OPT footprint as well as the dip and nuked moving the SMT to the bottomside.






Please review this and let me know if you see any blatent errors. 

It looks like I'll be making 8 total boards. I'd like to keep one, but, it's not manditory. Also, if someone would like to be point man and receive the boards directly, I'd prefer to have them shipped to the point man and that would save me from having to re-ship them.

Wayne

PS. I don't think this is a rush job, so, maybe in a couple days I can place the order. I can do it now if there is a need to have it ASAP. The place I'll be ordering the PCBs I'll be requesting a n 8 day process so it will take ~12-13 Full working days before it arrives on someones doorstep.


----------



## cgpeanut (Feb 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I can be the pointman if there are no objections from the rest of the crew, I can program the pic aswell less shipping I think. 

As far as sourcing the parts if it's only 8 boards I think I can manange that. 

But in your case Wayne no need to send your board to me, just pm and or email your addy and will send you the programmed pic.


----------



## Klaus (Feb 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yes I would want one and :thumbup: @ Roberto for being the frontman !

Klaus


----------



## Ralf (Feb 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@Klaus,

do you still like an AVR Version from me?

Cheers
Ralf


----------



## Klaus (Feb 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
@Klaus,

do you still like an AVR Version from me?

Cheers
Ralf 

[/ QUOTE ]

As I just emailed - Sure !

Klaus


----------



## Ralf (Feb 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

... Just finished the layout for the basic
AVR version and will do the hardware built up
next weekend. Maybe I have time next week for
the software while I am in internetfree holidays ...

Cheers
Ralf


----------



## dat2zip (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Boards are now ordered. Should be here next week some time. Maybe, the 15th or 16th.

From there I'll send them to the distribution point.

Wayne


----------



## djpark (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Updated the cpf-logger-lite-pc.c|exe files a little.

Earlier the current was calculated from the voltage difference between ch2 & ch1, but now it is changed to ch1 & ch2.

Also added -S option to calculate the current from ch2 voltage alone. It is useful to calculate the current flow using MAX471 current sense IC or from prog pin of LTC4054 li-ion charger IC.

3 downloadable files are updated.

cpf-logger-lite-all-10a.zip 
cpf-logger-lite-pc.c 
cpf-logger-lite-pc.exe 

I tried using gnuplot on WinXP and it does plot the chart realtime from the data file being logged using this control file. It is an example of li-ion charging log and you need to change the sample according to your configuration.

<font class="small">Code:</font><hr /><pre>reset
set datafile separator ","
set xdata time
set format x "%H:%M"

set title "18650 Li-Ion Charge Log"
set xlabel "Time (hh:mm)"
set ylabel "Battery Voltage (V)"
set yrange [0 : 5]
set y2label "Charging Current (A)"
set y2range [0 : 5]

plot "18650-c.csv" using 0:6 title "Battery Voltage (V)" with lines 1, '' using 0:10 axes x1y2 title "Charging Current (A)" with lines 2

pause 5
reread</pre><hr />

But once the chart window is moved away from the top, it get locked up. So I need to find some other solution on Win32. UNIX may not have this problem at all.

There are 2 other things I noticed and want to mention related to the operation.

1) When a (reasonably) high voltage is applied to ch1 before the PC logger program starts, the current seems back flowing and powering the PIC, so the PIC may not start correctly.

If this happens, start the PC host program first, then connect the ch1 input source.

2) My Win XP has many different drivers hooking to the serial port usage in daisy chain, some are for USB to serial emulation, serial monitoring and also serial port permission control for MS DOS programs. So depending on which driver is involved, some of the communication program don't work (can't get the serial input).

Most MS library based program such as written in VB seem to work fine, but those based on Unix emulator (cygwin) may have problem (though most users may not see the problem).

A simple "mode" command in the batch file may solve the problem. No such problem is ovserved in Linux/UNIX environment.

<font class="small">Code:</font><hr /><pre>@echo off
mode com1 baud=300 data=8 parity=n > nul
cpf-logger -d %1 %2 %3 %4 %5 %6 %7 %8 %9</pre><hr />

It may sound discouraging, but it is a small hitch which may be applicable to handful of people.

-- dj


----------



## PEU (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ, one question:

I found a USB to RS232 adapter lying around (from a vtech phone) is based on the FTDI FT232 chip, is there a simple way to adapt the logger to use it?

Thanks


Pablo


----------



## djpark (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*I found a USB to RS232 adapter lying around (from a vtech phone) is based on the FTDI FT232 chip, is there a simple way to adapt the logger to use it? 

[/ QUOTE ]

Pablo,

FT232 allows you to emulate a com port from USB so that a serial device can be connected to a USB port. My PIC programmer uses the same chip to emulate a com port on USB connection.

You can download the generic driver from FTDI web site if you don't have one.

http://www.ftdichip.com/FTDrivers.htm 

I don't have a converter so I can't say if it would work, but if you get it working, would you share with others?

-- dj


----------



## cgpeanut (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

To All:

I've received some parts from digikey specifically, 

qty 20, LM78L05, voltage regulator in TO-92 package
qty 20, ED3308-ND, 8 pin IC socket Gold .300 better than rat-shack's /ubbthreads/images/graemlins/smile.gif
qty 30, P11212-ND, cap 25V ELECT FC radial 

I've tred looking for the correct 0.1uF capacitor but failed can anyone inform me of the correct digikey part #? also the part number for the head strip 4 pins.

Now, RS has the big 0.1uF caps in two's per package green in color, should I get those?

Has anyone ordered their free samples fo TI's OPT101 chip? I have the 10 PIC12F675's on hand so we are good on the uMs


----------



## PEU (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

DJ: of course, will try, will tell /ubbthreads/images/graemlins/smile.gif
CG: I have 5 units here, if you cannot order I can mail you one /ubbthreads/images/graemlins/smile.gif

I tought that finding the 12f675 here was an easy task... I found the only place that stocks them today /ubbthreads/images/graemlins/smile.gif

And the comic part, I was about to solder the parts and figured out that I mirrored the PCB /ubbthreads/images/graemlins/banghead.gif


Pablo


----------



## cgpeanut (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@PEU: 

I have 5 OPT101's as well, but figured since we can order free samples
from TI why not? Saves us 5 bucks and TI's shipping is very fast /ubbthreads/images/graemlins/grin.gif

I forgot to mention the db9 female serial port any specifics? Will it be just
the regular type like the one RS carries?

I've built the circuit again on a breadboard will post pics once I got it to work.
I think I crossed some lines aswell, /ubbthreads/images/graemlins/frown.gif Good news is it only took 30 mins to 
layout, I Hope it won't be that long to trouble-shoot
.
I think it's best to use components that will actiually go into the official
cpf-logger board Wayne is making for us.

@DJ, 

Am I correct to assume that power to the logger circuit is derived from 
the serial port or do I have to supply a separate 5V power source?

Hooking it up to the LT4054 charger circuit to log charger activity,

AI-0 to measure the voltage output of the charger
AI-1 to measure the voltage at the PROG pin of the charger
AI-2 to STATUS PIN. and will ignore A-3 since it's fixed to the OPT101 light
sensor. (not needed)

Now just to be clear A-0 refers to pin1 of J2, A-1 pin2 of J2, A-2 pin3 of J2 correct.? 

Once this is done will figure out how to properly calibrate the PIC using
DJ's instructions plan on shipping the kits pre-calibrated. make sense?


----------



## pbarrette (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Cgpeanut,

The BOM I originally came up with was as follows:
10uF Cap - 493-1036-ND (Electrolytic $0.20ea)
.1uF Cap - 399-1644-1-ND (Tantalum, $0.19ea)
1k R - 311-1.0KECT-ND (SMT, 1206 case, $0.078ea, min 10)
10k R - 311-10.0KFCT-ND (SMT, 1206 case, $0.088ea, min 10)
Diode - BAV70FSCT-ND (SOT-23 dual 1n4148, $0.22ea)
Regulator - NJM78L05UA-ND (SOT-89 78L05, $0.39ea)
OPT101 - OPT101P-ND ($5.50ea)
DB9 - 177-809F-ND (right angle pcb mount $5.74ea)
DIP Socket - A24794-ND (8-pin, through hole, $0.36ea)

DJ listed C3 and C4 as being either ceramic or tantalum. I made the BOM as all tantalum to keep the unique parts count low and make it easier for ordering. Dat2zip requested that the 0.1uF caps be changed from tantalum to ceramic. He never specified whether it was just for C3/C4 or all of the 0.1uF caps, so I can't be sure what pads are on the board.

The caps Wayne specified were:
.1uF Cap - 311-1179-1-ND (Ceramic X7R, 1206 case, $0.098, min 10)

The case size on the two different components is roughly the same size. Only the pad lengths are different, so either one should fit on the board. You would have to ask DJ if you can go all Ceramic or all Tantalum for the caps. You should also ask Wayne if he was referring to only C3/C4 or if he meant all of the 0.1uF caps.

Hope this helps,
pb


----------



## cgpeanut (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@pbarrette,

Awesome! I got qty (30) of the Digikey Part #: PCC1870CT-ND which is a 0.1uF cap X7R in 1206 package which I think is the right one.

Thanks for the clarification! Now as far as resistors goes 5 watt regular resistors should work I have them. 

Diodes any type should work I got a bunch of those, I think we are close, just need to get the circuit working and get the parts gellin /ubbthreads/images/graemlins/grin.gif


----------



## djpark (Feb 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Roberto, the power is supplied from the com port through the rectifying diode and 78L05.

A0 is from gp0 and A1 from gp1. So A0 is pin 7 and A1 is pin 6 and so on. The gp0 to gp6 go from pin 7 to 2.

C3 & C4 are decoupling caps and preferably ceramic, but will do with other types. In fact I use anything available including 10uF electrolyte type. On a low current operation, you can even skip it, but for pulse led output it becomes critical to have one.

The rest 0.1uF are for low pass filter and I get reasonable response with 0.1uF and 1k. Again any type will do.

-- dj


----------



## dat2zip (Feb 9, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

This is the BOM from the schematic. You can reference the PCB Footprint column to see what PCB component footprint I used on the layout.

<font class="small">Code:</font><hr /><pre>
Item	Qty	Value	Ref Desigator	PCB Footprint	
1	1	0.1uF C1	SM_1206E_CAP-CHIP_IPC99	
2	1	0.1uF C2	SM_1206E_CAP-CHIP_IPC99	
3	1	0.1uF C3	SM_1206E_CAP-CHIP_IPC99	
4	1	0.1uF C4	SM_1206E_CAP-CHIP_IPC99	
5	1	10uF C5	CYL/D.200/LS.100/.031	
6	1	10uF C6	CYL/D.200/LS.100/.031	
7	1	0.1uF C7	SM_1206E_CAP-CHIP_IPC99	
8	1	0.1uF C8	SM_1206E_CAP-CHIP_IPC99	
9	1	LED D3	LED/T-1-3/4/CATHODE=2	
10	1	BAT54C/SOT	D4	SM/SOT23_321_STD_PINNOUT	
11	1	CON4 J1	BLKCON.100/VH/TM1SQ/W.100/4	
12	1	DB9 J4	CON-DSUB-RP_9-TM_F318	
13	1	1k R1	SM_1206E_CAP-CHIP_IPC99	
14	1	1k R2	SM_1206E_CAP-CHIP_IPC99	
15	1	1k R3	SM_1206E_CAP-CHIP_IPC99	
16	1	10k R4	SM_1206E_CAP-CHIP_IPC99	
17	1	1k R5	SM_1206E_CAP-CHIP_IPC99	
18	1	SW SPST/SM	SW1	BLKCON.100/VH/TM1SQ/W.100/2	
19	1	PIC12F675/8pin	U2	DIP_E100_8-TM_W300_L400	
20	1	OPT101/8 pin	U5	DIP_E100_8-TM_W300_L400	
21	1	OPT101/5 pin/v	U6	BLKCON.100/VH/TM1SQS/W.100/5	
22	1	LM78L05AC/TO92	U7	TM_TO92-3_H031-D200	

</pre><hr />


----------



## cgpeanut (Feb 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Folks,

Here's the parts I'm ordering at Digikey this monday changes, improvements please, post here. I'm building for 8 individual kits.

LM78L05ACZNS-ND Regulator in sot-23 package
LM78L05ACZNS-ND 8 pin socket gold .300 footprint
493-2431-1-ND 0.1µF CAP TANTALUM 0.1UF 35V 20% SMD
P11212-ND CAP 10UF 25V ELECT FC RADIAL
WM6404-ND CONN HEADER 4POS .100 VERT TIN
432-1153-ND SWITCH TOGGLE SPDT 5A SLDR LUG
BAV70FSCT-ND DIODE ULTRAFAST HI COND SOT-23
177-809F-ND CONN DB9 FEM .590" RA MET SHELL

Are we set on regular 5 watt resistors? no Biggie the 311-1.0KECT-ND and
LM78L05ACZNS-ND are like $.76 for a pack of 10.

did I miss anything?

Also, will get the RS case locally, I have one to check for form and fit once I get the boards.


----------



## PEU (Feb 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

In case someone needs to program the 12F675 I just finished testing this programmer: http://feng3.cool.ne.jp/en/rcd.html its very easy and it works /ubbthreads/images/graemlins/smile.gif

Now that I have the PIC programmed, next step is the datalogger /ubbthreads/images/graemlins/smile.gif


Pablo


----------



## cgpeanut (Feb 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

cool PEU, does it work in linux? how are you sending the hex file to the chip?


----------



## pbarrette (Feb 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Cgpeanut,

The 7805 regulator Wayne used for the board layout is a TO-92 case as opposed to an SOT-23, or the SOT-89 originally specified. More like Digikey # LM78L05ACZFS-ND

I'm a bit confused about the "5 watt resistors" bit. I'm thinking that 5 watt resistors are probably overkill and would likely be far too huge to fit the 1206 footprint on the board. The "311-1.0KECT-ND" part number you have listed would work great for the 1k's while "311-10KECT-ND" would be good for the 10k's.

So a proper translation from Wayne's BOM to Digikey friendly format would go something like this:
<font class="small">Code:</font><hr /><pre>+-------------------+------+-------------------+----------+
|Item | Qty | Board Designator | Price |
+-------------------+------+-------------------+----------+
|311-1179-1-ND | 6 | C1 C2 C3 C4 C7 C8 | 0.098 |
|493-1077-ND | 2 | C5 C6 | 0.20 |
|5mm LED | 1 | D3 | N/A |
|BAV70FSCT-ND | 1 | D4 | 0.22 |
|A19372-ND | 1 | J1 | 0.31 |
|177-809F-ND | 1 | J2 | 5.74 |
|311-1.0KECT-ND | 4 | R1 R2 R3 R5 | 0.078 |
|311-10KECT-ND | 1 | R4 | 0.078 |
|CH760-ND | 1 | SW1 | 0.73 |
|A24794-ND | 2 | U2 U5 | 0.36 |
|A19373-ND | 1 | U6 | 0.39 |
|LM78L05ACZFS-ND | 1 | U7 | 0.47 |
+-------------------+------+------------------------------+</pre><hr />

I have made some changes to the components you listed above:
1) The 8 pin DIP socket is the same Digikey part # you show for the regulator.
2) The 0.1uF ceramic capacitors are much cheaper.
3) The P11212-ND electrolytic is not in stock.
4) The WM6404-ND pin header is not in stock.
5) The rocker switch is much cheaper.

I also left out the part number and costs for a 5mm LED. I'm sure, as CPF'ers, we should all have some of those lying around. /ubbthreads/images/graemlins/smile.gif

If Wayne or Dj have no objections, then this should be the final Digikey BOM for all parts on Wayne's board.

For a quantity of 8 components, the cost comes to $77.35 which makes for $9.67 per board (minus shipping) for the components themselves without the PIC. Obviously, that figure should be increased to offset cgpeanuts time and trouble, additional shipping, etc.

The complete components order for 8 boards can be found here under WebID 6083164 AccessID 36500 for the next 30 days (after which Digikey automatically deletes it).

Hope this helps,
pb


----------



## PEU (Feb 12, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I used a program called winpic (linked in that page) but Im sure there must be a linux prog capable of doing the job, since this programmer is compatible with a very popular one called JDM or com84.

Pablo


----------



## dat2zip (Feb 13, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

pb,

I have no objections. I just hope I drew the schematic correctly and there are no PCB errors.

I'm thinking the boards should be here as soon as Monday or anytime tues/wed.

If the boards are majorly wrong, I'll be glad to fix the problem and redo the boards over again.

Wayne


----------



## cgpeanut (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Ordered the parts /ubbthreads/images/graemlins/smile.gif thanks pb you made it a lot simplier /ubbthreads/images/graemlins/happy14.gif

1,10,A19373-ND,CONN HEADER VERT 5POS .100 TIN,,0,0.39000,$3.90000
2,20,A24794-ND,CONN IC SOCKET 8 POS DIP 30AU,,0,0.28800,$5.76000
3,10,LM78L05ACZFS-ND,IC REG 0.1A 0-125DEG C TO-92,,0,0.47000,$4.70000
4,10,CH760-ND,SWITCH ROCKER SPST BLK 10A QC TE,,0,0.64800,$6.48000
5,20,311-10KECT-ND,RES 10K OHM 1/4W 5% 1206 SMD,,0,0.07800,$1.56000
6,50,311-1.0KECT-ND,RES 1.0K OHM 1/4W 5% 1206 SMD,,0,0.04220,$2.11000
7,8,177-809F-ND,CONN DB9 FEM .590" RA MET SHELL,,0,5.74000,$45.92000
8,10,A19372-ND,CONN HEADER VERT 4POS .100 TIN,,0,0.31000,$3.10000
9,30,BAV70FSCT-ND,DIODE ULTRAFAST HI COND SOT-23,,0,0.16200,$4.86000
10,100,311-1179-1-ND,CAP .10UF 50V CERAMIC X7R 1206,,0,0.05950,$5.95000
11,20,493-1077-ND,CAP 10UF 35V ELECT VR RADIAL,,0,0.12400,$2.48000
12,1,AC163021,KIT ADAPTER SOT23-6 TO 8P DIP,,0,12.00000,$12.00000


----------



## PEU (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I just finished assembling the board, but I cannot make it work /ubbthreads/images/graemlins/frown.gif

Led turns on, PIC was programmed and verified twice, I even found an error in the posted schematic that already corrected.

Im using winXP and this commandline:

cpf-logger-lite-pc zzz.txt

logger is connected to COM1

any ideas?


Thanks


Pablo


----------



## cgpeanut (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

PEU,

Just out of curiousity what's the diode you used for U3? My first version did
not work as well and I suspect it was the regular RS zener diode I'm using,

I'm getting NO output at all, the led shines brightly, and if I disconnect the
serial port's GND and press the reset switch it flashes.

Tried using the -r option for raw output still no luck.

I'm building another one (almost complete) but this time I'm using SMT 
Zener Diode BZX84-C5V6 5.6v from my parts bin got this diode from 
ebay search SMT Zener Diode Design Kit



.


----------



## PEU (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

zeners? I used 1n4148 for d1 and d2, I see no zeners in DJ's schematic

Pablo


----------



## dat2zip (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Here's an update.


----------



## PEU (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

wow, very nice pcbs, where are they made?


Pablo


----------



## cgpeanut (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@PEU,

I used 1N914/4148-Type Diode from radio shack as well, RS Catalog number 276-1122 on the first attempt. I thought it said zener diode on the package but I threw it away and can't find it. /ubbthreads/images/graemlins/frown.gif 

oh well, too late now for the BZX84-C5V6 5.6v, soldered it on the proto-board already. Guess I'll find out tonight if it works or not.


----------



## djpark (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
I just finished assembling the board, but I cannot make it work /ubbthreads/images/graemlins/frown.gif

Led turns on, PIC was programmed and verified twice, I even found an error in the posted schematic that already corrected.

Im using winXP and this commandline:

cpf-logger-lite-pc zzz.txt

[/ QUOTE ]

Pablo,

I understand how you feel when something you made didn't work as expected. Let me try to figure out with you. There are quite a few possible reasons, so we go along the ladder.

You need to identify if the non-functioning part is the PIC of PC. 

1) The led is connected from PIC output to PC serial port. If the PIC is working, you shall see 1 flashing of the led per second or 8 flashings per second depending on the toggle switch position. If the led is constantly on, something is not right with PIC part. If PIC is ok, skip to 7).

2) If the PIC is not working, first check the power supply to PIC by measuring the voltage between pin 1 (+) and pin 8 (-). It should be around 5V from 78L05. If ok, skip to 6).

* Edit: *_ pin 1 and pin 8 corrected _

3) If there is no power to PIC (and no short circuit), check input side of 78L05. It should be between 5V and 12V).

4) If there is no power input to 78L05, check the voltage to the diode input (in case blown or reverse) from DTR and RTS.

5) If there is no voltag to the diode input, check the com port wiring or cable.

6) If PIC is getting correct power supply (and the circuit is correct), you need to check if you included OSCAL value to the PIC. *This issue was mentioned in my previous post and I repeat again since it is very important.*

PIC12F675 has internal RC oscillator factory calibration value stored in the program flash location 0x03ff and you are supposed to read this value before you program the PIC and write back while you are programming the PIC.

Also you need to insert the value 0x34 in to the program flash location 0x03fe to get this calibration to work correctly.

The default value from the hex file for these two consecutive bytes are 0x3f, 0xff and you need to change it to 0x34, 0xNN (NN = OSCAL, the original value you read from the PIC) before you program the PIC.

I've seen the OSCAL value ranging from 0x60 to 0xa0. If this value is not correct, the output baud rate is also out and the PC serial port can't recognize the input. When the value is too out, the PIC may not work at all.

Somehow if you have already erased this value and programmed the PIC without it, you may want to try out 0x80. If the PIC seems working and yet no serial input to PC, you may need to change this value a little to see if it helps.

Now check the PC side. I assume that the led is flashing as explained in 1).

7) Most recent PC serial port hardware can work well with the low voltage input which is not compliant to the RS-232 standard. So the TTL output from the PIC through the low Vf red LED will work fine.

If you suspect the voltage is too low, try to short the led and test again.

8) On Windows machine, there can be many drivers linked to the serial port and some programs don't seem to work correctly. I mentioned this issue in my previous post also. I am suffering from this now.

On such PC configuration, most programs produced using MS compilers or using MS driver seem to work fine, but those third party software like the CYGWIN I use may have problem.

We can confirm this by using a terminal emulation program on PC. Start your faviorite program such as hyper terminal (yuk! I use CRT) and set to the correct com port, 9600,N,8,1 parameter.

If you see the incoming data, skip to 11).

9) Some PC communication program insist on the hardware handshake and you will need to fool the system th believe it is ok. So you need to join RTS & CTS, DTR & DSR.

10) As explained in 6), the wrong OSCAL value in PIC may produce wrong baud rate. This can be measured with a scope. We can also try to confirm this by using a terminal emulation program on PC.

Change the baud rate to another setting and see if you get a garbage input. Rotate through the all baud rate you have and try again. If you get something, it may say the OSCAL is incorrect. In this case, go back to 6).

11) If the driver seems problem, try resetting the com port by using the mode command. To me, this always works.

mode com1 baud=300 data=8 parity=n

Then start cpf-logger program again. If this works, you can create a batch file like this.

@echo off
mode com1 baud=300 data=8 parity=n > nul
cpf-logger -d %1 %2 %3 %4 %5 %6 %7 %8 %9

I hope this can help. If it doesn't work still, we will see where else we can check.

-- dj


----------



## PEU (Feb 14, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

WOW, lots of tests to do, I did not touched the oscal so maybe there lays the problem. 

Tomorrow I'll go thru the whole procedure again, and will try to use a terminal under DOS so no windows interferences.

big thanks


Pablo


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Well, did some tests:

7805 has 7.5v at the input
pic is getting regulated 5v

regarding oscal, winpic takes care of not messing with it, so far 3 pics I tried had these values at position 03fe/ff:

342C, 3420 and 3430, I even messed with the 2C one and reprogrammed to 80 as you suggested (probably I ruined this pic /ubbthreads/images/graemlins/smile.gif )

well still no go, next tests in the pipeline are going to be made with a DOS terminal.

Pablo


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

tried with DOS terminals and I get nothing /ubbthreads/images/graemlins/frown.gif not even garbage input.

Maybe is time to recheck the whole circuit. I used .01uF ceramic capacitors instead of 0.1uF but I guess this is no problem, if this is the suspect, then I promise 100 x /ubbthreads/images/graemlins/banghead.gif


Pablo


----------



## djpark (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Pablo,

From your post, I presume the led is blinking once per second or 8 times per second. If not, there is no point trying DOS or anything else.

Your OSCAL value is rather small compared to those I've seen -- 0x80 to 0xa4. Changing 0x80 to 0x90 can make baud rate out.

Could you confirm the result of each steps I mentioned in the post?

-- dj


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

1) The led is connected from PIC output to PC serial port. If the PIC is working, you shall see 1 flashing of the led per second or 8 flashings per second depending on the toggle switch position. If the led is constantly on, something is not right with PIC part. If PIC is ok, skip to 7).

* led does not flash, its on all the time *

2) If the PIC is not working, first check the power supply to PIC by measuring the voltage between pin 8 (+) and pin 1 (-). It should be around 5V from 78L05. If ok, skip to 6).

* measured 4.97v between pic pins 1&8 when running your cpf logger program, otherwise is -0.5v*

3) If there is no power to PIC (and no short circuit), check input side of 78L05. It should be between 5V and 12V).

* measured 7.5v at the 7805 input *

4) If there is no power input to 78L05, check the voltage to the diode input (in case blown or reverse) from DTR and RTS.

* verified in point 3 *

5) If there is no voltag to the diode input, check the com port wiring or cable.

* verified in point 3 *

6) If PIC is getting correct power supply (and the circuit is correct), you need to check if you included OSCAL value to the PIC. This issue was mentioned in my previous post and I repeat again since it is very important.

PIC12F675 has internal RC oscillator factory calibration value stored in the program flash location 0x03ff and you are supposed to read this value before you program the PIC and write back while you are programming the PIC.

Also you need to insert the value 0x34 in to the program flash location 0x03fe to get this calibration to work correctly.

The default value from the hex file for these two consecutive bytes are 0x3f, 0xff and you need to change it to 0x34, 0xNN (NN = OSCAL, the original value you read from the PIC) before you program the PIC.

I've seen the OSCAL value ranging from 0x60 to 0xa0. If this value is not correct, the output baud rate is also out and the PC serial port can't recognize the input. When the value is too out, the PIC may not work at all.

Somehow if you have already erased this value and programmed the PIC without it, you may want to try out 0x80. If the PIC seems working and yet no serial input to PC, you may need to change this value a little to see if it helps.

Now check the PC side. I assume that the led is flashing as explained in 1).

* checked as previous post, brand new pics, never programmed give these OSCAL values: 3420 / 3424 / 342C . Im using winpic to read/program/verify the PIC and this program takes special care of the OSCAL value, you need to specifically instruct it to overwrite oscal values, if not it reads and then restores the factory setting*

7) Most recent PC serial port hardware can work well with the low voltage input which is not compliant to the RS-232 standard. So the TTL output from the PIC through the low Vf red LED will work fine.

If you suspect the voltage is too low, try to short the led and test again.

*tried this, no results *

8) On Windows machine, there can be many drivers linked to the serial port and some programs don't seem to work correctly. I mentioned this issue in my previous post also. I am suffering from this now.

On such PC configuration, most programs produced using MS compilers or using MS driver seem to work fine, but those third party software like the CYGWIN I use may have problem.

We can confirm this by using a terminal emulation program on PC. Start your faviorite program such as hyper terminal (yuk! I use CRT) and set to the correct com port, 9600,N,8,1 parameter.

If you see the incoming data, skip to 11).

9) Some PC communication program insist on the hardware handshake and you will need to fool the system th believe it is ok. So you need to join RTS & CTS, DTR & DSR.

10) As explained in 6), the wrong OSCAL value in PIC may produce wrong baud rate. This can be measured with a scope. We can also try to confirm this by using a terminal emulation program on PC.

Change the baud rate to another setting and see if you get a garbage input. Rotate through the all baud rate you have and try again. If you get something, it may say the OSCAL is incorrect. In this case, go back to 6).

11) If the driver seems problem, try resetting the com port by using the mode command. To me, this always works.


*any ideas?*


Pablo


----------



## djpark (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
1) The led is connected from PIC output to PC serial port. If the PIC is working, you shall see 1 flashing of the led per second or 8 flashings per second depending on the toggle switch position. If the led is constantly on, something is not right with PIC part. If PIC is ok, skip to 7).

* led does not flash, its on all the time *

[/ QUOTE ]

The PIC is not working. If it is working, it should be flashing as it sends data to PC.

[ QUOTE ]
2) If the PIC is not working, first check the power supply to PIC by measuring the voltage between pin 8 (+) and pin 1 (-). It should be around 5V from 78L05. If ok, skip to 6).

* measured 4.97v between pic pins 1&8 when running your cpf logger program, otherwise is -0.5v *

[/ QUOTE ]

I made a wrong statement about the pin. Pin 1 (top-left) is Vdd (+) and pin 8 (top-right) is Vss (-). I will edit to correct my previous post.

* I am sure you did correctly, but just in case, can you confirm if the pins are correct? *

Also the serial output is on gp5 which is pin 2 of the PIC.

-- dj


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yes, I measured PIC voltages using the ground from 7805 hole (Im using the to220 version) and yes, 4.97v was readed on pin1.

also pin2 is connected directly to the LED and then to the rs232 port (DB9 pin3)


Pablo


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Doubting of my pcb design abilities /ubbthreads/images/graemlins/smile.gif I remade the circuit in a protoboard.

for testing purposes I put the led to gnd instead of the rs232 rx data, and powered it from an external 7805 based power supply.

well, the led blinks /ubbthreads/images/graemlins/smile.gif


then I redid the whole circuit taking power from the port, the led stays on all time /ubbthreads/images/graemlins/frown.gif


and then, BINGO /ubbthreads/images/graemlins/smile.gif your schematic is wrong: in a DB9 connector RX is pin 2 and not pin3 /ubbthreads/images/graemlins/wink2.gif

now I need to log, it seems the port hang up /ubbthreads/images/graemlins/smile.gif


Pablo


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

# time = 2005-02-15,18:09:30
# log file = zzz.txt (1 sec interval)
# voltage reference = 5.000
# adc max counter = 4092
# light max counter = 4092
# current sense resistor = 0.160

Time,A1,A2,A3,A4,V1,V2,V3,V4,C,L
0.00:00:01,0194,0178,0192,0299,0.237,0.217,0.235,0.365,0.122,7.0
0.00:00:02,0252,0235,0250,0298,0.308,0.287,0.305,0.364,0.130,7.0
0.00:00:03,0279,0273,0279,0302,0.341,0.334,0.341,0.369,0.046,7.0
0.00:00:04,0322,0314,0322,0303,0.393,0.384,0.393,0.370,0.061,7.0
0.00:00:05,0359,0357,0366,0302,0.439,0.436,0.447,0.369,0.015,7.0
time = 2005-02-15,18:09:35 (5 seconds elapsed)
record = 5 (-1 of 5 seconds -20.00% drifted)
logged = 5 records at 1 seconds interval





(not the posted data)


/ubbthreads/images/graemlins/grin.gif



I just swaped pin 2&3 in the etched board connector and it worked.

THANKS DJ /ubbthreads/images/graemlins/happy14.gif

Pablo


----------



## djpark (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

That's true. I actually made a mistake in the serial port TX pin. It shall be connected to 2.

I am glad you made it working. Have lots of fun.

-- dj


----------



## PEU (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Time is not stamped when the logger is in 8 samples per sec, I dont know if this is a bug or a feature /ubbthreads/images/graemlins/smile.gif

EDIT: looked at the C code, is a feature.

again: THANKS DJ /ubbthreads/images/graemlins/happy14.gif


Pablo


----------



## dat2zip (Feb 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Where do I send the boards?

If I can get a destination address I'll try to plop the boards in the mail tomorrow. You can PM me or drop me an email.


----------



## cgpeanut (Feb 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Send them to me if there are no objections from fellow cpfer's, I ordered all the parts necessary from digikey and have the pre-programmed PIC12F2675

Do we need to modify the board in anyway to account for the schematic mishap i.e: move pin3 of the db9 to pin2?

I've tried this last night and did not get the blinking led so something else is wrong on my protobuild, will have to double check and go through the diagnostics DJ posted tonight /ubbthreads/images/graemlins/frown.gif I have NO doubt DJ's design is sound I've build a few of his designs before it's my soldering skills and electronic background that's the culprit here /ubbthreads/images/graemlins/hahaha.gif I blame it on my poor eyesight!

It would be nice to build one real quick using your board Wayne and post here for additional info for fellow cpfer's benefit, 

As far as parts cost is concerend just pay me for the actual cost of the parts plus shipping that should cover it, 

@DJ,

I'm sending you a complete kit just because /ubbthreads/images/graemlins/grin.gif

@Wayne, 

email sent for my addy


----------



## PEU (Feb 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

After 17hs of logging the logger only drifted -0.63%

These are the first/last lines of the log:

# time = 2005-02-15,20:16:39
# log file = zzz.txt (1 sec interval)
# voltage reference = 5.000
# adc max counter = 4092
# light max counter = 100
# current sense resistor = 0.160

Time,A1,A2,A3,A4,V1,V2,V3,V4,C,L
0.00:00:02,0000,0000,0000,0005,0.000,0.000,0.000,0.006,0.000,5.0
.
.
.
0.17:26:24,1805,1031,0774,3511,2.206,1.260,0.946,4.290,5.911,3511.0
time = 2005-02-16,13:49:39 (63180 seconds elapsed)
record = 62783 (-398 of 63180 seconds -0.63% drifted)
logged = 62783 records at 1 seconds interval

command line was: 

cpf-logger-lite-pc -l 100 zzz.txt

I quite don't understand all the commandline options /ubbthreads/images/graemlins/smile.gif


Pablo


----------



## pbarrette (Feb 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hmm..

Regarding alteration of Wayne's boards..

It looks as though the LED is feeding into the DB9-pin3 as per the original schematic, and needs to be feeding into DB9-pin2 as Pablo pointed out.

If I am reading Wayne's images correctly, the DB9-pin2 lead is not connected to the ground plane around it. Additionally, DB9-pin3 is not connected to any other parts of the circuit. This means that modification of the board should be pretty simple. Swapping pins 2 and 3 means that the LED would be connected to pin-2 while pin-3 would be left hanging.

The simplest modification would be to solder the DB9 connector to the board as though nothing was wrong. Then use more solder to bridge pins 2 and 3 on the board. Finally, clip the lead to pin-3 above the solder joint so it no longer connects to the DB9 connector.

This would reroute the LED's connection to DB9-pin2 and leave DB9-pin3 hanging, as per the revised schematic.

Anyone see any blatant errors in that logic?

-------------------------

While I was looking closer at the DB9 pinouts, it seems to me that DB9-pin5 on Wayne's board is also isolated and hanging in space. According to the schematic (and the RS232 standard), DB9-pin5 should be grounded.

Wayne. Can you verify whether or not DB9-pin5 is free-hanging or grounded? The images you posted don't have a high enough resolution for me to be certain.

If it isn't connected to ground, this is an even simpler fix. The ground-plane runs all around DB9-pin5. Scraping off some of the solder mask on the ground-plane near the pin and soldering from the DB9-pin5 location to this would fix the problem.

pb


----------



## PEU (Feb 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Closed unit: 











Used an old Carver audio box, and covered the OPT101 with a piece of cd acrilic case hotmelted inside /ubbthreads/images/graemlins/smile.gif

EDIT:
TIP: I grounded the switch chassis, so when an aligator is not being used, I clamp it to the switch handle and the measurement is zero.

Pablo


----------



## djpark (Feb 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
After 17hs of logging the logger only drifted -0.63%

0.17:26:24,1805,1031,0774,3511,2.206,1.260,0.946,4.290,5.911,3511.0
time = 2005-02-16,13:49:39 (63180 seconds elapsed)
record = 62783 (-398 of 63180 seconds -0.63% drifted)
logged = 62783 records at 1 seconds interval

[/ QUOTE ]

Pablo,

Though 0.63% is below 1% spec, it seems too much to me -- over 6 minutes less records for 17+ hours logging.

Try to follow my previous post in this thread about the calibration and you will get far better accuracy.

I get this much from my logging.

time = 2005-02-07,22:27:35 (9869 seconds elapsed)
record = 9870 (0 of 9869 seconds 0.00% drifted)

time = 2005-02-05,23:40:47 (41081 seconds elapsed)
record = 41081 (-1 of 41081 seconds -0.00% drifted)

time = 2005-01-24,15:55:59 (11544 seconds elapsed)
record = 11544 (-1 of 11544 seconds -0.01% drifted)

I have no complaints about it now.

In your case, it works out this way.

*398 / 63180 * 1000000 usec / 8 / 8 = 98.429 rounded to 98

#rom 0x2100 = { 98 } // compensate (make it faster)
#rom 0x2101 = { 0 } // compensate (make it slower)*

With this change, the clock accuracy should be far better than what you have now. You may want to try 99 also.

[ QUOTE ]
I quite don't understand all the commandline options /ubbthreads/images/graemlins/smile.gif

[/ QUOTE ]

A quick start guide.

_-p i com port (1)_
_-b l baud rate (9600)_
change com port and baud rate baud rate

_-r raw output mode (vs processed output)_
raw output will have only the ADC counts, no voltage or other calculated value display/log

_-c count mode in log file_
Have integet counter display/log instead of timestamp

_-t i count between logging in file (1)_
Log every i records, useful for Excel charting of max 32000 records

_-v d reference voltage (5.0)_
some 78L05 output is not exactly 5.0V, but 5.01V mine and 4.9xV yours.

_-a i adc max count (4096)_
For other ADC resolution, future use.
_There is a minor logic flaw in my PC program, will correct later._

_-l i light adc max count (0)_
_-s d current sense resistor (0.16)_
_-S d current sense resistor (ch2 only)_
Used to calculate the current and relative brightness, I don't rely on the calculated values. I ignore the calculated % and recalc on spreadsheet.

I hope it is simple enough.

-- dj


----------



## dat2zip (Feb 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yes, Pin 5 is not connected. This will need to be corrected as you have explained.

So, far no show stoppers on the board. A couple of minor fixes. 

Let me know if it is unusable.

Box should go out tomorrow priority mail. Can't wait to see one up and running.


----------



## nsmith (Feb 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Is anyone going to sell the board and parts especially the programmed PIC? If so how much?

Thanks, Norris


----------



## cgpeanut (Feb 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Got the parts!






Also, Visiting the Microchip website. I found this opensource VB GUI we might be able to hack into the CPF logger GUI check it out 

Click the Details button on the Driving Lumileds LEDs with Microchip microcontrollers

Driving Lumileds LEDs with Microchip microcontrollers


----------



## PEU (Feb 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

After the correction:

# time = 2005-02-17,11:43:33
# log file = zzz.txt (1 sec interval)
# voltage reference = 4.960
# adc max counter = 4092
# light max counter = 100
# current sense resistor = 0.160

Time,A1,A2,A3,A4,V1,V2,V3,V4,C,L
0.00:00:01,0000,0000,0000,3206,0.000,0.000,0.000,3.886,0.000,3206.0
.
.
.
0.15:59:01,0000,0000,0000,2206,0.000,0.000,0.000,2.674,0.000,2206.0
time = 2005-02-18,11:56:56 (57516 seconds elapsed)
record = 57540 (23 of 57516 seconds 0.04% drifted)
logged = 57540 records at 1 seconds interval

0.04% Drift /ubbthreads/images/graemlins/wow.gif


Pablo


----------



## djpark (Feb 18, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
After the correction:

0.15:59:01,0000,0000,0000,2206,0.000,0.000,0.000,2.674,0.000,2206.0
time = 2005-02-18,11:56:56 (57516 seconds elapsed)
record = 57540 (23 of 57516 seconds 0.04% drifted)

0.04% Drift /ubbthreads/images/graemlins/wow.gif


Pablo 

[/ QUOTE ]

Not bad. Now it is going (a little) too fast. You may want to try smaller number to le tit go slower.

-- dj


----------



## cgpeanut (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Got the pcb's from Wayne Late Saturday Afternoon, Very Nice Wayne Thank you very much, /ubbthreads/images/graemlins/thumbsup.gif

So, got busy building the cpf-logger and noticed the DB9 part iis not the right part. 










I think we need something shorter I will try and see if I can get it exchanged for the right one from digikey. If anyone konws of the right part please feel free to inform me.

Also, I could not get it to work the first time, got a solid led /ubbthreads/images/graemlins/frown.gif 

I tried to short pins 2 and 3 from the db9 with a jumper wire and still no blinking light, Will try to trouble shoot again as time permits.

--Roberto


----------



## pbarrette (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Roberto,

Hm.. That pretty much blows about the connector.

Doing some more digging, I finally figured out what Wayne's part number means for this connector. It's a 0.318" footprint connector. So I guess I screwed the pooch on this one as I specified a 0.590" footprint.

Even worse news is that the price on the correct connector is even lower. Though I guess that could be good news if Digikey lets you exchange them.

The part number I found is: 182-809F-ND
Cost: $1.91ea

--------

For your testing. Don't forget that you may need to disconnect pin3 to make this work. You can do this by cutting off pin3 at the connector or on your cable.

Also, you will need to jumper pin5 to ground if you haven't already.

Sorry for the screw-up on my part..

pb


----------



## dat2zip (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Bummer on the connector. But, The 9 pins is probably more than ample to hold the whole assembly together. If you can use them as is, that should be OK.

Thanks for the pictures. I see you loaded the sip connector for the opto sensor on the top side. The bottomside has the other opto.

Unfortunately, the footprint is a topside only version and you have inverted the dip version of the opto by loading it on the backside.

The way the layout is, you can load one or the other unless you want to put the sip connector on the bottomside.

Hope hooking up pin 5 for GND and getting the pin 2,3 gets the board working.

Wayne


----------



## cgpeanut (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Thanks PB, will get with DigiKey and see if it can be swapped if not no worries I'll get them anyway. 

This gives me a good excuse to review DJ's notes for calibrating the PIC I think I'm missing something,

Here's what I will be doing DJ, PEU and PB please advise

step 1) Blank the PIC12F675. Using both the erase chip and
erase check functions of the DIY K150 software.

step 2) Read the value of the PIC's RC oscillator factory
callibration stored in program flash location
0x03ff. 

So, I go to Options->Edit Hex Code. 
At the bottom of the 1st column in memory location 
03FF I see the value of 3FFF copy this value 
Am I correct that this value is the uPICs unique 
factory calibration value or did I just wiped it out 
because I erased the PIC?

step 3) insert the value 0F34 in program flash memory 0x03FE
Ok, here's where I got /ubbthreads/images/graemlins/confused.gif confused

DJ said:
------------------------------------------------------
Also you need to insert the value 0x34 in to the program flash location 0x03fe to get this calibration to work correctly.

The default value from the hex file for these two consecutive bytes are 0x3f, 0xff and you need to change it to 0x34, 0xNN (NN = OSCAL, the original value you read from the PIC) before you program the PIC.

I've seen the OSCAL value ranging from 0x60 to 0xa0. If this value is not correct, the output baud rate is also out and the PC serial port can't recognize the input. When the value is too out, the PIC may not work at all.
------------------------------------------------------

Does this mean plug in 0F34 (0x34) where x is F? tha's the value I read in memory location 03FE.

Please explain further DJ.


Wayne said:
----------------------------------------------------- 
Unfortunately, the footprint is a topside only version and you have inverted the dip version of the opto by loading it on the backside.
-------------------------------------------------------

Thanks for pointing this out Wayne, I remember you mentioned this in the thread but CPF forums where down for maintenance 
Sunday and could not get the info I needed so I guessed wrong /ubbthreads/images/graemlins/frown.gif No worries, I'm handy with a solder sucker will fix tonight /ubbthreads/images/graemlins/grin.gif

If there are no objections Id rather ship the right db9 part that way the connector gets grounded properly and fits nicely on the board, not sticking out like this.

We are close! real close keep up the faith!!


----------



## dat2zip (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

/ubbthreads/images/graemlins/popcorn.gif


----------



## cgpeanut (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

@DJ,


Let me know if this procedure is acceptable:

First I blank and erase the PIC.

Load the cpf-logger-lite-pic hex code using the DIY K150 v140904 software.

Press CALIB button on the DIY, Now it prompted this

The OSCAL value should be in the form of RETLW instruction [34xx]] 

Currently [3Fxx]

Do you want this changed?

I hit Yes, now this automatically changed the location 0x03FF to 34FF and location 0x03FE to 3FFF 

Am I correct to assume the software I'm using warns me that these values need to be changed and prompts me to do so, In effect I'm doing what needs to be done but in a different way?


----------



## PEU (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

*noooo!!, dont erase the pic first. *

If you erase it without protecting the OSCCAL bytes you lost them forever.

If you use winpic ( www.qsl.net/dl4yhf ) to program the pics it takes care to not overwrite them, unless you explicitly tell it to overwrite.

the OSCCAL bytes are located in the last 2 code positions, as DJ taught us. 
In the pics I purchased (10x 12f675) the oscal value was between $3420 and $3430

The byte at location $03fe is always $34, the byte that is really important is located at position $03ff (dj explained as: NN = OSCAL, the original value you read from the PIC)

the calibration process comes after you have the logger working (led flashing) and sending data to the PC.

I left the logger for an entire night and that was the value I gave to DJ and he posted the calculation method for the correction value. 

This correction value is expressed as decimal, but you need to convert it to hex before putting it in the first 2 bytes of the data section. 1st byte is used if you need to accelerate the clock, the second byte is the opossite.

After the correction the drift is only 0.04% and that is for a full weekend of logging (220000+samples)


EDIT: /ubbthreads/images/graemlins/frown.gif we were posting at the same time... hope you dont keep deleting pics /ubbthreads/images/graemlins/smile.gif


Pablo


----------



## djpark (Feb 21, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Roberto,

If you use K150 with MicroPro v141204 (diypack25), pressing CALIB button will ask you the same question to isnert and you answer YES. Then click READ button to read back the original OSCAL value.

If you already erased off, try 0x80 and provably you may get it working. he baud rate may run slightly, but 9600 baud is slow enough to accomodate.

But the problem you are facing is more likely due to the mixed com port pin 2 & 3 as Pablo experienced. The output of the PIC through the led is (closed to) either 0V or 5V and pin3 is negative from PC, so the led may be always on.

Switching the TX pin to 2 instead of 3 would solve it.

-- dj


----------



## cgpeanut (Feb 22, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Ok,

Got the correct db9 ordered, digikey graciously gave me an RMA # for the wrong one. /ubbthreads/images/graemlins/thumbsup.gif

Could not wait for the proper db9 to arrive so I cannibalized a usb to serial converter that I busted a while back.

Got the blinky led to come up /ubbthreads/images/graemlins/grin.gif











swapped pin3 to pin2 and cut a trace on the pcb board leading to D3 pin3 on the serial db9

grounded pin5 to the negative of the 10 uF cap and used a laplink cable and got the blinky led.

Need to hook this up to my charger and see if I get any outputs.


----------



## Ralf (Feb 26, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

News from the AVR version

Finished the hardware and wrote my first c programm for
a the AVR. I used AVR GCC.

Had a lot of Problems reading the uart, until I changed
the LED for an MAX232 driver. Then it worked.
I tried the LED Version an my Laptop and my Desktop
neither worked.

Therefore I will do an redesign on the hardware and
post the results then, when the hard and software
are finished. ...

Cheers
Ralf


----------



## djpark (Feb 27, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
News from the AVR version

Finished the hardware and wrote my first c programm for
a the AVR. I used AVR GCC.

Had a lot of Problems reading the uart, until I changed
the LED for an MAX232 driver. Then it worked.
I tried the LED Version an my Laptop and my Desktop
neither worked.

Therefore I will do an redesign on the hardware and
post the results then, when the hard and software
are finished. ...

Cheers
Ralf 

[/ QUOTE ]

Ralf,

PIC12F675 doesn't have a UART and I am using software bitbang to emulate. By using software to control, I can let the PIC invert the output, so RS232 driver such as MAX232 is not needed.

If you are using hardware UART, you have to use a hardware driver to invert the signal. MAX232 is one and you can also use allas DS275 or DS1275. Or the simplest one is using a transistor only since we are using the output only.

Another advantage of using a software emulation is using one io pin for both RX and TX.

-- dj

PS.
The serial port access on Win32 using cygwin system really sucks. On some machine, it may or it may not work and you may need to use a batch file to run mode command before the gcc program while the original UNIX/Linux machine have no problem.

Last a couple of days, I played VB to use MSCOMM ActiveX driver and it works just fine. I hate Windows programming, but I may have one exception for this.


----------



## Ralf (Feb 27, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

dj,

I used the MAX232 and had since then no problems. I'd liked
to go ahead with the software and as I fiddeled a whole day
with the LED and tried even inline assembler to invert the
signal I just gone the hardware way 

I am using an AVR mega8 because I had one laying around
and this one has got an hardware Uart ...

I am completly on linux and do now port your pic c program
to avr-gcc. I have already the uart and the adc working
and hope to post the AVR-cpfLoggerLite by the end of the
week ...

Cheers
Ralf


----------



## Ralf (Feb 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

More news from the AVR version.

got the c program for the avr working.
I will do a bit clean up the source code and
add the max232 to the schematic and post then
files to download.

dj,

I assume, that adc_max in the pc c file is set to 4095 default with a 12bit adc in mind? Therefore with
the pic and my AVR version this should be changed with
the commandline option to 1023.

Cheers
Ralf


----------



## djpark (Feb 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

That's correct. It was meant for 12 bit ADC.

Actually 4095 is wrong, it has to be 4092 in this case since I shift the 10 bit ADC result to left by 2 bits and calculate the average of 128 sampling to simulate 12 bit ADC. This is the reason why I have the -a option to overide the default value.

-- dj


----------



## cgpeanut (Feb 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK,

Sorry for the delay but got really busy at work. 

Got all the parts needed and would post pics and results soon.

Wayne, Thank you very much for the free boards! You Rock! /ubbthreads/images/graemlins/thumbsup.gif sending you your parts today. 

Yes! Wayne did not charge anything for the pcb' s so I'm charging for just the parts + shipping, $15.00 + shipping sounds about right.

So I'd say around $20 USD for the complete kit and that includes shipping .

Who wants one?


----------



## LED_ASAP (Feb 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Me first /ubbthreads/images/graemlins/smile.gif


----------



## nsmith (Feb 28, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I will take one. How much for shipping to zip 87004?

Norris


----------



## cgpeanut (Mar 1, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

PM's sent, 

nsmith if one backs out your'e next in line, $20.00 should cover it.

That's it no more boards left. LED_ASAP you squeaked by as always /ubbthreads/images/graemlins/smile.gif


--Roberto


----------



## legtu (Mar 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Is there a way for me to get a "blank" PIC or a pre-programmed one? Online purchase is a bit of a hassle(paypal is not available in our country), I can't seem to find a local source of the PIC and microchip doesn't offer samples here. /ubbthreads/images/graemlins/help.gif

Most of the parts needed for the logger is already covered. /ubbthreads/images/graemlins/smile.gif


----------



## dat2zip (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I got the parts today. I soldered the board up and I applied 7V to the connector and verified that the LED is blinking and the 5V supply is working. Looks like the processor is running and doing something.

As for functionality... NOT.

I'm confused. I've dealt with Serial for many years and again I think this is causing me confusion.

From the PC to the board. Is this a 1:1 cable? Does pin1 connect to pin1 on the cable or should it be crossed over?

On the board. Pin1 of the DB9 doesn't match the pin1 of the RS232 straight through cable I'm using so I inverted the connector on the board to get the pinnouts to match.

Still no input voltage.

I must be doing something stupid.

I tried hyperterminal and it appears my com port is port 2.

when I run cpf-logge....exe -p 2 I get an error "Erro on opening device. No such file or directory".

Yet the mode com2 baud=300 data=8 parity=n works fine. 

It doesn't like it if I mode com1.

Any thoughts?

I'm running the program in DOS console window on a PC running WinXP.


----------



## djpark (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Just got back.

[ QUOTE ]
*dat2zip said:*
I got the parts today. I soldered the board up and I applied 7V to the connector and verified that the LED is blinking and the 5V supply is working. Looks like the processor is running and doing something.

[/ QUOTE ]

That sounds good at least.

[ QUOTE ]
From the PC to the board. Is this a 1:1 cable? Does pin1 connect to pin1 on the cable or should it be crossed over?

[/ QUOTE ]

It is meant to be 1:1 cable and it is good to use those 9 core straight cable meant for the modem.

[ QUOTE ]
Still no input voltage.

[/ QUOTE ]

Most likely the com port is not providing the power through dtr and rts.

[ QUOTE ]
when I run cpf-logge....exe -p 2 I get an error "Erro on opening device. No such file or directory".

[/ QUOTE ]

Part of the program is originally designed for the MINGW environment where device name is "comx" while now it is on cygwin where it is "/dev/comx". 

Try "-p /dev/com2" instead of "-p 2".

-- dj


----------



## PEU (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I use this .BAT file:

@echo off
mode com1 baud=300 data=8 parity=n > nul
cpf-logger-lite-pc -l 100 -v 4.96 zzz.txt

it works just fine !

and for the cable I adapted an old printer cable by changing the big connector by a female db25 wich I use with an adaptor /ubbthreads/images/graemlins/smile.gif


Pablo


----------



## Ralf (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

As far as having trouble with the power over the rs232
interface, for my laptop I have built an adapter which
connects DTR to a 9V battery, because there is to low
voltage at DTR/RTS from my old laptop. maybe a lowdrop
voltage regulator with shottky diodes would have solved
the problem as well ...

Another issue came up yesterday evening:

Has anyone darkend/shaded the OPT101?

Even with only a 5mm LED the OPT101 puts out its most
voltage, so the question is to darken the sensor, that
the reading is not to high, otherwise you would see e.g.
100% light even the light is getting lower until the sensor
is out of saturating? Do I miss something?

Cheers
Ralf


----------



## djpark (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OPT101 is quite sensitive with built-in OPAMP preset gain. You can use external parts to set different gain yourself.

You can put the sensor away from the light (such as 1 m), but the ambient light will affect the reading.

In my case, I put the light source near by, and cover the opt101 with a layer of half transparent film to reduce the light.

-- dj


----------



## dat2zip (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Progress...

I can't get my PC to do anything.

On the laptop and a keyspan USB to Serial Adaptor I am able to get the board powered up and the LED blinks (dimly). So, success in that respect.

The Keyspan RS232 signal swing is +/-5V and the output of the 5V regulator is ~3V. So, the pic runs, but, the output signal is not sufficient to generate a valid RS232 signal back to the USB - Serial adaptor.

Those who got the board need to perform the following modifications:

1) Load the DB9 on the bottomside of the board.

2) Wire pin 5 of the DB9 to GND

3) cut the trace going to DB9 Pin 3

4) Add wire from DB9 Pin 2 to LED cathode.


On the keyspan it mapped the adaptor as com4. You can see it listed in the hardware profile.

My command line is cpf_l -p /dev/com4

Thanks DJ for the com port syntax.

I'll probably be using this with the laptop. Two solutions might exist. 

a. Use a low dropout linear regulator in place of the 79l05. This will raise VCC closer to 5V. Maybe, it will work then.

b. Wire in a external battery supply like a 9V battery. (yuch)

Wayne


----------



## dat2zip (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Some progress.

I used an external supply to power the logger. CPF-logger-lite program doesn't work for some reason...

In hyperterminal I can now see the data. It's jibberish, with 9600, 8n1

Unless I have hyperterminal configured wrong maybe the serial baud rate is off???

I have also confirmed that if I bypass the linear regulator with a wire, the board works as well. Be aware, this only works if you RS232 swing is 5V. Using this on multiple PCs could damage the CPF-logger board with no linear regulator for regulation.

Any thoughts or suggestions would be greatly appreciated.

Wayne


----------



## dat2zip (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I think the osccal value is off. I'm measuring 127uS for one bit. That's pretty far from 9600 baud of 104uS/bit.


----------



## PEU (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Wayne, did your programmer saved the osccal value before programming? what is the actual value at $3FFF ?

The 12F675 I purchased swinged between $20 and $30 values


Pablo


----------



## djpark (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Wayne, You look like having 2 different problems -- voltage and baud.

The output of the logger is supposed to be 5V (provided voltage from serial port is higher) minus Vf. So it is not real RS232 signal level. Many modern PC can accept and work well, but some modern com ports are providing low voltage such as yours.

Some suggestions.

1) Use LDO instead of 78L05 as you suggested. I suggest using 3.3V fixed output so that there is enough head room for the voltage swing. Then you can use "-v 3.3 -a 4092" option to indicate the Vdd.

2) Remove the led which is in series to the serial port to lessen the voltage drop. 3.3V output shall be detected by 5V circuit of the USB converter. You may move the led down to the ground with a series resistor to indicate the TX. Using bigger value (such as 2-5k) to limit the current to small and clear red led will be still bright.

3) If Hyperterminal brings output yet cpf-logger.exe doesn't, try using "mode" command before running cpf-logger.exe.

4) OSCAL value seems really out. Pablo's PICs had 0x20 - 0x30, mine had 0x64 - 0xa1. You can try from 0x80. One thing to remember is the power supply voltage, it may affect the internal RC ocsillator. Need to talk to Roberto for new chip.

-- dj


----------



## dat2zip (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

guys,

I don't have a pic programmer. So reading location ?? is not in my realm of doing. I've got a board, parts, PC and RS232 cable.

I think cgpeanut programmed the part. Best to ask what he did to the parts when he programmed them.

Since I can't make out any of the jibberish on the screen and since it looks like the waveform timing is off. I was just speculating that it could be off. I have no idea.

As for the WinXP desktop.

Since I can't get the control lines active, I have no VCC on the part?

Any suggestions for the PC?


----------



## djpark (Mar 6, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I uploaded a small program to display the incoming data using VB. Anything using MS products on MS-OS is no problem... This one uses MSCOMM.OCX.

test exe file 

You can also download a program called "RealTerm" and this is very good. You can do most work with serial port.

download here 

-- dj


----------



## cgpeanut (Mar 7, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Wayne,

Sending you a new program uPIC 1st thing tomorrow just in case. 
Will program tonight and post the screen shot as I download the program.


----------



## legtu (Mar 8, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Need help with the PIC. Anybody with a "spare" PIC12F675 lying around? Anyone interested with some OPT101P's? /ubbthreads/images/graemlins/icon6.gif


----------



## djpark (Mar 10, 2005)

<ul type="square"> 
[*]I corrected the original circuit TX pointing DB9 pin3 pointed out by Pablo. Now it is changed to pin2 in the original main post. It is version 1.0a. 

[*]I modified the circuit a little for better operation. It is now version 1.1. 
[/list] 

New file:

all files zipped - cpf-logger-lite-all-10a.zip 

all files zipped - cpf-logger-lite-all-11.zip 

high resolution circuit schematic - cpf-logger-lite-citcuit-11-hires.gif 


* Changes *







1) Previously the TX output from the PIC was connected to serial port via red led as transmitting indicator. This is no problem with most PC, but it can be a problem with certain notebook which output low voltage to serial port. The input voltage become too low to be recognized correctly by the PC due to the Vf of led.

Now the PIC output is connected to the serial port directly and the red led is fed from the same TX pin via 2.2k current limiting resistor. This will still let 1-2mA to red led and it is bright enough to see.

2) The power supply to the OPT101 sensor is directly taken from the input side of the 78L05 regulator instead of the output.

Expecting the voltage output from the PC is regulated, this higher voltage to the OPT101 may provide better dynamic range of light measurement.

However, the stability or reality need to be tested yet.

3) Not shown in the circuit, but the switch is changed from the toggle switch to push button switch. This is to prepare for new version of PIC software. No effect to the current operation.

-- dj


----------



## djpark (Mar 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
Has anyone darkend/shaded the OPT101?

Even with only a 5mm LED the OPT101 puts out its most
voltage, so the question is to darken the sensor, that
the reading is not to high, otherwise you would see e.g.
100% light even the light is getting lower until the sensor
is out of saturating? Do I miss something?


[/ QUOTE ]

I found the best fomular which works for me.

I cut the anti-static package envelope from TI and covered the OPT101 with 5 layers of them. Then I put the light head very close to the sensor.

This gives about 80% of the max value I used to get with the brightest light I have. Then I started seeing the actual relative brightness among lights I have, the result is consistent with the light meter reading. The winner turned out to be a modded lux3 beating Nuwai Lux5).

-- dj


----------



## Ralf (Mar 11, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

dj,

thanks for your suggestions regarding the opt101,
will try that ...

cheers
ralf


----------



## dat2zip (Mar 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

OK,

Holy cow.... Man, I had to go figure out everything.

Not easy... I borrowed a friends P16PRO40 (7406 version), loaded picall, winpic.... Figured out Winpic and finally tweeked to osccal to get a reading on the serial port.

I believe the pic is being erased or the cal value is not being read out correctly and being put back in. Both of the two new parts were 3424. The one part I finally got working I used an osccal of 88. I must have tried a dozen different numbers.

So, mine finally works.

with a 5V TTL type interface (USB to serial) I have to short out the LED to make it work. I'll look into wiring this in parallel with the signal instead of in series so that the LED status will still function.

Just wanted to confirm.

I had to install the DB9 on the bottomside, cut trace to pin 3, wire serial communications to pin2, wire pin 5 of DB9 to GND.

The regulator is not in regulation, but, the ~3V is still sufficient to run the processor. I'll keep an eye on this. I might bypass the regulator down the road to raise VCC or keep it like this. If we can keep the regulator in, then it will work with standard RS232 signals as well as the 5V style.

Wayne


----------



## dat2zip (Mar 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Yes, it's 4am when I'm making this post...


----------



## PEU (Mar 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

you need a regulator working as a reference, and then measure the V at its output to pass that value via the commandline to the logger program.


Pablo


----------



## djpark (Mar 15, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I am glad yours finally works.

Indeed the OSCAL value was there "0x24". But with reduced Vdd supply, the internal RC oscillator may run a bit. If the power from USB is quite contant 5V, you may skip the regulator.

As Pablo pointed out, the PIC is using Vdd as voltage reference. So you can use LDO or zener to regulate to 3.3V and use -a option to indicate the new reference voltage. The chip can work as low as 2V though the serial port may not recoginze the high bit any more.

I already changed the led to parallel instead of serial to the TX. It is reflected in the post above.

-- dj


----------



## goldserve (Mar 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Did anyone make an extra one they are willing to sell me? Please PM me! Thanks.


----------



## pbarrette (Apr 2, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi all,

This thread has been quiet for a while, so I thought I'd spice things up a bit.

I've written a windows program to grab the data from the logger and place it into Excel 2002 (and above) in real time.

The program allows you to to assign a current measurement resistor to any of the 4 channels. It will also calculate input power, output power, and efficiency under certain circumstances. For the power and efficiency measurements, I paired up Input1 with Input2 and Input3 with Input4.

They say a picture is worth a thousand words, so here are 3 of them:











(Note: These images were captured with the OPT101 sensor still in place and the other inputs dangling. That's why the efficiency measurements are so screwy.) 

The power measurements are only displayed when only 1 input of each "pair" is being used to measure current. When both "pairs" are in Power mode, then efficiency is displayed as well.

The program was written in C# .NET, which means that it requires the Microsoft .NET Framework to be installed on your system. It has been tested with Windows XP, Windows 2000 and Excel 2002.

I can guarantee that the program still has bugs, but if you find one, please send me a PM so I can try to fix it.

That said, the program can be downloaded from here:
CPFLite.zip

And keeping in spirit with the openness of this project, the complete source code can be found here:
CPFLiteSrc.zip

If you try the program, please give me some feedback. I've now tested it on my development system, my wife's computer, my work laptop, and a fileserver at work.

I'd be interested in knowing if it works for others as well, and if there is anything that could be changed, or added to the program.

Thanks,
pb


----------



## PEU (Apr 3, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

still no work for me /ubbthreads/images/graemlins/frown.gif

Pablo


----------



## MrAl (Apr 4, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi there Pablo,

Sorry i cant help much here, i havent tried to build one.
Has anyone else had success yet?

Take care,
Al


----------



## PEU (Apr 4, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I meam Peter software, datalogger is working fine!!

Thanks for the offering as always AL!!!


Pablo


----------



## legtu (Apr 23, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

I finished assembling the circuit and I can't seem to make it work. I've already followed most of the troubleshooting techniques mentioned and still no go.

What happens with my circuit is that as soon as I connect the logger to the serial port, the LED lights up and flashes accordingly depending on the switch setting. I'm not getting any output from it and whenever I try "opening"(eg. pressing the "start" button on cpf-logger-test.exe) the port where its connected, the LED turns off. Once I "release"/close the port, the LED lights up again and flashes. 

Any ideas on what's wrong with it? /ubbthreads/images/graemlins/help.gif


----------



## PEU (Apr 23, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

The circuit seems to be working, or no flash will happen...

you may have PIC OSCAL calibration problems and because of that the data is not sent at the right pace, when you programmed the PIC did you saved this value?

If you didn't saved it you may try hex 30 or 80

You may want to try a terminal program and try to see what is going on,


Pablo


----------



## legtu (Apr 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Re-checked everything and I think it's working fine now. I messed up in wiring the DB9 pins of the logger. /ubbthreads/images/graemlins/blush.gif

With switch 1 closed, the PC isn't receiving the "time" from the circuit. Is it supposed to work that way?

Next step, PIC timer calibration.

@PEU
I made sure that the OSCAL is safe just like you said. I even wrote it in the underside of the PIC for additional safekeeping. /ubbthreads/images/graemlins/grin.gif Thanks for the help!


----------



## PEU (Apr 24, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

yup, it works that way, when in "fast" mode it does not log time. I asked the same some time ago too /ubbthreads/images/graemlins/smile.gif

After recalibration, I have a 0.01% drift which is very good IMHO!! /ubbthreads/images/graemlins/happy14.gif DJ


Pablo


----------



## legtu (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
yup, it works that way, when in "fast" mode it does not log time. I asked the same some time ago too /ubbthreads/images/graemlins/smile.gif

After recalibration, I have a 0.01% drift which is very good IMHO!! /ubbthreads/images/graemlins/happy14.gif DJ

[/ QUOTE ]

Just had to confirm that its supposed to work that way. /ubbthreads/images/graemlins/wink.gif

I'm trying to adjust the timer calibration but I can't seem to apply the changes using winpic. I tried editing address 2100 in the data tab with my value but whenever I try to apply the changes, winpic reverts it to the original value. /ubbthreads/images/graemlins/confused.gif


----------



## PEU (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

In winpic you have 2 windows for 12F675, the leftmost one is the code window, and the other is the data window, the bytes you have to touch to correct drift are the 1st 2 ones of the data window (mine is shown w/ white background)

Hope this helps.


Pablo


----------



## greenlight (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Maybe you could program some graphs for display too.!


----------



## legtu (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
In winpic you have 2 windows for 12F675, the leftmost one is the code window, and the other is the data window, the bytes you have to touch to correct drift are the 1st 2 ones of the data window (mine is shown w/ white background)

[/ QUOTE ]

Yup, that's what I did but once I try to apply the modified value or program the PIC, winpic reverts it to the original value. /ubbthreads/images/graemlins/mecry.gif


----------



## PEU (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

well Im using winpic (version compiled on feb 2 2005) edited with a random value the 1st byte of the data section, APLIED THE CHANGES, and write to the device using the RCD programmer. 

Everything went just fine.


Pablo


----------



## legtu (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
well Im using winpic (version compiled on feb 2 2005) edited with a random value the 1st byte of the data section, APLIED THE CHANGES, and write to the device using the RCD programmer.

[/ QUOTE ]

For some odd reason, winpic refuses to apply any changes that I make in the data window. /ubbthreads/images/graemlins/banghead.gif I'm using the latest version from the author's site(which I think is the same version as yours). I had to use IC Prog to apply the timer calibration and am running the logger now to check for the drift. 

If we could only compensate the drift via software. /ubbthreads/images/graemlins/popcorn.gif


----------



## PEU (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

just in case, Im using this version: the version Im using 

hope it helps


Pablo
PS: link will expire tomorrow


----------



## legtu (Apr 25, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*PEU said:*
just in case, Im using this version: the version Im using

[/ QUOTE ]

Checked it and yours is an older version. I guess the latest version of winpic has a bug in editing the data/eeprom area. /ubbthreads/images/graemlins/au.gif

Thanks again! /ubbthreads/images/graemlins/happy14.gif


----------



## legtu (Apr 30, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

More questions... /ubbthreads/images/graemlins/blush.gif

-What would happen if more than 5v is applied on the inputs?
-How about negative voltage on the inputs?


----------



## Ralf (May 13, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi legtu,

you should not apply more voltage. I don't know
the pics but the AVR will die above 6Volts I
suppose. You can protect the inputs if you wire
parallel to the input capacitor a 5.1V Zener diode.

Cheers
Ralf


----------



## Ralf (May 16, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hello *,

just for the completeness of this thread. I have done a Verion with
an Atmel AVR uC. First I had liked to use the hardware UART, but
with an MAX232 it has drawn to much current from the Serial Interface
and the voltage was to low for the 7805 to regulate. 

At the moment I just stopped the second version with op buffered analog
inputs and started a new project based on my experiences with the
first version. It will be a universil lab interface with analog and digital
I/O. But this can take a while because I am very busy at work.

So here we go:

Eagle Schematic 
Eagle Layout 

AVR-gcc c-sourcecode 

Because I wanted to use the hardware UART in the first place I took an
mega8. But the max232 converter took to much current from the serial line
and it worked not properly. Then I decided to go the simple way (just like
the pic one from dj) and made a software UART with inline assembler. 

It does just the same thing as djparks PIC version. But for cpfers with
AVR toolchain set up it may be helpful. I am not that happy with the
current consumption here as well. It might be better to put the print routines
in the timer intterupt as well and put the AVR meanwhile to sleep. ....

Cheers
Ralf


----------



## legtu (May 17, 2005)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

[ QUOTE ]
*Ralf said:*
you should not apply more voltage. I don't know
the pics but the AVR will die above 6Volts I
suppose. You can protect the inputs if you wire
parallel to the input capacitor a 5.1V Zener diode.

[/ QUOTE ]

Thanks for the info! I also figure that it could fry the chip. I've 'accidentally' applied more than 6v on the inputs on my logger a couple of times. Good thing there's a current limiting resistor. /ubbthreads/images/graemlins/blush.gif


----------



## PEU (Jul 24, 2006)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Found it, this logger works great.


Pablo


----------



## Handlobraesing (Jul 24, 2006)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Where do I get the TI sensor and is there datasheet available for it? I have a logging DMM.


----------



## PEU (Jul 24, 2006)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

ask TI for a sample:
http://focus.ti.com/docs/prod/folders/print/opt101.html


Pablo


----------



## MrAl (Jul 24, 2006)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hey Pablo, hola!

Somebody hacked your circuit site? I went to post a new schematic one
day and it was not allowing sign in because it said it was hacked?
Can you fix it?


----------



## PEU (Jul 24, 2006)

*Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP*

Hi Al, it seems someone was having fun with your site at my site  I just solved it, also sent you a private message with the new login data.

Have fun!


Pablo


----------



## NewBie (Sep 2, 2006)

Worthy of a bump, imho.

Another very worthy project that comes in handy for folks wanting to do a variety of things, that was hiding in the halls of cpf.


----------



## ACDI (Nov 6, 2006)

Hey tech guys, I work for a purchasing dept, I googled this pn and you were the only place in the whole world that knew anything about it, congrats. Can you let me know who I can order this PN# from. Thanks

lm78l05aczns-nd


----------



## PEU (Nov 6, 2006)

Log to: www.digikey.com and enter that string... bingo!  


Pablo


----------



## PEU (Mar 23, 2009)

A new bump for a really good project. I happen to be using it right now 


Pablo


----------



## TakeTheActive (Mar 23, 2009)

PEU said:


> *A new bump for a really good project.* I happen to be using it right now


Thanks! :twothumbs

In all my HOURS of reading the CPF Archives, I never came across a reference to this project until today. I just added it to my Sig Line LINKs for more exposure.


----------



## legtu (Mar 28, 2010)

Another bump for this great thread!

Anybody still using this? I'll be buying a USB to RS232 converter so I can use it in my laptop. I'm also in the process of interfacing the logger with my Palm PDA for more portability.


----------



## PEU (Mar 28, 2010)

Last time I used it I posted in this thread, worked fine as expected. Having the light sensor inside the box is a real plus, I posted these photos earlier in this thread:












Pablo


----------

