PORTA.4 as analog input


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    KBLIM, in the attached schematic there are two suggestions for your project:

    First suggestion: Modify the relay driver, in your shematic the base current is the collector current. The base of the PNP transistor should be polarized (pulledup) and the base current limited with a resistor. I don't think these two transistors will last long wired as per your schematic.

    Second suggestion: How to solve, in a simple way, your current reading problem.

    Al.
    Attached Images Attached Images  
    All progress began with an idea

  2. #2
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Thank you, aratti.

    Really appreciate your suggestion 1 and 2. Your suggestion one really help me to protect my resistor and the opto couple.

    However please forgive me because didn't give the connection on low ohmic resistor to measure Vi. Because of the site condition, the resistor must be connected between the positive source and the load.

    13.8V 0-------------^^^Vi^^^------------====Load=====-------------0 0V

    Therefore the suggestion 2 is not suitable for my case. The 0V will not be suitable to be my Vref- in the ADC configuration. Just wonder how :

    1. How do i setup the ADC to measure the Vi. The source is 13.8V, but pic is powered by 5V in my design.

    2. The PIC is configured in VREF+ = AVDD, VREF- = AVSS to measure others voltage reading, what do i need to change for the VREF in order to measure Vi.


    Again very thank you to aratti!

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    If you cannot mount the resistor on low side, read this application note perhaps you will find the solution.
    Al.

    http://www.zetex.com/3.0/appnotes/apps/an39.pdf
    Last edited by aratti; - 1st December 2008 at 19:13.
    All progress began with an idea

  4. #4
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Thank you aratti, I will study the pdf.





    By the way, what is the maximum Vref-, Vref+ and the voltage the pic can measure?

Similar Threads

  1. pic18f analog comparator problem
    By david.silaghi in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th May 2009, 10:38
  2. Analog input on 18f252
    By kiteman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th January 2009, 09:34
  3. Analog Input on PIC16F88
    By penelopepug in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th May 2008, 23:49
  4. 16f88 - pin RA4 as analog input
    By savnik in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 15th December 2006, 14:55
  5. Analog pins for digital input
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th September 2005, 01:32

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