ADC LV-maxsonar Ez1 range finder o/p voltage

hi friends,

please have a look at the following specs and help me out!

specs: The LV-MaxSonar detects objects from 0-inches to 254-inches (6.45-meters) and provides sonar range information from 6-inches out to 254-inches with 1-inch resolution.

when using the analogue pin:

AN –
Outputs analog voltage with a scaling factor of (Vcc/512) per inch. A supply of 5V yields ~9.8mV/in. and 3.3V yields ~6.4mV/in. The output is buffered and corresponds to the most recent range data.


the output voltage at a range of 10 inches = 98 mV. Am using an 8-bit ADC and when using the formula X= ( Vin/Vf.s) * 2^n - 1, at 254 inches the digital output is 127!! shouldn't it be 255?? i mean 5V --> 254 inches (full range) --> 255 (n=8bits)..



so if i use it as it is, taking the output at 10 inches, X = (98mV/5) * 255 = 4.998=5.. what will be the consequence?? should the output be amplified?

the microcontroller being used is PIC 16F877A.





please reply soon!

thanks,
satanas

Replies

  • Stephen_c
    Stephen_c
    well according to me... u are dividing your vcc by 512 for each inch...as a result you are getting 9.8mV/inch but if u consider the range of 254 inch the max output voltage u will get is 9.8mV/inch*254 which is abt 2.499V . try to use scaling factor of 254 which will simplify your adc values.. also X = (98mV/5) * 255 = 4.998=5 is not right. ..at 98 mV you have distance of 10 inch.. so if you use scaling factor of 254 than you will get value of 10. Hope this helps
  • satanas
    satanas
    hi stephen,

    the scaling factor of Vcc/512 is an "in-built" one.. it's not me who decide on the factor.. so u see the problem.. the idea of dividing by 256 is similar to amplifying the analog o/p by a factor of 2 but i can't really divide by 256. anyone used this sensor before??
    please help!

    satanas
  • Stephen_c
    Stephen_c
    so max output u will get is 2.5 volts.. either u configure your adc to accept 2.5 volt as high value or use an op-amp to convert value to 5V.. also the value in the adc resiostor can be dsigned ot have values corresponding to voltages ... for e.g. for 1 volt input value should be x than for 2 volt input value should be y.. i dont know how the register allocation in uC work.. but i hope this helps

You are reading an archived discussion.

Related Posts

Dear Collegues, I need some Guidance over an Appropriate DSP cum Realtime Embedded Microcontroller which can be used for both Image Processing and to control a Robot ... the Image...
Hi, I had decided to do my Master's thesis on topic " Development of Flux for Cladding Process by Submerge Arc Welding Process" Please give necessary suggestions about it.
In order to take elite Indian Engineering Education global, India is now pushing forward the proposal of setting up IIT in Singapore. The education ministers of both India and Singapore...
Hi all... Let me Introduce myself.. I was graduated from Metallurgy Engineering and work for my self as Indonesian Modificator for motorcycle in Ricky Motor Sport....we concentrate in Fiberglass body...
Here's a list of posts we published during last week. Make sure you did not miss any - Mobile Number Portability coming to India by June 30, 2010 - CrazyEngineers...