You are on page 1of 7

Hi again,

Hate that your robot runs into everything? This will fix that problem.
With 8 sonic sensors this looks complicated...but in fact I made this
very easy. I try to post projects that help you learn about Arduino and
show an 'outside the box' concept. This post will help you understand
595 switching, pro-minis as a programmable sensor, and the grand
use of real time led feedback. If you enjoy Arduino as a 'copy and
paste and plug-in' you might just skip this.

I like to use pro-minis. They are about $2.50, work as a full blown uno,
and installing headers makes them very flexible. Used as a sensor
micro you can have it 'do what you want' instead of what a purchased
sensor dictates. With I2C using only 2 wires they can be tied together
all on one line. So move over MEGA I can have 4 minis running 4
separate lines of code all at the same time, at just $10.00. Here I use
a mini to pop the sonic sensors through a 595 and show realtime led
distance. Then just share 8bits of data with the mother board. This
takes the load off the mother board and makes the her code very
simple.

There is a problem with sonic sensors...no visual feedback. You never


know if the sensor is just a dead weight or working! I believe who ever
came up with 'BLINK' is smarter than Einstine. Just ONE led and a
world of information is relayed by the blinking. So a sonic sensor
needs realtime feedback. Here I used an array of leds to monitor each
sensor. You don't need them, just make the sensors without the leds.
But to have the leds on the PCB is helpful.
Add TipAsk QuestionCommentDownload
Step 1: MAKE PCB
3 More Images

make PCB and populate. CAUTION...I made a mistake on the PCB at


the 4 pin connections for the sonic sensors to plug into. The ECHO
and TRIGGER Vcc and grounds were going to plug into the pcb.
There is not enough room for connectors so I just made the PCB with
pin-outs. So you can solder a wire connector to the PCB and plug into
the actual sonic sensors. As for the leds I put yellow leds at the inside
edge and red at the outside. this helps you see at distance if the
sensors are correctly measuring.

This is one of the FEW 2side pcb I ever made. I would rather make 2
ea single side and run jumpers. But to get the led display you need at
least the top pcb. I separated the layout in the download.

The PCB is for a pro-mini with A4-A5 inside the edge header. Either
way just connect A4-A5 to the Master A4-A5. Don't forget the Vcc and
Grounds too.
Attachments

 2 side 8 sonic sensor top foil.fzz

Download

 2 side 8 sonic sensor bottom echo.fzz

Download

Add TipAsk QuestionCommentDownload


Step 2: MANY MISTAKES

Now for my mistakes... I tried to pop the Triggers all at once (all tied
together) and this sorta worked well but some interactions took place.
So now all ECHOS go to the micro (8) and the TRIGGERS are set by
a 595. Three more pins (3). As for the leds, multiplexing won't work.
You need a full ON time for each led. This means each row of 7 leds
has to have its own 595. Once you update the 595 the leds stay lit
until the next update. Where multiplexing the led only lights for that
tenth of a second. This works well in my readers and it needs a
dedicated micro. No time for scanning 8 sonic sensors and measuring
distances. I tried and got very poor results. Multiplexing the leds will
also mean a grid of row + column and that means around 64+ feed
throughs in the PCB.

I used only 7 outputs from the 595 because of clutter on the PCB. At a
distance you can't tell if there are 7 or 8 leds just their motion. You
may be tempted to tie all the leds to a single resistor and this works,
but the brightness of the array changes with the amount of leds that
are lite. So one resistor per led is best. I just love the 595 but if they
just moved the Vcc and 0-out pins or made a 18 pin ic with ALL
outputs on the same side... connecting the all eight outputs would be
so easy. But then it wouldn't sell for less than 30 cents.
Add TipAsk QuestionCommentDownload
Step 3: MOUNT SENSORS
Glue sonic sensors to coffee lid. the male jack needs to be bent
inward on each sensor. This works better if you bend one pin at a
time. I used 2 side foam tape just so the vibration is less. My sensors
are too close and they need a 1/4 inch space to match the PCB better.
I have used sonic sensors before and sometimes one fails to measure
accurately and you need to keep this in mind. So don't GLUE them all
in permanently.

It also helps to run a quick distance test on each one before you use
them. I get about one sensor with a poor reading in a batch of 20. Not
bad for the price I paid.

You might also like