View Full Version : Reading a linear hall sensor
peu
- 3rd October 2006, 04:07
Hi Im using this schematic (PIC12F683):
http://peu.net/temp/hall1.gif
and this code (http://peu.net/temp/prueba_adc.bas) 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 (http://peu.net/temp/hi300-d1.pdf)
Thanks in advance
mister_e
- 3rd October 2006, 04:50
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
peu
- 3rd October 2006, 05:11
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!
mister_e
- 3rd October 2006, 05:18
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
peu
- 3rd October 2006, 05:35
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
mister_e
- 3rd October 2006, 22:31
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.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.