NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Everything Else » LV-MaxSonar-EZ4 height measurement
March 02, 2011 by abd445 |
Hello, I am trying to use a height sensor to measure distances but its not working as its supposed to. So I built my circuit based on the temperature sensor project included in the nerdkit guide and instead of the temperature sensor I connected the LV-MaxSonar-EZ4 using its analog pin out. I used the same code as the tempsense and changed the conversion factor as voltage to inches using 1in./9.67 mV (given in the datasheet for EZ4) The problem that I am encountering is that the distance is always approximately 1.5 to 2 inches off the actual distance. Could anybody please help me? Any input is appreciated. I can answer any questions you might have regarding my project. Thanks! Adi |
||
---|---|---|---|
March 02, 2011 by abd445 |
Also could anybody explain to me, what does the height sensor with 1 inch resolution mean? |
||
March 02, 2011 by Noter |
1 inch resolution means the smallest increment it can measure is 1 inch thus all your measurements will be in whole inches with no fractional values. Maybe all you need is to calibrate by adding/subtracting 1 or 2 inches worth from the value you read from the ADC pin. Devices aren't always perfect and often a little tweak in the software is all that's needed. |
||
March 13, 2011 by abd445 |
Thanks for the reply, it was really helpful. I have another question regarding my project. The EZ-4 height sensor is always on when the circuit is powered and I was wondering if there is a way to tell it when to measure and when to be idle so that it doesn't keep draining power. Does anybody has any ideas how to implement it? Just to make it more clear, I want it to operate just like a weight scale does, i.e, it powers up when a person steps on it otherwise it is turned off. Thanks! |
||
March 13, 2011 by Ralphxyz |
So what is a EZ-4 height sensor? The only google results are this thread and Design Review. If you are measuring people's height won't you need more than a 1" resolution? I'd like to see the specsheet on the EZ-4. Very interesting paper. Ralph |
||
March 17, 2011 by abd445 |
Well EZ-4 is a ultrasonic distance measurement device. The design review that you found is our project and we have an EZ-4 with 1cm resolution instead of the 1" one. Here is the specsheet: http://www.sparkfun.com/datasheets/Sensors/Proximity/XL-EZ4-Datasheet.pdf Also, I tried using the code for the temperature sensor with some modifications, but for some reason the distance is off by 2 to 4 inches and it is not a constant. Could you think of anything that i might be doing wrong? If you want I can post the code that I use too. thanks! |
||
March 17, 2011 by Ralphxyz |
Make sure you have stable Vcc and ADC reference, you could even use a separate power supply for ADC reference (with a common ground). Also you might try some of the other reading methods possible using serial. You could easily send the serial readout to a PC to confirm the variable readings. Yes please post your code. Is your code stable with no sensor but Vcc and then Gnd to pin 23 (or whichever pin you are using)? How about with the tempsensor in place how is that? This is very interesting, I liked the XL- MaxSonar®- EZ4 that would be fun to experiment with. Ralph |
||
April 04, 2011 by abd445 |
Hello Ralph, Attached below is the code that I used. I trying to combine the height measurement with a weight scale reading as well taking help from the weight scale project proposed at nerd kits, but instead of using python i am using C and I want to display the weight on the LCD that I got from nerd kits instead of the LCD of the weight scale. I tried this code but I am unable to display the weight. It just displays a constant number 01 and it doesn't change no matter how much pressure I put on the scale. Also the temperature sensor worked fine when I tried it. Any help is appreciated. Thanks! Adi
|
||
April 04, 2011 by Ralphxyz |
I think I remember a similar occurrence, I'll try to go through your code and reload my code code to see if we can get you moving on. Ralph |
||
April 06, 2011 by abd445 |
OK thanks! Looking forward to your reply! |
||
April 11, 2011 by abd445 |
Hey Ralph, I was just wondering if you've had the chance to look through the code yet? I tried debugging it, so I removed the height sensor (EZ-4) and just hooked up the mcu to a weight scale, but I could not figure out the problem. Could you please help me with this? I am trying to get the weight from the strain gauge sensor on a weight scale and display the weight on an external LCD through mcu. Thanks! |
Please log in to post a reply.
Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...
|