Reading a linear hall sensor


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    130

    Default Reading a linear hall sensor

    Hi Im using this schematic (PIC12F683):



    and this code to continuosly read the hall sensor.

    It works fairly well, but I can't read the whole range of the ADC, I can't reach pwmstat values of 0,1 or 9 what am I doing wrong?

    Just in case here is the hall sensor datasheet

    Thanks in advance
    Last edited by peu; - 3rd October 2006 at 04:12.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    1. It's a hall effect sensor
    2. the output is open-collector, the resistor should be to Vdd
    3. you need to read a frequency not a voltage
    4. read #5 in the features section of the datasheet
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Thanks for the prompt reply mister_e.

    As you can see im not familiar at all with hall effect sensors weird thing about the code/schematics I posted is that it somewhat works

    I will appreciate any hint on what to do, now that I see the sensor output is digital Im completely lost (pulsin comes to mind)

    thanks!

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Pulsin may work, Count too, an internal Timer too. I prefer internal timer in counter mode.

    Oh BTW, if it was an analog out, you should disable the internal comparator -> CMCON0
    Last edited by mister_e; - 3rd October 2006 at 05:20.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    ok timer or pulsin, either way, how do I know when to stop reading and start counting again?

    Im reading another hall efect linear sensor datasheet: http://www.allegromicro.com/datafile/1301.pdf this one looks like more appropiate for my code, but it costs 5x the price of the one Im using

    back to the HI300/D1, I don't understand how to read it from the datasheet, which by the way looks very brief.

    Can you help me with some metacode on how to read this sensor?

    thanks

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Count PORTB.0,100,ByteVar
    This will count the pulse on PORTB.0 during 100mSec

    You should measure the frequency at the sensor output first.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Computer Fan RPM Sensor Reading
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th December 2019, 20:05
  2. 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
  3. Hall effect reading
    By ewandeur in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th November 2008, 15:49
  4. Hall sensor tach
    By zipphreak in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th March 2006, 14:25
  5. Hall Sensor
    By jetpr in forum Schematics
    Replies: 2
    Last Post: - 14th February 2005, 18:55

Members who have read this thread : 1

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