简体   繁体   English

HC SR04 + Arduino Uno失去连接问题

[英]HC SR04 + Arduino Uno lose connection issue

在此处输入图片说明 I am using the following devices/components to for distance measurement using ultrasound sensor. 我正在使用以下设备/组件使用超声波传感器进行距离测量。 1. Arduino Uno board 2. HC-SR04 ultrasound sensor 3. Breadboard 4. Arduino jumper cables. 1. Arduino Uno板2. HC-SR04超声波传感器3.面包板4. Arduino跳线。 5. Sketch : Provided at http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/step3/Upload-the-sketch/ 5.草图:位于http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/step3/Upload-the-sketch/

My setup is pretty much what is mentioned in the above link. 我的设置几乎是上面链接中提到的内容。 Everything works fine but it seems like the sensor doesn't fit securely in the breadboard. 一切正常,但似乎传感器无法牢固地安装在面包板上。 If I push the sensor forward it works fine. 如果我向前推动传感器,它可以正常工作。 If I push it backward it keeps giving me only one reading (5 cm in this case). 如果我将其向后推,它只会给我一个读数(在这种情况下为5厘米)。 When you push the sensor you can feel it hinges back and forth. 当您推动传感器时,您会感觉到它前后摆动。

I soldered another sensor on a protoboard but it has the same issue. 我在原型板上焊接了另一个传感器,但是它有同样的问题。 When I apply pressure from top it works fine, otherwise it keeps giving me just one reading. 当我从顶部施加压力时,它可以正常工作,否则,它只会给我一个读数。 Has anyone faced similar issue ? 有没有人遇到过类似的问题? How to resolve it ? 怎么解决呢?

Yeah I did with a sound sensor soldered, even though this might seem as a too simplistic answer, in most cases it's the sensor which is defective. 是的,我做了一个声音传感器的焊接,尽管这似乎过于简单了,但在大多数情况下,传感器是有缺陷的。

Although you can try to eliminate a few problems before arriving to that conclusion: 尽管您可以在得出结论之前尝试消除一些问题:

  1. Use a breadboard, and see the responses (does it work fine? Yes then the problem is your soldering, No or only when I push it really hard down: the sensor is defective) 使用面包板,然后查看响应(是否工作正常?是的,那么问题出在您的焊接上,否或仅当我将其真正按下时:传感器有故障)
  2. Soldering, if yes it is the problem are you using rosin core solder? 焊接,如果是,这是问题所在,您是否使用松香芯焊料? Led solder? LED焊料? If yes you are using rosin, sometimes happens to me that rosin is not the best solution because the resin seems to impair some of the connection on the circuit (I KNOW IT'S WEIRD) 如果是的话,那么您使用的是松香,有时候我会想到松香并不是最好的解决方案,因为树脂似乎会削弱电路上的某些连接(我知道这很奇怪)

    • Make sure you solder it properly to the protoboard (perfboard, string board) and that the solder fully goes through the pins and wholes! 确保将其正确焊接到原型板(穿孔板,弦板)上,并且焊料完全穿过引脚和整个引脚! You want to have at the end a triangle kinda like coming out of each hole following the pin 您希望最后有一个三角形有点像从销钉后面的每个孔中出来
  3. If soldering is not the problem then make sure there is no loose connection on the circuit of the sensor, sometimes those sensors take a beating when shipped, it's not your fault but if the pins are loose then the connection pin-to-hole is no good, so either send it back or re-solder it 如果不是焊接问题,则请确保传感器电路上没有松动的连接,有时这些传感器在出厂时会跳动,这不是您的错,但如果引脚松动,则说明引脚与孔之间的连接不存在好,所以可以寄回或重新焊接

Let me know! 让我知道!

A lot of dirt during soldering, wash it with alcohol then try again. 焊接过程中有很多污垢,请用酒精洗涤,然后重试。 Also you may try to use prototyping board. 您也可以尝试使用原型开发板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM