Go Down

Topic: NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7 (Read 575064 times) previous topic - next topic

berr08

Didn't realize this thread was a main support for this library (or at least it seems to be from what I am reading).  Can anyone help with my issue, I'm using the DYP-ME007Y sensor but it isn't working as expected:

http://forum.arduino.cc/index.php?topic=241763.0

Thanks Everyone!

fernandossala



It works like a champion!
Thanks a bunch, next time, i will send pictures and videos of the final project!
Best Regards,
Fernando


Glad I could help!  Would love to see the final project.  I hope it's something fast-moving that chases your cat around the house or something cool like that.

Tim


not fast moving chasing cat cool, but still cool...
here's a picture of the installation without the electronics
the relays will give power to three industrial fans (one for each letter). the middle one needs to be filled first, this is why i need to relays, as soon as i put the electronics inside the case, i will take more pictures and video for you guys
cheers
Fernando

teckel


Didn't realize this thread was a main support for this library (or at least it seems to be from what I am reading).  Can anyone help with my issue, I'm using the DYP-ME007Y sensor but it isn't working as expected:

http://forum.arduino.cc/index.php?topic=241763.0

Thanks Everyone!


Glad you got it working!  A bad connection like that can be hard to track down.

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

berr08



Didn't realize this thread was a main support for this library (or at least it seems to be from what I am reading).  Can anyone help with my issue, I'm using the DYP-ME007Y sensor but it isn't working as expected:

http://forum.arduino.cc/index.php?topic=241763.0

Thanks Everyone!


Glad you got it working!  A bad connection like that can be hard to track down.

Tim


Thank you!   :D

phamtuan1151

why serial.print do'nt exactly distance "?
please help me!
#include <NewPing.h>

#define TRIGGER_PIN  A0  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     A1  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
#define TRIGGER_PIN2  A2  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN2     A3
#define TRIGGER_PIN3  A4  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN3     A5
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
NewPing sonar1(TRIGGER_PIN2, ECHO_PIN2, MAX_DISTANCE);
NewPing sonar2(TRIGGER_PIN3, ECHO_PIN3, MAX_DISTANCE);
void setup() {
  Serial.begin(115200);
}

void loop() {
  delay(50);                    .
  unsigned int uS = sonar.ping();
  unsigned int uS1 = sonar1.ping();
unsigned int uS2 = sonar2.ping();
Serial.print('left');
  Serial.print(uS2 / US_ROUNDTRIP_CM);
  Serial.println('');
Serial.print('right');
  Serial.print(uS1 / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)
  Serial.println();
Serial.print('frent');
  Serial.print(uS / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)
  Serial.println();
}

AWOL


teckel


why serial.print do'nt exactly distance "?
please help me!


Yes, what he said --^   Use double quotes, not single quotes.  For example:

Code: [Select]

Serial.print("stalker");


Let us know if that fixes things for you.

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

fernandossala




It works like a champion!
Thanks a bunch, next time, i will send pictures and videos of the final project!
Best Regards,
Fernando


Glad I could help!  Would love to see the final project.  I hope it's something fast-moving that chases your cat around the house or something cool like that.

Tim


not fast moving chasing cat cool, but still cool...
here's a picture of the installation without the electronics
the relays will give power to three industrial fans (one for each letter). the middle one needs to be filled first, this is why i need to relays, as soon as i put the electronics inside the case, i will take more pictures and video for you guys
cheers
Fernando



here's the video of the Intervention I did with my installation in Copacabana

https://www.youtube.com/watch?v=ZDFbqTRK51s
and you can see the sensor working at its best

teckel


here's the video of the Intervention I did with my installation in Copacabana

https://www.youtube.com/watch?v=ZDFbqTRK51s
and you can see the sensor working at its best


I could tell the dog's ego was inflated due to your project.

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

levak

Hello!

I noticed SR06 sensor has a temperature sensor on the board as well, which can be used for temperature compensation.
Are those measurements more accurate?
How much more? Let's say I have a sensor without temperature compensation and I set my code to 20°, but ambient temperature is 30°C. How big of a deviation would I see?

Matej

teckel


Hello!

I noticed SR06 sensor has a temperature sensor on the board as well, which can be used for temperature compensation.
Are those measurements more accurate?
How much more? Let's say I have a sensor without temperature compensation and I set my code to 20°, but ambient temperature is 30°C. How big of a deviation would I see?

Matej


The formula for the speed of sound is:  m/s = 331.3 + (0.606 x C°)

So, at 20°, the speed of sound is 343.42 m/s and at 30° it's 349.48.

Towards the extreme edge of the sensor range, lets say you get a ping time of 29,000 ms.  That would give you:

29,000 ms / 10,000  x 343.42 m/s / 2 = 497.96 cm
29,000 ms / 10,000  x 349.48 m/s / 2 = 506.75 cm

So, temperature does make a difference, in this example, almost 9cm.  Likewise, at 100cm, the difference would still be about 1.75 cm, so still sizable.

With this said, it's typically not an issue.  Because for normal uses, the sensor is not being used to measure an exact distance, but instead to see if something is approaching or too close relative to a previous ping.  However, if you're using the sensor to measure an exact distance (say a water level) and you must get very precise distance results over a long period of time at various temperatures, then using a thermostat and doing the above calculation would be very important.  All depends on your need.  NewPing is designed to work easily with the built-in ping_cm() method, or you can roll your own with ping().

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

levak

Does NewPing library supports temperature compensation with SRF06 sensor?
Can it automatically read temperature and use it in it's calculation?

lp, Matej

teckel


Does NewPing library supports temperature compensation with SRF06 sensor?
Can it automatically read temperature and use it in it's calculation?

lp, Matej


The sensor does not output the temperature.  It simply reads the temp and adjusts the output based on the temp.  So yes, NewPing works along with the thermostat and is used in the calculations.

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

levak

I did some reading on SR-06 and I found out it does the corrections on the sensor itself... So yea, your lib does support that:)




teckel


I did some reading on SR-06 and I found out it does the corrections on the sensor itself... So yea, your lib does support that:)


I think that's what I said, or at least I meant to say that.

Tim
My platforms Arduino, Teensy 3.2, Arduino Pro Mini, ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster

Go Up