Connecting 16 sensor
mkasap
Posts: 10
in Propeller 1
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,
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
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.
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.
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.
Do I need same resistors for the IR sensor (which has same or similar 3 pin)?
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.
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.
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.
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.
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,
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.
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.
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,
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.
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?
As to which controller to suggest: Propellor, of course..
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
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
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.
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