Maxbotix (with Arduino) LV EZ1 questions
August 24, 2011
I am having problems with wrong readings from EZ1 and my Arduino. I am using the PWM mode and I have checked all tutorials/samples I found. So my questions would be:
- Is there a "tested-by-someone-from-LMR" code sample for Arduino and EZ1 in PWM mode? (just to triple check a working code sample)
- How long should I allow for it to warm up? (I saw everything from none to 350 ms (startup time) + 100 ms (2 20 Hz cicles))
- How often can I take a read (pulseIn)? I have seen everything from 10ms to 50ms (20 Hz) to 300ms to allow for the echo to return!
- Can I just do one pulseIn after the previous one (and some delay)? I saw several people "resetting" the EZ1 by sending a LOW-HIGH-LOW signal before each reading
- I get sometimes several readings with a zero (0) value. This should not happen (?) because for very close objects (0-15 cm) I should get a "15" as per specifications (after conversion to cm). How should I interpret a "0"? an error to be ignored? object really close? object really far? I can get 7-8 "0" readings in a row...
- Which is actually the minimum range of the LV EZ1? (I saw 15 cm... but sometimes I get a 12 cm rading... this might be because of the decimal rounding...)
This is for a continuously-moving obstacle-avoidance robot. So if you consider the worst case of all my research it became impossible:
- I need about 7 readings to have a good array for a median filter
- I need them 3 times (left, front, right)
- I need to allow for 300ms between each reading
This would result on a 6.3 seconds time before I can make a decision!!! :-P
Thanks a lot for your help