Welcome to syzzyk.com's Robot Zone!

syzzyk.com Return to syzzyk.com home page.

Robot Zone Return to the Robot Zone.

Syzzyk's Whiskers Touch Sensors like cats whiskers for robots.

SRB1 Syzzyk's Robot #1.

Syzzyk's Robot #3

SRB3: Syzzyk's Object Avoidance Robot.

SRB3 is my latest and improved object avoidance robot featuring my own Syzzyk's Whiskers and a couple of microcontroller pin conservation techniques.

Yes, I've built a Roomba that doesn't clean anything!!! Woot! Yes, I realize what I have built; the adventure was the educational and the technical/problem solving involved.

There are four Syzzyk's Whiskers (see below) and four limit switches forward in addition to two ultrasonic detectors. I've found that ultrasonic detectors are only about 60% effective when used with an Arduino. The eight switches are connected to the logic board featuring Quad OR gates.The two left Syzzyk's Whiskers are connected to one OR gate and create a back/turn left 45 degree action, conversely the two right Syzzyk's Whiskers activate a back/turn right 45 degrees action.

The limit switches have their leafs hooked together by aquarium tubing with a small copper rod for a stiffener, when any of these are triggered the robot backs up and turns 90 degrees right. By using the logic board I only need three pins on the Arduino for all this to take place.

SRB3 Front

The Logic Board.

4071 IC Quad OR Gate

An OR Logic Gate is an arrangement of discrete components or part of an IC typically with two inputs and one output. In this application I am using 0 volts as a 'low state' or 'zero state' and +5v (from Arduino) as a 'High state' or a logical '1.' This is called 'positive logic.' The 4071 has four OR logic gates.

Take a look at the truth table in the picture. For any input state with a +5v value the OR gate passes that High value on, If both inputs are Low, nothing happens except for monitoring for a changed condition. Now, take a look at the 4071 Quad OR Gate Integrated Circuit. Notice the pin-outs and their internal configurations. Look familiar? Yes, four logic symbols just like the big one on the right. Arduino can be programmed to monitor any pin set for INPUT for it's High or Low state.

Hold the pin to 0v and Arduino knows it is Low. Apply +5v to a pin and Arduino can tell that it is High. Hook the output from an OR gate to a properly programmed Arduino pin and your program will know what is happening on the other side of the gate. Hook a Syzzyk's Whisker to A1 and another to A2, output Q1 to an Arduino pin, for instance pin 2. Now look at the truth table, if both A1 and A2 are not touching anything then Q1 is off. If either A1 or A2 or both are triggered then Q1 goes HIGH. This HIGH to pin 2 can be used to trigger an 'if' in an Arduino sketch to run a procedure.

Logic Board with the 4071 IC

Logic Board connected to switches and Arduino

Compare the pinouts in the previous step with the 4071 IC in the center of this circuit board. Follow the traces on the board, which is laid out very similar to a solderless breadboard except that there are solder connections on the other side.

I have treated the leaf switches a little differently on the front of my application (SRB3). The black wires from the leaf switches connect to pins 8, 9, 12, and 13 in no particular order. It is the two output pins, numbers 10 and 11 that need to be connected together. Why is this important? We want to save a pin on the Arduino, but we do NOT want a High Logic state fed back into the other OR gate, it will be damaged. To solve this, pins 10 and 11 are connected each to their own 1N4148 diode which then are brought together at the topmost yellow wire. This is our output which will tell the Arduino the state of any individual leaf switch.

The Pin Saver Board.

Pin Saver Board Schematic

Pin Saver Board Layout

The pin saver board will connect to power and ground, in my SRB3 application these come from the power board which breaks out 3 sources from a 12v rechargeable through buck down converters detailed farther down this page.

In the schematic above you can see where to plug in the servos on the right of the robot. The next section down is where the left side servos plug in. Power and ground is shared among all four, the right and left servo wires are shared within each pair. Only one Arduino pin is required for the left, and one for the right servos. The bottom of the board is where the ultrasonic sensors are connected.

I have used HC-SR04 sensors on my application. Here again, power and ground are common for two sensors; but POWER is NOT shared with the servos. The Echo and Trigger pins for both are brought together so that they only use two Arduino pins to hook up the two sensors.

Plug in the right servos to the top outside section and jumpers to power, ground, and the Arduino in the center. Plug in the left servos to the second section. Plug in the ultrasonic sensors to the outside of the bottom section, and jumpers to the Arduino from the center.

Powering it all up.

First off, let's talk about batteries. I decided to use a Tencel 2000mA 12v rechargeable NiMH battery pack for SRB3.

Metal Halide batteries are not NiCAD (Nickle Cadmium). NiMH have some drawbacks and some bonuses. NiMH charge slower and discharge faster when used with a high demand system. They also get HOT when to much demand is placed on them. NiMH discharge slower and last ALOT longer in lower demand situations.

Robots such as SRB3 are low demand situations for a battery, low demand electronics which are mostly in a wait state a lot of the time. The only high demand items in this system are the 4 servos. If there were 12 servos NiCad would be a better choice. You also need a charger that is intended for NiMH charging, these are different than a NiCad charger. You must use the heat sensor that is attached to the charger while charging the batteries, they can get HOT and the sensor will shut down the charge cycle if this happens. This has never happened to me but it can.

Buck Downs

Mounting Buck Downs on a PCB

These are the D-SUN Mini DC Voltage Step-Down Regulators.

Notice the + and - on the front and the arrows for IN and OUT on the back. When you mount them to a circuit board don't get lost on what is pointing where. IN is 12v IN, OUT is what ever you set it for, 5v in our case. See the little, itty-bitty, tiny, almost microscopic adjustment on the front of the board that only takes the smallest screwdriver you can get? I used the screwdriver from a eye glasses kit for awhile but these are almost to large. I finally bought a set of microscopic screwdrivers from Ace Hardware which work better and give finer control.

The Power Supply Board:

I used the snap off stand-offs, one for each corner to mount three of the buck downs to a PCB board. I hope when you do this step you have kept careful track of which way is IN and OUT on these. The wiring is simple here, 12v from the battery to IN which can be common for all the buck-downs. OUT from each buck-down: One to supply the Arduino with a barrel jack. One to plug wires into the Pin Saver Board.

Powering SRB3