Shop OBEX P1 Docs P2 Docs Learn Events
Connecting 16 sensor — Parallax Forums

Connecting 16 sensor

Hi,
I have 10 ping (ultrasound), 6 infrared (sharp) sensors ordered from Parallax. I wonder if it is possible to connect all of them on to the PropellerWX board? My concern is the power. Each of them require 5V and is it OK to connect all of them to the 5V pin?

I will use them on ARLO robot. So in addition to the 5V pin on the propeller board, I have ARLO bot power distributer with 5V output.

Thanks for your help,

Comments

  • PublisonPublison Posts: 12,366
    edited 2016-08-09 19:03
    The Ping requires supply current: 30 mA typ; 35 mA max
    so 10 would be 300ma.

    The WX regulator puts out:

    1.8 A Voltage Regulators
    The 5 and 3.3 V switching regulators can deliver up to 1.8 A each, with a 6 to 26 volt input, although a
    maximum of 15 VDC is recommended.

    I do not see thing anything on the WX that requires 5.0 volts, so all the current should be available. Just make sure you place a 3.3K resistor from the Ping to the Propeller input.

    EDIT: If you are using servos, they will pull from the 5.0 volt supply. Use the Poer Distribution Board for the 5 volts for the servos.



  • I haven't heard of that many pings used together (though I'm sure it has happened)... Are they any concerns of multi bounce returns from one corrupting another? Even with their semi-directionality it seems like 10 on a circle is a bit tight unless you are going around in a star type pattern.
  • geo_leeman wrote: »
    I haven't heard of that many pings used together (though I'm sure it has happened)... Are they any concerns of multi bounce returns from one corrupting another? Even with their semi-directionality it seems like 10 on a circle is a bit tight unless you are going around in a star type pattern.

    Yes Pings can easily interfere with each other. They should be triggered one at a time with a bit of time between each triggering to give echos time to die down.

    The Sharp IR sensors have analog outputs. The Propeller Activity Board WX (PABWX) has two analog inputs. You'll want to use an analog to digital converter (ADC) like the MCP3208 to read the Sharp sensors. The MCP3208 can read eight analog inputs and requires three I/O pins. So the 16 sensors would likely require 13 I/O pins.

    You could use fewer Ping sensors and mount the sensors on a servo to point them in different directions. I mounted both Ping and Sharp sensors on a servo gimbal on one of my robots.

    index.php?action=dlattach;topic=166.0;attach=500;image

    I think there are I/O expander chips which would allow you to control multiple Ping sensors with a few I/O pins but I don't have experience with these chips myself.

    If you use 13 I/O pins for the sensors, you're left with four I/O pins to control the motors and read the encoders. This is barely enough if you use a single channel on each encoder.


  • Thanks for all information. I am a bit slow on the development of this robot (just try to spare few hours a week). Soon I will update you with the result of above recommendations.
  • There are 3 pins on the Ping sensor. (+), (-) and (Data). 3.3K resistor should only be connected to (Data) pin between propeller, is that right?

    Do I need same resistors for the IR sensor (which has same or similar 3 pin)?



    Publison wrote: »
    The Ping requires supply current: 30 mA typ; 35 mA max
    so 10 would be 300ma.

    The WX regulator puts out:

    1.8 A Voltage Regulators
    The 5 and 3.3 V switching regulators can deliver up to 1.8 A each, with a 6 to 26 volt input, although a
    maximum of 15 VDC is recommended.

    I do not see thing anything on the WX that requires 5.0 volts, so all the current should be available. Just make sure you place a 3.3K resistor from the Ping to the Propeller input.

    EDIT: If you are using servos, they will pull from the 5.0 volt supply. Use the Poer Distribution Board for the 5 volts for the servos.



  • Anything that operates directly from +5V usually outputs a 5V signal which always needs to be current limited or converted for the Prop.

    If you are triggering the sensors independently but only one at a time to prevent interference you could combine all the data lines from the ping sensors together in diode OR arrangement with a pulldown and then you would only need a single 3k3 resistor to the Prop. So 10 trigger outputs and 1 data input is all you need.

  • MikeDYurMikeDYur Posts: 2,176
    edited 2016-08-09 22:20
    Anything that operates directly from +5V usually outputs a 5V signal which always needs to be current limited or converted for the Prop.

    If you are triggering the sensors independently but only one at a time to prevent interference you could combine all the data lines from the ping sensors together in diode OR arrangement with a pulldown and then you would only need a single 3k3 resistor to the Prop. So 10 trigger outputs and 1 data input is all you need.



    How would you discern what ping sensor was what, essentially you just have one ping.

    EDIT: Forget it Peter, I get it, it's all about timing.
  • Anything that operates directly from +5V usually outputs a 5V signal which always needs to be current limited or converted for the Prop.

    If you are triggering the sensors independently but only one at a time to prevent interference you could combine all the data lines from the ping sensors together in diode OR arrangement with a pulldown and then you would only need a single 3k3 resistor to the Prop. So 10 trigger outputs and 1 data input is all you need.

    Peter, the Ping only has one pin. The I/O pin triggers the Ping as an output and then switches to an input to listen for the echo.
    mkasap wrote: »
    Do I need same resistors for the IR sensor (which has same or similar 3 pin)?

    The IR sensor has an analog output. You generally wouldn't connect this directly to a Prop I/O pin. You'll want to use an ADC like the one I suggested. You'll likely want to run the ADC at 5V so you'll need a 3.3k resistor between the ADC output and the Prop's I/O pin. We can help you wire this up when you're ready.
  • What about something like the CD74HC4067 for multiplexing the trigger/echo pin on the ping? There are quite a few breakouts available for it. Pivoting it on a servo would work well too if you don't mind an extra electromechanical bit.
  • geo_leeman wrote: »
    What about something like the CD74HC4067 for multiplexing the trigger/echo pin on the ping? There are quite a few breakouts available for it. Pivoting it on a servo would work well too if you don't mind an extra electromechanical bit.

    That's a cool chip!

    I'd imagine that would work fine. mkasap could use PABWX's ADC inputs and not need to purchase an addition ADC chip.

  • Finally I am back with MCP3208 chips... I plan to use 2 of them for my 16 sensors. To simplify the case I am planning to connect as in the image attached. (Sorry it is the first electronic diagram I draw with an online tool, thanks to digi-key)

    Do you think this schema will work? How should I connect the MCP3208 to PropellerWX? Just CLK, DIN, DOUT ports are needed? where should they connected?

    Thanks for your help,
    747 x 544 - 319K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2017-03-07 01:33
    The MCP3208 isn't a great choice for Ping sensors.

    Unfortunately your schematic won't work. The Pings need a trigger signal.

    The MCP3208 is best used with sensors with an analog output rather than a pulse length.

    If you use the MCP3208 for other purposes, you might want to have a set of PCBs made from OSH Park. I posted the Gerber files here.

    I'll reply later with some suggestions on how to use multiple Ping sensors with as few pins as possible. (Unless someone beats me to it.)

    Edit: The MCP3208 should work great with your Sharp sensors.
  • I'm having a bit of trouble thinking of good ways to monitoring 10 Ping sensors.

    One problem is the sensors require a bidirectional communication line. I think the IC suggested by geo_leeman would likely work but I've never used those parts myself.

    Even if you could be sure to individually trigger the Ping sensors, the echo pulse would end up triggering the remain sensors if these lines were all tied together.

    Using a '595 shift register of some other output expander would only solve half the problem with using multiple Pings. You'd still need a way to monitor multiple inputs. Using a '165 chip crossed my mind but it would be a trick to catch the return echo precisely.

    Some sort of mux chip like one suggested by geo_leeman would likely be a better option than trying to use shift registers to trigger and read echos from the Pings.

    I think there may be a way of using a shift register in this application. Rather than trying to trigger the sensors with a shift register, you could use a shift register to power each Ping sequentially.

    A high power shift register like the TPIC6B595 could be used to power one Ping at a time. You'd connect the ground pin of each Ping to one of the outputs of the TPIC6B595 chip. You'd leave all the Ping sensors connected to the 5V supply and use the TPIC6B595 to connect the ground pins to ground one at a time. Each signal pin on the Ping should have a resistor (4.7kohm is my guess) between it and a common I/O pin on the Propeller. I'm a bit concerned that the Ping sensors could use the Ping's signal line to complete the power circuit but the 4.7k resistor would hopefully prevent the Ping from getting enough power to cause a problem. If this strategy worked, you could monitor 10 (or more) Ping sensors with four I/O pins on the Propeller.

    I'm not at all sure this approach would work well and as I think about it, I think some sort of mux chip would likely be a better solution. Hopefully someone else will chime in with a better solution.
  • Thanks Duane,
    I will look forward for a solution about ultrasound sensors. I was planning to trigger sound sensors in two groups, odd and even numbered (if indexed in counter clock wise) ones. So I was expecting to overcome the sound interference. If there will be still interference then will divide the 10 sensor into 3,4 or 5 groups.

    Coming back to sharp sensors, If I replace the ping ones, with sharp ones (sharp ones also have three pins: +, - and signal) in the attached schematic, do you think it will work fine?

    Thanks,



    Duane Degn wrote: »
    The MCP3208 isn't a great choice for Ping sensors.

    Unfortunately your schematic won't work. The Pings need a trigger signal.

    The MCP3208 is best used with sensors with an analog output rather than a pulse length.

    If you use the MCP3208 for other purposes, you might want to have a set of PCBs made from OSH Park. I posted the Gerber files here.

    I'll reply later with some suggestions on how to use multiple Ping sensors with as few pins as possible. (Unless someone beats me to it.)

    Edit: The MCP3208 should work great with your Sharp sensors.

  • kwinnkwinn Posts: 8,697
    An analog mux like the cd4051 or cd4066 should worl for this. Another option would be a small microcontroller with enough I/O pins to control 16 pings and send the timing info to the propeller serially.
  • CD4066 has active high controls, so a '138 decoder would need inverters. Plus, when a switch is not selected, that In and Out go to Vss so you need a mux on the prop side.

    I like the idea of a separate micro with enough I/Os.

    OR, would it be possible to have a single Ping on a turret? Point it in the direction you want to sense. I know the whole idea is to use multiple Pings, but perhaps that just isn't practical.
  • Thanks for all inputs. Now ordered the attached multiplexer. It has 16 channel (10 ultrasound + 6 IR sensors) CD74HC4067.

    I again assume that I will connect all + and - of all sensors to the same + and - on Propeller. And hoping I will not need additional Resistors or inverters etc as I am using this breakout or still do I?

    As second option, which microcontroller you may suggest? Ardunio Mega? or would there be something much simpler and using less power?
    500 x 429 - 37K
  • I looked at the cd74hc4067 data sheet and cannot see why it won't work just fine with the Pings. Connect one Ix pin to each Ping, connect S(0..3) and common I/O to the prop (also enable if you are conservative). Now drive S(0..3) to select the Ping you want and then it is just like the examples. If the IR sensor is just a single output (sense/nosense) it ought to be Okay as well.

    As to which controller to suggest: Propellor, of course..
  • At what voltage will you be running the 74HC4067? If 5V, it may or may not recognize "highs" from the Prop, since its guaranteed high input threshold is 3.5V. If 3.3V, you will need to protect its inputs on the Ping))) side against over-voltage.

    A better choice would have been the 74HCT4067, since it uses TTL signal levels and will work just fine with the Prop when powered from 5V.

    -Phil
  • Thanks Phil, how to protect the inputs of 74HC4067?

    I will run 74HC4067 with 3.3V from Propeller. Should I put a 4.7k resistor between 74HC4067 each input pin and the ping's S pin?

    Thanks


    At what voltage will you be running the 74HC4067? If 5V, it may or may not recognize "highs" from the Prop, since its guaranteed high input threshold is 3.5V. If 3.3V, you will need to protect its inputs on the Ping))) side against over-voltage.

    A better choice would have been the 74HCT4067, since it uses TTL signal levels and will work just fine with the Prop when powered from 5V.

    -Phil
  • mkasap wrote: »
    Thanks for all inputs. Now ordered the attached multiplexer. It has 16 channel (10 ultrasound + 6 IR sensors) CD74HC4067.

    I don't see a reason to run the IR sensor data lines through the multiplexer. You'll still need to read the values with an ADC. I'd think you'd want to run the IR sensor data lines directly to the MCP3208 inputs.

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-03-08 18:02
    I'd power the CD4067 from 5V, and use a bidirectional level shifter (such as this one or this one) between the propeller (3.3V) and the address and common data pins of the mux. This kind of level shifter is usually meant for interface to i2c devices but it should work fine here too. If you look at the picture and schematic of that first Sparkfun device, you will see that it is made from 4 simple mosfets, so you could even DIY out of discrete parts in the same way. That is for the PINGs. For the Sharp IR, it depends on which version you have.
  • Duane Degn wrote: »
    mkasap wrote: »
    Thanks for all inputs. Now ordered the attached multiplexer. It has 16 channel (10 ultrasound + 6 IR sensors) CD74HC4067.

    I don't see a reason to run the IR sensor data lines through the multiplexer. You'll still need to read the values with an ADC. I'd think you'd want to run the IR sensor data lines directly to the MCP3208 inputs.

    Duane is correct, of course. I was looking at the IR sensors with digital outputs, observing they just returned sense/nosense. I see now that the sharp sensor returns an analog value that needs to be converted.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-03-08 19:30
    One nice thing about the TXB010x series of bidirectional level shifters is that they have an output enable pin that can take disable the i/o, take it to high impedance. Route the one common data pin of the CD4067 both to the level shifter and to your ADC ( via a resistor). TXB enabled--PING, TXB disabled--ADC. For that scheme you have to have separate control over the mux channel selection (always enabled) and the data pin translation (enable/disable). The Sparkfun 4-channel device I linked above has only one enable for all 4 channels. I've used the TXB0101 single-channel device for this sort of thing.

    Another class of devices are level-shifting bus transceivers. Those are digital devices that have a direction control line, so the µP has to control the direction as opposed to the auto-direction devices that do it internally. They also usually have a tri-state line that brings both sides to high impedance. http://www.ti.com/lsds/ti/logic/voltage-level-translation-overview.page
Sign In or Register to comment.