Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
C

crazy_penguin

@crazy_penguin
About
Posts
11
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Distance sensor messure strange values
    C crazy_penguin

    Hi there,
    it's me again.

    I tried some things which read in the arduino froum (http://forum.arduino.cc/index.php?topic=153700.0) without any good result.
    I also get a new sensor and there is still no change of it's behaviour.

    I read in the forum that it could be a sensor that uses RX/TX to send its information.
    Does any one know something about that?

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    OK. this threat (http://forum.arduino.cc/index.php?topic=153700.0) is very usefull. I will try out some hints and tell you my result.

    Thank to all for now.

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    @hek Thanks. I will check out this and will tell you the result.

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    @hek DYP-ME007Y

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    @Moshe Livne I order the HC-SR04 Module as well to make sure where the problem is.
    I also order aother Arduino Nano.

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    Hi all,

    I am really wondering whats going wrong here. I made some changes to the code and now I get this result:

    Ping: cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 2cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 1cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm
    Ping: 16cm
    Ping: 0cm
    Ping: 0cm
    Ping: 0cm

    The distance between sensor and wall is about 75cm.

    I took back any chagnes I made. Without any effect.
    I try now use the NewPing version 1.6 library. No effect.

    Current code:

    #include <NewPing.h>
    
    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN     5  // Arduino pin tied to echo pin on the ultrasonic sensor.
    #define MAX_DISTANCE 500 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
    
    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    
    void setup() {
      Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
    }
    
    void loop() {
      delay(2000);                    // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
      Serial.print("Ping: ");
      Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
      Serial.println("cm");
    }
    

    I there any way to check I the hardware is bad or may have some defects?

    Front.jpg
    Rear.jpg

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    Hi Moshe Livne,

    I disconnect the radio device and keep the US-sensor connected and use the following code.

    #include <NewPing.h>
    
    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN     5  // Arduino pin tied to echo pin on the ultrasonic sensor.
    #define MAX_DISTANCE 500 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
    
    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    
    void setup() {
      Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
    }
    
    void loop() {
      delay(500);                      // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
      unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
      Serial.print("Ping: ");
      Serial.print(uS / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)
      Serial.println("cm");
    }
    

    I got the following results:

    Ping: 306cm
    Ping: 0cm
    Ping: 308cm
    Ping: 0cm
    Ping: 308cm
    Ping: 0cm
    Ping: 308cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm
    Ping: 0cm
    Ping: 307cm

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    No.
    It is powerd with a 5V and 2A powersupply.

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    Hi BulldogLowell,

    sorry for the delay I was over 2 weeks on vacation. but now I am back.

    I using the code from the distance sensore example (http://www.mysensors.org/build/distance).

    #include <SPI.h>
    #include <MySensor.h>  
    #include <NewPing.h>
    
    #define CHILD_ID 1
    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN     5  // Arduino pin tied to echo pin on the ultrasonic sensor.
    #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
    unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    MyMessage msg(CHILD_ID, V_DISTANCE);
    int lastDist;
    boolean metric = true; 
    
    void setup()  
    { 
      gw.begin();
    
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Distance Sensor", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID, S_DISTANCE);
      boolean metric = gw.getConfig().isMetric;
    }
    
    void loop()      
    {     
      int dist = metric?sonar.ping_cm():sonar.ping_in();
      Serial.print("Ping: ");
      Serial.print(dist); // Convert ping time to distance in cm and print result (0 = outside set distance range)
      Serial.println(metric?" cm":" in");
    
      if (dist != lastDist) {
          gw.send(msg.set(dist));
          lastDist = dist;
      }
    
      gw.sleep(SLEEP_TIME);
    }
    
    
    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    Oh, I forgot to mention that I use a DYP-ME007Y Ultrasonic Sensor Module.

    Th

    Troubleshooting

  • Distance sensor messure strange values
    C crazy_penguin

    Hi there ,
    I have built a distance sensor to measure the level of my rainwater tank. I built it with an Arduino Nano. I use an Arduino Nano as a serial gateway as well.
    The communication between the two work well. The values in my controler (FHEM) are visible.
    The main problem is strange values, I get.
    The values jump between 0 and 400, even if the distance changes to the sensor head.

    I attache a out put from the serial console.
    Don't worry about the fail. The sensor has currently no contact to it's gateway. But this is no the reason for the stange behaviour.

    Ping: 386 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:386
    Ping: 390 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:390
    Ping: 391 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:391
    Ping: 393 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:393
    send: 100-100-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
    Ping: 0 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:0
    Ping: 0 cm
    Ping: 34 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:34
    Ping: 395 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:395
    Ping: 398 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:398
    Ping: 393 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:393
    Ping: 393 cm
    Ping: 0 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:0
    Ping: 0 cm
    Ping: 250 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:250
    send: 100-100-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
    Ping: 0 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:0
    Ping: 0 cm
    Ping: 34 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:34
    Ping: 395 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:395
    Ping: 390 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:390
    Ping: 395 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:395
    Ping: 396 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:396
    Ping: 394 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:394
    send: 100-100-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
    Ping: 0 cm
    send: 100-100-0-0 s=1,c=1,t=13,pt=2,l=2,st=fail:0

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular