Data logger clock and array


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    I just want to say hello since I’m new to PBP.
    I can tell you right off the get-go, if you haven't built anything before, you'd better start small and work your way up. You'd be shooting yourself in the foot if you don't. Opinion...

    I’m thinking to make Data Logger to log 4 batteries, 2 temperatures, frequency, and time 2% or less accuracy
    At what sampling rate? 100 times per second? Once per second?

    using 16k 18F4420 8mhz internal clock.
    Use a PIC18F4550 and you can use the serial port initially then switch over to USB. Cool points included.

    I’ll be saving all the data in Flash. 100,000 life cycles is more than enough for my lifetime to use data logger.
    Easy enough to add a fair sized external 2 wire EEPROM. Why take the chance of messing up the PIC's operating system.

    Before I start writing the program I’d like to consult with you guys what a proper way to do it. If you please can suggest anything, I'm all ears.
    Good plan...

    1) I have to write 32bytes in to Flash at a time. Let’s assume 8 adc at resolution 8bit samplings equal 8 bytes. Should I just make 32 variables each equal byte and take 4 samplings of 8adc channels and write all 32 variables at once to flash? Is it a proper way to do it? Let’s say I’ll be logging only 7adc channels and is it possible to use an Array of 32 bytes and once it is full or almost full it starts writing to flash automatically.
    Whatever way you want to do it, as long as you take good notes and keep track of what you're doing.

    Is there a sample code like that so I can get an idea to modify for my application?
    Starting to go downhill here... And by that I mean... Well, never mind.
    Suffice to say, if you write some code, and it doesn't look right, and/or doesn't work right, I'm sure a dozen people around here will stand up and give you a hand.
    However, I don't have your hardware, I don't know how much you know, and I'm not going to use up a days upon days trying to explain every little thing.

    2) I’d like to be able to log time as well. Data logger will be logging under 20 minutes at a time. Time should be 2% or less accurate. What would be the best way to make 20 minutes clock using hardware interrupt or software without external RTC IC?
    Easy enough to use a crystal on the PIC and keep <1% accuracy, or again, easy enough to add on a 2 wire RTC for tigher accuracy.

    If I use 100hz interrupt, I’m afraid it’d conflict with data logging.
    External eeproms are quick enough. You can get away with a write, wait 10ms (100hz) then write another byte. Or if your program is written right, you can use a page mode and write more data in practically the same time.

    3) I’m going to import all the data to Excel and use charts. I found Parallax PLX-DAQ software but is there any better solution to do that? I’m going to use software rs232 command so I don’t have to use Max232 and make it simple. What’s the fastest baud rate I can use with 8mhz internal clock with a minimum error tolerance?
    Use USB and you don't have to worry about it.
    Generally speaking, using software SERIAL, 19.2K baud is what the book says. Using hardware serial, you'll have to check your datasheet for whichever PIC you want to use and see what the numbers show.
    Last edited by skimask; - 24th September 2008 at 14:16.

  2. #2
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thanks Skimask for a quick reply. I have some experience with Proton picbasic. The data logger will be taking every 1s-10s samplings adjustable from Excel. What do you think the best way to make 20 minutes Clock? I've never used USB before but it might be a good idea to learn it. How to communicate between USB and excel? Would it not require custom PC software? Using serial port I can even use HyperTerminal to import the data.
    I'd like to keep data logger very simple without external parts. This is just a hobby project and I know once my friends would see the data logger I would have to make them as well. I'd prefer to keep the project with minimum parts so I wouldn't even need a PCB and it'll be easy to build it for my friends.

  3. #3
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    I'd like to keep data logger very simple without external parts. This is just a hobby project and I know once my friends would see the data logger I would have to make them as well. I'd prefer to keep the project with minimum parts so I wouldn't even need a PCB and it'll be easy to build it for my friends.

    You having a laugh, Keep it simple with out no extrenal parts & no PCB (This would be good to see)
    What voltage measurement you require ? has if it is more then 5V you then would need resistors Opps! i forgot no extrenal parts, Don't forget you need an eeprom of sd card but how would you connect them wiht out PCB.

    Give it to your friends I think I would sell it for a small fee plus this helps you get your money back for PBP after all your the one that has put all the time into it.
    Like skimask said do your home work write some code give it ago then come back and may be more people would take you seriously and offer more help

    Do a serach and you will find some code

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Cool

    Quote Originally Posted by PicLearner View Post
    I have some experience with Proton picbasic.
    You know this forum isn't for Proton picbasic right?

    The data logger will be taking every 1s-10s samplings adjustable from Excel.
    So Excel is going to talk to the PIC?

    What do you think the best way to make 20 minutes Clock?
    Make a whole bunch of 1 second clocks and keep track of them.

    I've never used USB before but it might be a good idea to learn it.
    There's one really really really good thread here on how to do just that using an 18F4550.

    How to communicate between USB and excel? Would it not require custom PC software? Using serial port I can even use HyperTerminal to import the data.
    Pull it in using that link I eluded to above, and dump the data to a .csv file, then import it to Excel. Or write a really cool VBA app to pull the data from the file as it comes in. Doesn't matter.

    I'd like to keep data logger very simple without external parts. This is just a hobby project and I know once my friends would see the data logger I would have to make them as well. I'd prefer to keep the project with minimum parts so I wouldn't even need a PCB and it'll be easy to build it for my friends.
    Now that's classic... And just how do you suggest doing that? Chips without a PCB... Are you going to mount this stuff on wheat bread or Pringles chips or what?
    What exactly do you plan on datalogging again?
    Last edited by skimask; - 24th September 2008 at 23:16.

  5. #5
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    In order for me to keep it very simple it would take ADC from lipo cells which are 3.7v. I might use a resistor 4.7k on the connector it self or without a resistor since it shouldn't have any spikes in voltage. To take frequency I was thinking just to use 2 resistors 1k and 100ohm to drop the voltage. To power up the pic I was thinking to use TO-92 0.5% LDO and 1 or 2 small capacitors. I'm not going to use voltage reference to keep it simple and ADC probably should work within 1%-3% accurate. As you can see 1 PDIP microchip, 1 LDO, 1-2 capacitors and just connector glued and soldered directly to microchip. Using software rs232 I don’t need Max232 so I can just use serial female connector with 2 resistors and connect it directly to microchip whenever I need to upload the data. Sure I can make PCB at home but I just want to keep it very simple so my friends can use it as well just to pay for parts or so. I bought PicBasic just for fun since I like electronics and I don't intend to make profit but maybe I might sell it for a small fee. I have regular job which pays my bills and I don't mind to spend money for my hobby that I like.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    To power up the pic I was thinking to use TO-92 0.5% LDO and 1 or 2 small capacitors.
    You should be able to drive a PIC directly from one LiPo, no regulators need.

    I'm not going to use voltage reference to keep it simple and ADC probably should work within 1%-3% accurate.
    There's a few PICs out there that have a built-in .6v reference which you could 'reference against'.

    As you can see 1 PDIP microchip, 1 LDO, 1-2 capacitors and just connector glued and soldered directly to microchip.
    If you think it'll run, go with it... I don't think it'll run and last, but that's just me.

    Using software rs232 I don’t need Max232 so I can just use serial female connector with 2 resistors and connect it directly to microchip whenever I need to upload the data.
    Same thing with the USB, the connector, 2 wires to the PIC (D+/D-), an extra cap, and the right firmware.

  7. #7
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    double post deleted
    Last edited by PicLearner; - 25th September 2008 at 00:13.

  8. #8
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Yeah I know. So far I love the forum, it's got so much info to learn from...

    Quote Originally Posted by skimask View Post
    You know this forum is Proton picbasic right?
    I was thinking to use Excel to change settings in microchip using PLX-DAQ or Realterm OCX example. I can adjust number of batteries, number temp sensors connected to pic just by using serout command to update EEPROM of Flash to store different settings.

    Quote Originally Posted by skimask View Post
    So Excel is going to talk to the PIC?
    Let's say I use interrupt for 1 second using 16bit timer. 8mhz / 4 cycles / 16bit timer 65536 = 0.000030517578125 multiply by 256 prescaler = 0.0078125. 1 second / 0.0078125 = 128. As I understand it should interrupt the software 128 per second. My guess it might conflict with a software running in the background or I'm wrong.

    I would love to hear more about that.
    Quote Originally Posted by skimask View Post
    PLX-DAQMake a whole bunch of 1 second clocks and keep track of them.PLX-DAQ
    Very simple, please read my previous post.

    Quote Originally Posted by skimask View Post
    Now that's classic... And just how do you suggest doing that? Chips without a PCB... Are you going to mount this stuff on wheat bread or Pringles chips or what?
    What exactly do you plan on datalogging again?

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    Yeah I know. So far I love the forum, it's got so much info to learn from...
    Let me try that one again...

    You know this forum is for MeLabs PicBasicPro and not Proton Basic right?

  10. #10
    Join Date
    Sep 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Let me try that one again...

    You know this forum is for MeLabs PicBasicPro and not Proton Basic right?

    Yeah I know. That's what I said I bought MeLabs PicBasicPro but I've used Proton lite to learn on

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PicLearner View Post
    Yeah I know.
    Ok, just checking...

    That's what I said I bought MeLabs PicBasicPro
    Having trouble finding that particular sentence...

Similar Threads

  1. Bit Angle Modulation (BAM) in a PIC
    By Bronx68 in forum mel PIC BASIC Pro
    Replies: 150
    Last Post: - 24th February 2015, 13:41
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  3. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 11:08
  4. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 04:08
  5. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts