Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

netduino plus and parallax ultrasonic


  • Please log in to reply
3 replies to this topic

#1 manee

manee

    New Member

  • Members
  • Pip
  • 1 posts

Posted 13 October 2012 - 07:10 PM

Hi all, I am new to using netduino plus and am wondering why my parallax ultrasonic ping does nothing. I am using a tristate port to get the readings but there seems to be no variation in the data being read. My main question is how do i know if the sensor is working? I dont see the LED on the ping sensor light up (like shown in youtube arduino videos). Anyone who can share working c# code would help. I have attached a picture of my connection. please tell me if i am doing something wrong. I have a 5v connection, ground and am using digital pin 7.

#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 14 October 2012 - 01:36 AM

I have many of these working. Light should be lit. if it's getting power and detecting a ping back.(PS, don't see your attached diagram)

I am using the attached class as so:

Device defined, create event handler, and pause to allow the sensor to stabilize.
Ping ping = new Ping(Pins.GPIO_PIN_D2, 1000, true);
ping.RangeEvent += new Ping.RangeTakenDelegate(ping_RangeEvent);
Thread.Sleep(60000);

The Event Handler code:

static void ping_RangeEvent(object sender, PingEventArgs e)
{
        	
      Debug.Print("Range: " + (e.Distance * 0.39).ToString() + " in");

}

Attached Files

  • Attached File  Ping.cs   4.78KB   44 downloads


#3 Joshk

Joshk

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 14 October 2012 - 01:37 AM

The netduino pins are 5v tolerant, so it should be able to get the response without damage. However, the output from the netduino is still going to be only 3.3v and that might not be enough to trigger the Ping. Do you have another Ping and oscilloscope? A second Ping with an oscilloscope attached to the output pin should be able the hear/see the first to let you know if it is triggering.

#4 skarphedinnos

skarphedinnos

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationIceland

Posted 22 May 2013 - 09:44 AM

Dave, did you write this code? If so, Thanks a lot :)

 

Works like a charm :)

 

Regards,

Skarphedinn.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.