Help with pressure sensor.


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Do not mix up the ADCIN defines and the bit banging from Bruce's example.
    Some more reading..
    http://www.picbasic.co.uk/forum/showthread.php?t=2188

    And a snippet for 10 bit banging..
    Code:
    ADCON1.7 = 1
    
    	gosub getAD
    
    
    
    	press.highbyte = ADRESH
    
    	press.lowbyte = ADRESL
    
    	return
    Do a search for 10 bit ADC also..
    http://www.picbasic.co.uk/forum/showthread.php?t=4751
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Do not mix up the ADCIN defines and the bit banging from Bruce's example.
    Some more reading..
    http://www.picbasic.co.uk/forum/showthread.php?t=2188

    And a snippet for 10 bit banging..
    Code:
    ADCON1.7 = 1
    
    	gosub getAD
    
    
    
    	press.highbyte = ADRESH
    
    	press.lowbyte = ADRESL
    
    	return
    Do a search for 10 bit ADC also..
    http://www.picbasic.co.uk/forum/showthread.php?t=4751

    Mack, Malanie Ok so let me step backwards and make this simple. Let's go back to Bruce's example first and get that working first as you suggested I got ahead of myself.

    Per Melanie and Bruce's example the pic is right on. My reading of 24
    24/255*5v = 0.470v

    So let me work on that. That would mean that for every bascially .5 volt I would see my count add 24 (I realize it's .47 but for the sake of argument we'll say .5) So for 1 volt it would be 48 then 1.5 volt 72 etc to 4.5 volt top out on my sensor at 216 reading.

    If I got from 24 = 0 PSI to 216 = 150 PSI that would be 216-24 for 192 increments at a max of 150psi = .78125 PSI per incrment. So the calculation would be
    ( adval - 24 ) * .78125
    ( 24 - 24 ) * .78125 = 0
    (120 - 24 ) * .78125 = 75
    ( 216 - 24 ) * .78125 = 150

    Right half way between 216 and 24 would be 96 + the offset of 24 I would get a reading of 120 so 120 - 24 = 96 * .78125 = 75

    I think I got this so far.

    I don't know why I am struggling with this so much but I think this is right so far. This looks correct to me so far let me hook this up to my compressor and take a look

    David

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 22:42
  2. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  3. PICBASIC PRO-coding for wireless sensor node
    By syazila in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2009, 00:05
  4. Replies: 6
    Last Post: - 18th January 2008, 08:17
  5. 1-Wire Pressure Sensor
    By Mith in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th August 2005, 00: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