I purchased the Zio ultrasonic sensor (https://www.sparkfun.com/products/15171) to monitor if my garage door is open or not. I have an old Pi 2 and thought it would be a good project for it. However, I have followed all of the tutorials I can find and I am unable to detect the sensor. I saw another post saying that the sensor is on address 0x00, but I’m not sure how to change the Pi logic to handle that.
Order number: 3298486
Thanks,
Derek
Hi Derek,
I’m not sure why, but Zio assigned the HC-SR04 the I2C address 0x00 which is a reserved address. On an Arduino, you can get along OK with bending the rules a bit and using a reserved address but the Pi plays a bit closer to the rules and short of hacking the I2C drivers, I don’t think you can use a device on a Pi with that address.
It’s not ideal, but you might be able to put an Arduino in between the sensor and Pi and use that as a ‘middle man’ to pass data from the HC-SR04 and Pi.
Thanks for the feedback. Would this be the middle man you’re referring to: https://www.sparkfun.com/products/15123 ? Please recommend a “middle man”. Additionally, I was thinking of adding a relay to open or close the garage door. Does https://www.sparkfun.com/products/15093 work with the Pi?
Chris, I have been playing with i2cdump and noticed the following. If I use i2cdump -f -y -a 1 0x00, I can get data back from the device. However, after I do that once, the address changes to 0x02. When I run i2cdump -f -y -a 1 0x02, the address then changes back to 0x00. I have not been able to get a measurement, reading the two addresses. Hoping you have some suggestions for my previous post for a middle man arduino device. Additionally, I was looking at the VL53L1X (https://www.sparkfun.com/products/14722). If you can confirm that would work with the Pi 2, it might be a better option to return the ultrasonic sensor and get the VL53L1X instead of adding the middle man arduino.
Thanks.
Most any Arduino should work, but the RedBoard Qwiic would be the easiest to use.
You’re probably better off with the VL53L1X since that doesn’t have the weird 0x00 address issue the Zio part does. We don’t have any Pi code for it but you shouldn’t have any issues with it on any Pi as far as I’m able to tell.