Reading curnt consumption with 16F877A


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Scratches head...
    Scratches head some more...

    re-rerads posts
    Scratches head yet more...

    I can see what TIMMERS means but I'm still scratching my head at IOANNIS's surgestion... i not sure what ya mean...

    acording to my calculation, a resistance of 5 ohms will give me a voltage drop of 1 volt @ 200mA. a 1volt loss is acceptable since i was going to add a diode in to re-use the forward EMF, so i was looking at a voltage drop of 0.3V anyways... so now, i'll just pump up the input voltage by 1.5V to compensate...

    so, i've added 6 resisters in series to make 5 ohms to give a high wattage...
    I've make two voltage deviders [4:1] ether side of the resisters using 100k resisters... so now i hoinh to solder it up write the subroutine and see how many diferent ways it can tell me to get stuffed... lol

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    A ready made solution like the chip timmers suggested is perfect but can be expensive too.

    5 ohm is too high for the job. Put a low one in the range of 0.1 to 0.5 ohms. There is no need to dissipate too much power on this resistor.

    And besides this, you need some form of filtering after you get your voltage sample. A low pass filter is necessary as the motors do produce spikes.

    Then the analog input of a PIC needs at least 2.5 to 3 volts so you have to amplify with an op-amp the voltage of the resistor by a factor of 50 to get from a 0.5ohm at 200mA the 0-5 Volt PIC input.

    A LMC66x series is a good choice for the op-amp that has to work at low Vdd voltages (+5V) and is rail to rail output.

    Ioannis

  3. #3


    Did you find this post helpful? Yes | No

    Default

    what you mean a pic needs 2.5-3 volts? It doesn't say that in the datasheet...

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    Not all PIC ADCs are the same. Look carefully in the data sheets of the specific ADC. You cannot have a voltage spn of 1,7 volt an expct the PIC ADC to have full scale on 0-1,7. The PICs reference voltage has a minimum and this is what you have to look for.

    Ioannis

  5. #5


    Did you find this post helpful? Yes | No

    Default

    ahhh, i see... in that case if i use normal 5V REF and just subtract the low ADC from the high ADC...

    After adding in all the software last night, i compiled it... 250 ish lines of pic basic... allmost 1200 words used once compiled

    Runs slightly slower, and i still not added in the unfinished auto tune sub routine...

    So, looks like i'm going to have to take the core of the control system and drop it to my pic18 and use a 16f877 to do all the maths and the display...
    Raises the question of whats the fastest way of getting them to talk without using up bucket loads of IO lines... and preferably without interupts...

Similar Threads

  1. Fuel consumption display
    By veijavi in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 27th December 2011, 06:05
  2. Using CCP1 and CCP2 to measure instant fuel consumption
    By srspinho in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th September 2008, 15:50
  3. Gasoline consumption Math
    By srspinho in forum General
    Replies: 5
    Last Post: - 12th November 2007, 10:21
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. 16F877A stack problems
    By rocketman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st October 2004, 16:54

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