CandlePowerForums


Go Back   CandlePowerForums > Flashlights > Flashlight Electronics - Batteries Included
CPF Only
User Name
Password
Register

Peak LES

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2005, 11:53 PM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default CPF-LOGGER-Lite: Simple DIY Data Logger for CPFers

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
Reply With Quote
  #2  
Old 01-17-2005, 01:08 AM
koala's Avatar
koala koala is offline
 
Join Date: Mar 2003
Location: Melbourne, Australia.
Posts: 2,330
Default 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
Reply With Quote
  #3  
Old 01-17-2005, 01:42 AM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default 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
Reply With Quote
  #4  
Old 01-17-2005, 04:59 AM
koala's Avatar
koala koala is offline
 
Join Date: Mar 2003
Location: Melbourne, Australia.
Posts: 2,330
Default 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 &amp; 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 [img]/ubbthreads/images/graemlins/thumbsup.gif[/img]) 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 [img]/ubbthreads/images/graemlins/crazy.gif[/img]

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! [img]/ubbthreads/images/graemlins/grin.gif[/img]

-vince.
Reply With Quote
  #5  
Old 01-17-2005, 05:23 AM
PEU's Avatar
PEU PEU is offline
Flashaholic*
 
Join Date: Feb 2004
Location: Buenos Aires / Argentina (I like ribs)
Posts: 3,618
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

Thanks DJ!!!

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

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


Pablo
Reply With Quote
  #6  
Old 01-17-2005, 05:35 AM
Ralf's Avatar
Ralf Ralf is offline
Flashaholic
 
Join Date: Dec 2002
Location: Heilbronn/ Germany
Posts: 422
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

Nice project,

and I like programms for UNIX :-) ...

Cheers
Ralf
ps: command line rules ...
Reply With Quote
  #7  
Old 01-17-2005, 05:58 AM
PEU's Avatar
PEU PEU is offline
Flashaholic*
 
Join Date: Feb 2004
Location: Buenos Aires / Argentina (I like ribs)
Posts: 3,618
Default 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
Reply With Quote
  #8  
Old 01-17-2005, 06:30 AM
jtice's Avatar
jtice jtice is offline
*Flashaholic*
 
Join Date: May 2003
Location: West Virginia
Posts: 7,655
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

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

heh, nice timming, I just ordered a $50 USB datalogger last night! [img]/ubbthreads/images/graemlins/twakfl.gif[/img] hehe
oh well, now I will have two [img]/ubbthreads/images/graemlins/smile.gif[/img] 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 !! [img]/ubbthreads/images/graemlins/thumbsup.gif[/img]
Thanks for all the hard work and time you put into this.

~John
Reply With Quote
  #9  
Old 01-17-2005, 08:17 AM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

DJ,

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

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.
Reply With Quote
  #10  
Old 01-17-2005, 09:10 AM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default 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 &amp; 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 [img]/ubbthreads/images/graemlins/thumbsup.gif[/img]) 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 [img]/ubbthreads/images/graemlins/crazy.gif[/img]

[/ 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! [img]/ubbthreads/images/graemlins/grin.gif[/img]

[/ QUOTE ]

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

-- dj
Reply With Quote
  #11  
Old 01-17-2005, 09:21 AM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

[ QUOTE ]
PEU said:
Thanks DJ!!!

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

EDIT: I can't see clearly the parts in the schematics [img]/ubbthreads/images/graemlins/frown.gif[/img] can you clarify? [img]/ubbthreads/images/graemlins/smile.gif[/img], 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 &amp; 100k)
R2, R3, R4, R5: 1k
U1: PIC12F675
U2: OPT101
U3: 78L05

D1 + D2 &amp; 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 &amp; 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
Reply With Quote
  #12  
Old 01-17-2005, 11:29 AM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default 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
Reply With Quote
  #13  
Old 01-17-2005, 11:59 AM
jtice's Avatar
jtice jtice is offline
*Flashaholic*
 
Join Date: May 2003
Location: West Virginia
Posts: 7,655
Default 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.
Reply With Quote
  #14  
Old 01-17-2005, 12:56 PM
Ralf's Avatar
Ralf Ralf is offline
Flashaholic
 
Join Date: Dec 2002
Location: Heilbronn/ Germany
Posts: 422
Default 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
Reply With Quote
  #15  
Old 01-17-2005, 01:18 PM
MrAl's Avatar
MrAl MrAl is offline
Flashaholic*
 
Join Date: Sep 2001
Location: New Jersey
Posts: 3,086
Default 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
Reply With Quote
  #16  
Old 01-17-2005, 02:16 PM
koala's Avatar
koala koala is offline
 
Join Date: Mar 2003
Location: Melbourne, Australia.
Posts: 2,330
Default 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.
Reply With Quote
  #17  
Old 01-17-2005, 02:29 PM
jtice's Avatar
jtice jtice is offline
*Flashaholic*
 
Join Date: May 2003
Location: West Virginia
Posts: 7,655
Default 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.
Reply With Quote
  #18  
Old 01-17-2005, 03:22 PM
Zelandeth's Avatar
Zelandeth Zelandeth is offline
Flashaholic*
 
Join Date: Nov 2002
Location: Northeast Scotland (Aberdeenshire)
Posts: 1,221
Default 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.
Reply With Quote
  #19  
Old 01-17-2005, 03:32 PM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default 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.
Reply With Quote
  #20  
Old 01-17-2005, 08:08 PM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default 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
Reply With Quote
  #21  
Old 01-17-2005, 08:13 PM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default 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
Reply With Quote
  #22  
Old 01-17-2005, 09:42 PM
koala's Avatar
koala koala is offline
 
Join Date: Mar 2003
Location: Melbourne, Australia.
Posts: 2,330
Default 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.
Reply With Quote
  #23  
Old 01-18-2005, 05:51 AM
Ralf's Avatar
Ralf Ralf is offline
Flashaholic
 
Join Date: Dec 2002
Location: Heilbronn/ Germany
Posts: 422
Default Re: CPF-LOGGER-Lite: Simple DIY Data Logger for CP

@jitice No I haven't talked only to you but to all out there [img]/ubbthreads/images/graemlins/smile.gif[/img]
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 [img]/ubbthreads/images/graemlins/happy14.gif[/img]

Cheers
Ralf
Reply With Quote
  #24  
Old 01-18-2005, 07:37 AM
djpark djpark is offline
Flashaholic*
 
Join Date: Nov 2003
Location: SJ, Malaysia
Posts: 508
Default 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
Reply With Quote
  #25  
Old 01-18-2005, 08:02 AM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default 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?
Reply With Quote
  #26  
Old 01-18-2005, 08:04 AM
Ralf's Avatar
Ralf Ralf is offline
Flashaholic
 
Join Date: Dec 2002
Location: Heilbronn/ Germany
Posts: 422
Default 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
Reply With Quote
  #27  
Old 01-18-2005, 08:54 AM
Ralf's Avatar
Ralf Ralf is offline
Flashaholic
 
Join Date: Dec 2002
Location: Heilbronn/ Germany
Posts: 422
Default 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 [img]/ubbthreads/images/graemlins/blush.gif[/img]

Cheers
Ralf
Reply With Quote
  #28  
Old 01-18-2005, 09:09 AM
lymph's Avatar
lymph lymph is offline
Flashaholic
 
Join Date: Sep 2004
Location: Seattle, WA
Posts: 344
Default 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.
Reply With Quote
  #29  
Old 01-18-2005, 12:49 PM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default 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! [img]/ubbthreads/images/graemlins/smile.gif[/img]

I may have to pick your brains a bit in case I have questions,
gnuplot would work too lets try it.
Reply With Quote
  #30  
Old 01-18-2005, 01:11 PM
cgpeanut cgpeanut is offline
Flashaholic*
 
Join Date: Jan 2004
Location: tennesse, usa
Posts: 841
Default 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 [img]/ubbthreads/images/graemlins/hahaha.gif[/img]
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2009, Candle Power Fora, LLC