HC-SR04 / HY-SRF05 distance sensor not working on Pico? #743
Replies: 10 comments
-
Posted at 2015-05-01 by @gfwilliams So yours has 5 pins, and you're not connecting to One thing it could be is the Pico has slightly different names for power signals than the original Espruino board, which is a bit confusing. You need to connect to the pin marked 'VCC' on the board (the one labelled |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by DrAzzy It looks like you leave Mode disconnected, and then it behaves just like an HC-SR04... It does need to be powered off VBat/Vcc (not BAT_IN or 3v3). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by Bennr Ah, right, so I was powering it off It does seem to be maxing out at 4cm ish though, when there is nothing in front of it, but that could just be how it's set up (currently just plugged into a breadboard), or maybe a limitation of the module? Thanks @drazzy and @gordon I am really enjoying playing with the Pico. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by @gfwilliams Great, glad it's working(ish). VBat (or 5V/Vcc on the Pico) is either the power the comes from USB via a diode (so around 4.5v), or if you've got a battery plugged in it's battery power (without any diode voltage drop). It should be enough for the sensor though - it works great for the HC-SR04. It's actually possible the sensor is picking up a reflection from the desktop - if so, 4cm sounds about right. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by Bennr I just did some (un)scientific testing and still can't get the thing to get the right distance. I moved the sensor the the very edge of the desk at the edge of the breadboard and measured some distances using a ruler and the handy Espruino reference card that I got in the kit and got the following values (actual measurement on left, console.log on right):
I am guessing it's probably something to do with my module, but does that kind of pattern make any sense to you? Some kind of resistor needed? Again, apologies for my utter ignorance about this stuff. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by @gfwilliams Strange... I'm afraid it doesn't make much sense to me - it might to someone else I guess. The delay should be proportional to the speed of sound, which wouldn't change depending on the module :) And you're definitely not using the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by @allObjects Watch out what you try to use for reflection of the sound... I had my share of surprises on a different medium, but still some material that I expected to work correctly, did not do so. You have also be aware of indirect reflection. To get clear results not only direct sight matters but also what comes or is close to the send receive axis... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-02 by Bennr Hi guys, I tried the other analog pins I have access to (only A5,A6,A7,B1 as I soldered the shim and wifi module on) and got the same results. Do you think I could have messed something up soldering the wifi module on? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-03 by Bennr An update. I ran the sensor from the 5v/GND lines of the Arduino while pinging the trigger and echo with the pico. I got what I was expecting (although every other line there was a weird enormous number, but I guess that has something to do with the Arduino) so I guess this module needs a full 5v for power. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-05 by @gfwilliams Thanks for the update... That's strange though - most 5v stuff copes just fine with 4.7v or so. If you absolutely need that voltage (and you're not planning on using the battery circuitry on the Pico) you can just short out the diode to get full 5v though. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-05-01 by Bennr
Hi all,
I have tried following the guide at http://www.espruino.com/HC-SR04 to get the HY-SRF05 module working. From what I understand it is pretty much the same as the SR04, but I am super new at electronics, so maybe it isn't!
Anyway, I am using pins A6/A7 as I have the Wifi module on A0-A4 and I am always getting an output of between 35 - 45 when I log it in the console regardless of whether something is in front of it.
Anyone got any ideas on why it might not be working?
Beta Was this translation helpful? Give feedback.
All reactions