As a matter of fact I do have a 47k pullup (to 2.8v) on the interrupt pin (D2) though it seems to work without. I saw some datasheet that mentioned that but it may have been in a vl6180 datasheet, the led forerunner of the vl53l0x. Are you connecting the ViN on the sensor to the 3.3 on the photon. I only use the 2.8v sensor line for the pullup. I left the SHDN pin floating
using 0.6.0 firmware. The code I’m using now is exactly what peekay123 posted above
Weird. Nothing for me after the startup data. Frustrating
Did you remove the tiny piece of protective film from the sensor?
Yes, I removed the tape when they arrived. The Polou library works just fine. Not sure what the deal is.
@RWB Puzzling for sure. I wish I’d kept better notes because the SOS thing happened to me early on with the Adafruit library, although not for @ScruffR, but I can’t remember whether I was able to eliminate the SOS before the change to the new i2c code or not. You may have already tried reducing the serial speed, different connectors, different usb cable, get rid of the cloud…
@Bpr Yea I remember that a power rest of the sensor was required when switching libraries because one of the libraries was initializing something that needed reset while the other library didn’t.
The Polou library works just fine so the sensor is working as it should.
@RWB, did you try the code I posted as-is? Did you connect the GPIO pin of the VL53L0X to pin D2 of the Photon. My tests were done by compiling with Build using 0.6.1-rc.1. As @bpr pointed out, you need to move you hand above the sensor to get interrupts.
I didn’t pay attention enough that I know I needed to hook the GPIO pin to the D2 on the Photon.
It’s working perfectly now!
I’m going to keep playing around and see if I can figure out any more of the interrupt puzzle
@peekay123 I played with your modified library and was not able to figure out how to get the interrupt to work at less than 250mm. It would work to trigger the interrupt between 250-1750mm though.
The sensors are cool but not quite what I was looking for so I’ll keep checking for new libraries for this sensor on the web as time passes.
Panasonic ultra low power PIR sensors https://www.mouser.com/new/panasonic/panasonicpapir/
While expensive, these sensors are really nice and compact. They are available in black/white and come in several variants, the lowest power being 1uA, 2uA and 6uA. Also there are long range (12m) and short range (5m).
So these look like a good low power security sensor that can be used to wake up a Photon or Electron and which would allow you to use the VL53L0X sensor in regular mode if you still wanted to measure the distance of something after the PIR sensor wakes up the Photon/Electron. Interesting!
@RWB I do recommend those! I have a gateway board that @hallard that makes available on OSHPARK
that works really well to bridge the two worlds
But I haven’t given up on the damn vl53l0x either, but it’s infuriating!
@bpr I have the RFM95w LORA radio + Atmel 34u2 hooked up to a Photon which is receiving data from the RFM95W/Atmel 34u2 over UART. That gives me a way to send sensor data to a web-connected Photon from up to 1 mile away which is nice.
I’m going to order up some of these Panasonic PIR sensors and see how well they work out
I found the panasonic pirs a bit too sensitive (prone to false alarms) when used outside - they trigger when the sun comes up even when I have them under a doorway overhang (and when small cats walk by) - so for a quick “fix” I cannibalized the fresnel lens from an inexpensive Chinese pir and put the panasonic pir behind that which helped considerably but not completely.
Good to know!
What exact model or models are you using? Which ones have you tried?
From my brief testing the VK53K0X will also false alarm from lights or sun in the sensors background so you have to be careful how you deploy that one outside also to avoid false alarms,
On the other hand, SimplyTronics has a “Mini pir sensor”, the ST-00082, which is relatively low current 28uA @ 3VDC that works fairly well. But all pir sensors are apparently inherently prone to false alarms except in very controlled settings (indoors better), though I am no expert. Pressure mats, anyone?
I ended up ording 3 different Panasonic versions to test out.
All of them being the more immune 6uA versions.
I picked up these 2.2m meter sensor to see if it’s less prone to false alarms due to its shorter range:
I’ll let you know what I find out after testing them
There is a new 2-meter TOF Distance sensor on the market that has a proper Arduino Library with the Sleep and threshold functions built in if anybody is still interested
The arduino library is here: https://github.com/sparkfunX/Qwiic_Distance-RFD77402
Thanks for the heads up, very interesting. Idle current draw is a smidgen higher. The operating current is lower, but it could be how they measure it. I found the eval board for sale in a couple places, but not the chip by itself.
I am still looking for an alternative to the clunky PIR sensors. The smaller ones shown above from Panasonic are a bit pricey, and still large. Same goes for the AM322 based modules (ST-00082, keyestudio ,etc.).
I am having problems with the VL53 beyond 500mm, the distance goes down if I move it farther. Hopefully the RFD chip works better.
I think I am going to end up cannibalizing a store bought sensor fixture. I need it to work outdoors, below freezing.
You did set the VL53 for long distance reading in such situations?