I have a problem connecting my Ping sensor to my Microcontroller.
From what I understand, the controller is supposed to send a signal to start the Ping, then set the pin high and wait for a response from the Ping. The time between this starting and recieving is how distance is calculated.
I have two problems,
First, I only have analog Inputs, so I cannot send the initial pulse out to the Ping and wait.
Second, I believe the Onboard FPGA can only accept 3v, so I don’t think I can use a combination of analog and digital to use this.
So is there a way to use this another way?
I’m thinking a very simple microcontroller, some sort of timer, etc… so I can unload all the processing of the Ping to this new controller…
Basically I will use my Microcontroller to turn on this new controller and then have it do all the work, returning a voltage to my analog inputs related to the distance…
Does this seem like an OK way to do it? I really have no idea where to start with any of this, so any guidance would be great!
Why not ditch the ping and use a GP2D12 instead. Then you only have to deal with the 5vdc to 3.3vdc conversion as the GP2D12 provides an analog output and requires no start pulse.
I am using 4 GP2D12 IRs on a rotating base that map the surroundings, but the Ping is mounted in front of my bot as a wider band sensor. The IRs measure in 5 degree intervals, but depending on the distance from an object, they would miss narrow objects…chair legs, lamps, etc given the right conditions.
I believe the Ping will detect these but more as a proximity alert so I dont bash into them, not as a precise distance.
Is the FPGA your actual controller? If so, you’ll need to change the programming and add in some digital I/O pins. I can’t imagine any robot controller that couldn’t use digital I/O for things such as switches and of course sensors like the PING.
If you only have 3.3V or some other voltage besides 5V, you will need to add some glue logic, which might be doable inside the FPGA, for level shifting. Sensors like the Ping and IR sensors found here require 5V. Otherwise the level shifting will have to be done externally.
This should mostly be doable within the FPGA itself. That’s the beauty of having programmable hardware.
I’ll probably go with the MaxSonar. I already own the Ping, so it would have been ideal to use.
Programming the FPGA is something I’m not comfortable doing, It’s an Arm9 processor with imbeded Linux, but it is no longer made or serviced, so I don’t want to risk screwing it up!
I thought this would be something I could rig up with a cheapy pic processor or something along those lines.
There is always the possibility of doing this. Use whatever you are familiar with. Most PICs have both analog and general purpose digital I/Os and much more. If you use something like an 18F2550, you have the possibility of programming and communicating with it using USB as well as standard TTL serial, I2C, or SPI.
I’ve got one of the maxbotix sensors (EZ1), and they work pretty well. They can also do a PWM output and serial (inverted 5V TTL), both of which give you a bit more noise immunity than using an ADC.
However, if you’re going to use it as a bump sensor, you might want to mount it on the back of your bot facing forward, as they have a dead zone of about 12 cm (plus the beam would be a bit wider, which is good for your purposes). Might be worth looking at the EZ0 vs. the EZ1 too…