Wiring Ultrasonic sensor w/ temp compensator

Home Forums Mayfly Data Logger Wiring Ultrasonic sensor w/ temp compensator

This topic contains 4 replies, has 4 voices, and was last updated by  Sara Damiano 2 months, 1 week ago.

  • Author
  • #2253

    Luis Andres Guillen

    I am trying to get a Ultrasonic sensor to work. Hope I can get help with 3 questions:

    1. I need to wire the temperature compensator Maxbotic MB7955 to the Ultrasonic sensor MB7389. I have already a terminal soldered to the Ultrasonic sensor. I know that the red cable from the temp compensator goes to pin 1 in the ultrasonic sensor, but then I have two more cables that I should attach to the sensor: Shield (yellow) and White. Where should those to cables go? In a picture from the workshop I saw one cable connected to black. But I don’t know if that is the Shield or if that is White, and what happened to the other cable.

    2. Then from the Ultrasonic sensor, I would connect to a Grove Screw terminal and just connect the B,R,G, right? The Grove Screw terminal then goes to Pin 5 in the Datalogger

    3. Is there need to have an extra line of code for the temperature compensation sensor, or the Ultrasonic sensor will work fine just by connecting it?

    Thanks in advance for any help,
    Luis Andres Guillen

  • #2255

    Shannon Hicks

    The temperature compensation sensor for the Maxbotix sensor doesn’t interact with the Mayfly at all. It’s connected directly to the ultrasonic sensor’s pin #1, so the Mayfly doesn’t need to know anything about it. All the Mayfly does is capture the serial data that comes from the sensor’s data pin.

    I’ll be away from my desk most of the day doing remote sensor station installation, but when I get back to my lab I’ll try to take some pictures of the wiring setup for my ultrasonic stations and post those along with a description of how to hook up the cables.

  • #2262

    Luis Andres Guillen

    Hello Shannon,
    Did you have a chance to take the pictures of the wiring setup. Or are they posted somewhere else?
    Thank you in advance!
    Luis Andres Guillen

  • #2278

  • #2279

    Sara Damiano

    The red cable from the MaxTemp goes to pin 1 on the MaxSonar. The shield (yellow) and black cables from the MaxTemp both go to pin 7 on the MaxSonar. Pin 7 on the MaxSonar is also connected to ground (black) from the grove, so you’ll be shoving three wires into the MaxSonar screw terminal at Pin 7. Pin 6 on the MaxSonar goes to Vcc (red on the grove). Pin 5 on the MaxSonar goes to D2/white on the grove, if you want to use pin 5 on the Mayfly to receive data.

    In your data sketch, you then need to set up an instance of SoftwareSerial with the Rx set as pin 5. Then you want to use the parseInt() function to capture the data from the MaxSonar. (But throw away the first 6 lines from the MaxSonar after power-up, because it sends out a header before sending out data.) There’s an example sketch here: https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger/blob/master/examples/mayfly_sonar/mayfly_sonar.ino

    You can also use the ModularSensors library (https://github.com/EnviroDIY/ModularSensors) with the MaxSonar, if you’d prefer.

You must be logged in to reply to this topic.