Sei sulla pagina 1di 29

ATENEO DE DAVAO UNIVERSITY

SCHOOL OF ENGINEERING AND ARCHITECTURE

TRANSISTOR- BASED LINE FOLLOWING ROBOT WITH FRONT COLLISION

SENSOR

Submitted by

Kurt Irving S. Barcelona

Lilibeth Diane L. Yu

In Partial Fulfillment of the Requirements in ECE 320:

Electronic Devices and Circuits 1

Engr. Raymond Pidor

July 13, 2015


PRINCIPLES ON A LINE FOLLOWING ROBOT

Differential Drive Mechanism

The robot heavily relied on the differential-drive mechanism of the motors. It

was an expensive approach because of the use of two motors, but it removed the

complication of the design and manufacturing of the steering and motor driving gears.

Two motors were independently placed on the sides of the robot, and the

difference of their revolutions per minute (RPM) steered the robot in a given direction

to follow a line on a flat surface. A diagram is placed below on how this operates.

Fig. 1.1. Line Following Mechanism. Retrieved from http://www.emicro.com/blog


Fig. 1.2. Differential Drive Steering. Retrieved from http://www.emicro.com/blog

Approach and Principles behind the Robot

In order for the robot to follow a line using a differential drive steering and

control of the robot, a mechanism was made to detect or differentiate a line from a

clean surface.

In compliance with this specification, a simple approach was used, which was

the utilization of the properties of light. It was to observe contrast between the line

and a clean surface. It was an easy method to distinguish the line from a planar

surface and vice versa. A bright surface indicated that a greater intensity of light was

reflected from a surface. A darker surface indicated that light was more absorbed by

that surface. This principle of contrasting shades was simple yet effective. It was also

assumed here that the surface was opaque and was also matte in texture so to diffuse

or scatter light rather than reflecting it at a specific direction.

It was already decided that the robot would have been electronically and

mechanically based, which would possess a device that will detect contrasting

surfaces by exhibiting a certain response. This certain device responds on the change
of light intensity by changing its electrical resistance. This device or sensor senses or

reacts to the difference between a surface that reflects light and a surface that absorbs

light. This component is called the Light Dependent resistor.

Connecting it in certain ways yielded various outcomes. Its electrical

resistance decreased as the intensity of light increased, and its electrical resistance

decreased as the intensity of light increased.

With this method, the robot didn't require complex calculations and logic for it

to fulfill its specifications, and it only used simple transistors.


PLANNING AND PARTS DESCRIPTION

Parts: Power Supply

Unlike in the original schematic diagram of the basis circuits, whose power

supply was shared between the motors and other components, the power supply of the

circuit were separated independent power supplies because the power needed by the

motors used in this circuit was quite large, and it may affect the current distribution to

other components if it were a singular power supply due to the large power dissipated

in the internal resistance of a battery. In order for the circuit's logic and other

components to function properly and not to be disrupted in case the motors required a

large current, an independent power for the motors and the logic circuits was

implemented.

Also, a 6 VDC given by four AA Carbon-Zinc batteries was the power supply

used for the logic circuits because of the 6VDC requirement of the relay, and Carbon-

Zinc provided enough current draw for the low power transistors.

The power for the motors was two AA Carbon-Zinc batteries, each having

1.5VDC. Connecting them in series yielded 3.00 VDC. According to the motors'

specification sheet, 3VDC was enough to drive the geared DC motors in a slow RPM,

which was necessary since the LDR's response was not as fast contrary to the robot's

expected speed at which the motor will run if given a higher RPM. Carbon-Zinc

batteries provided a low current rating, but this was enough for the motors and also

for the safety of the other components if in case the circuit had a short between the

supply and the transistors that controlled the motors, which was quite common

whenever a motor got stuck in operation.


It was also evident that the use of heavier AA batteries were apparent in the

design. It was known that AA batteries hold up much more charge compared to the

9VDC battery. The AA batteries also gave out more current when needed compared

to a 9VDC battery, and large amount of current was needed in powering motors. Also,

the motors and relays were rated only for 6VDC, and applying 9V would have been

destructive to the parts. Another problem was that 9VDC batteries easily heated up,

and their internal resistance hindered a large amount of current to be pulled away

from, and power would have just been wasted in heat during power dissipation.

Lastly, when a 9VDC battery's output was voltage divided, it’s was a waste of power

because the power loss of the circuit would have been dissipated into the resistors of

the voltage divider circuit. Compensating for these problems, it was good enough to

sacrifice weight with performance of AA battery. Thus, AA batteries were used in the

robot rather than 9VDC.

Parts: Transistor

The transistors used here were from the original basis circuits. The 2N3904

transistors were used to switch on and switch off the motors. Unlike in the original

design, five transistors were used to divide the current among the five transistors to

reduce the heat generated in each transistor. The amount of heat dissipated would

have been minimized in case a larger power consuming motor were to be used.

In a single 2N3904, it had about a maximum of 300mA collector current, or

the current that flowed through the collector down to the emitter of the transistor. It

was the maximum rating of the transistor if it permitted current through it from the

collector then to the emitter. If the collector current would have been near the

collector current value, heat would have been dissipated due to resistance. By using
five transistors, one had increased the operational range from 300mA to 1500mA, and

also aided the heat dissipation by dividing the current through each transistor, it also

provided a larger surface area for the heat to dissipate.

Parts: Motors

The motors were not ordinary 6VDC motors. Motors required of the design

were ready made geared DC motors. The one used in the design was a 48:1 gear

reduction ratio 3-6VDC motor. These motors used simply converted the speed into

more torque. Non-geared DC motors were high speed but low in torque. Their torque

wasn't enough to drive the robot's large and heavy wheels, much more its weight. To

reduce complication, it was recommended that buying the readymade motors would

have been beneficial than designing a gear reduction mechanism and then

implementing it in the design.

Parts: Wheels

The robot had three wheels for its design. The one at the front was a pivot

wheel, rotating in any direction where the robot moved. There would be two wheels at

the back directed only frontward. These wheels were made to be in free-wheeling

configuration, meaning that these wheels were not directly driven by the motor. The

motor had its own smaller wheels that rim-drove the larger wheels at the back so to

increase torque and reduce speed. Speed reduction was important because once again,

the LDRs' response was slow, and would not instantaneously detect a change in light

intensity.
Parts: Body

The robot's body was a plastic lunchbox container to minimize cost and also to

protect the circuitry. It was also chosen so to make it aesthetically appealing. It was of

hard plastic, slightly flexible and slightly brittle to give extra flexibility while

providing strength. Holes were easily made by melting the enclosure with a soldering

iron.
DESCRIPTION OF SCHEMATIC DIAGRAM

Background of the Schematic Diagram

The circuit was a combination of a line following circuit, motor driver circuit

and an obstacle detection circuit. It was the brain of the robot. The whole circuit was a

drastically modified form of the basis circuits to suit a more modular approach in the

design of the robot, which meant that the robot parts could be easily replaced or

improved over time with new circuits and processes.

Line Sensor Circuit Setup

The Line following circuit had two LDRs as sensors- one for the left and one

for the right of the robot, as shown in the bottom left and bottom right of the

schematic diagram. These controlled the motors.

As the light intensity increased for one LDR, cascading BC547s were

triggered to let charges flow from the voltage source (6VDC- 4x AA batteries) to the

base of the 2N3904 transistors.

The rush of charges to the base of the 2N3904s let current from the 3VDC

2xAA power supply enter the motor coils and then down to the five transistors'

collector to emitter, and then went go to the ground.

This mechanism didn't vary the speed of the motor. It simply turned on the

motor in full swing or turned it off. Unlike in the original schematic diagram of the

basis circuit, the use of the 'switch on and off' for the motor rather than a linear

amplifier method used in the original circuit tightened the turn radius of the designed

robot without sacrificing a lot of time and space.


Motor Control

The motors were controlled by the switching mechanism of the LDR and

transistor circuit. When the LDR detected a high intensity of light (clean surface,

usually a bright surface), the five 2N3904s turned on, and charges flowed to the

motors, able to run at full speed, and when the LDRs detected a low intensity of light

(dark surface, usually a dark line over a surface), the motor turned off. In series with

the base of the 2N3904 transistors was a 10K Ohms trimmer resistor. It was placed

there in case the motors didn't have the same calibrated RPM due to a factory defect

or wiring problem. In most cases, this was only used to reduce the current going to the

base of the transistor, thus current control was only its purpose,

This caused problems in testing in testing. When the trimmer was set to a

point that only minimal current was passing through the base of the 2N3904s, the

motors didn't start turning and they only remained at their initial position unless acted

upon by an external tangential force. Worse was when the motors created a short

whenever the motors didn't move, simulating that there was no apparent load, so most

of the current went through the 2N3904 transistors, which dissipated power as heat

and might had even destroyed the circuit especially when the power supply provided a

very large current, which didn't in this case due to the use of Carbon-Zinc, a low

current draw battery.

Obstacle Detection and Countermeasure

In the obstacle detection circuit, an LDR-relay switch was used to make or

break the connection of the motor to its power source. A relay was used here rather

than a power transistor so that in case a larger power source or a larger motor was

inserted, the circuit would have been flexible enough not to break the other
components, and it was simpler than designing a set of cascading transistors just for

the similar purpose. It was part of a modular-flexible design of the circuit.

A LDR was used to determine the distance of the robot to an object in front.

As the light intensity increased, the reflected amount of light from the object to the

sensor was strong, which meant that the distance from the robot to the object was

near. Whenever there was a weak intensity of light, it meant that the object was far

away from the robot.

The power rail of the motor's power supply was connected to the pole of the

relay, and the motors were connected to the normally-open pin of the relay.

Whenever the LDR on the top left of the schematic diagram didn't detect a

near object, the light intensity was weak, and charges flowed from the power supply

down to the base of the first cascaded BC547 transistor. That transistor then supplied

enough current to the last of the cascaded transistors, in an amplifier configuration to

the inductor of the relay, thus the pole connector moved from the normally closed pin

to the normally open pin of the relay. Basically, the circuit turned on the relays, thus

power was fed from the motor's power supply (3VDC 2xAA batteries) to the motors,

but when the LDR detected a high intensity of light, lesser current entered the two

cascading BC547 transistors and cut the flow of charges from the collector of the last

cascaded BC547 to ground, thus charges didn't flow from the power supply down to

the coil of the inductor of the relay and to ground. Basically, the relay was switched

off, and the pole connector of the relay will go back to the normally closed pin, which

was designed to be an open terminal.

It was noted that this configuration of the relay and LDR was set so that the

normally open switch was connected to the motors and the pole was connected to the

power source. It was be questioned, why not configure the circuit in a way that the
power was connected to the pole, and the motors connected to the normally closed pin

of the relay? Only when the LDR detected a high intensity of light it switched on the

relay to save power by reducing power dissipation on the relay's coil. Actually, this

mentioned method wasn't part of the circuit design also to save power, and also to

reduce complication so to easily modify the circuit when needed. Whenever the

circuit was not powered by any sort, which all parts didn't have charges flowing

through them, the relay's pole was connected to the normally closed pin. In the robot

design, the normally closed pin connection was open, thus power from the motor's

battery won't dissipate to the motors themselves that were connected in the normally

open pin of the relay. Only when the circuit was activated and the LDR didn't detect a

high intensity of light it allowed the connection of the motor's power to the motors

themselves. The design was basically a switch that won't permit the connection of the

motor's power and the motors themselves whenever the whole circuit was turned off,

and only when the circuit was turned on, together with the LDRs detecting a high

intensity of light it allowed the motors to be connected to their power source.

Weakness

The circuit was not intended to be a perfect design. It had drawbacks due to its

design philosophy and parts availability.

Transistors weren't designed to be easily replaced because of the lack of

available parts which houses a sturdy modular a fault finding system was not

installed. When a transistor went out, it wasn't easily detected among the other

parallel-connected transistors unless all transistors of a motor burnt out. The circuit's

LDRs were not quick in detecting a dark surface from a bright surface, so the speed

was only limited to the detection time of the LDR, and also the reaction of the motors,
which were factored by the gear ratio quality, charging time of the motors and the

internal forces acting upon the gears. Another weakness was the heavy weight of the

circuit. A lot of nickel nuts and bolts were used, including the fully metal pivot wheel

in front of the robot. The heavy weight contributed to the large force needed to move

the robot, and it was difficult to slow down since no braking mechanism was made in

the design to reduce complication and provide more space for more important parts in

the robot. Another was the inaccuracy of LDRs in detecting a line due to lack of light

or too much light entering the sensor, or the surface was not completely planar.

Another would be that the motors' speed was not easily controlled by the lights, but

only trimmer resistors to balance the RPM for each motor. Adding to this, when the

trimmer resistors were set which there was minimal current through the base of the

2N3904 transistors, the motor didn't immediately turn unless an external tangential

force was applied to the motor's axle or wheel. This was due to a lack of current that

flowed through it, and this in turn did create a short between the Power supply and the

collector’s pins of the transistors, even if the voltage was held constant across the

motors. The lack of current on the base of the transistors reduced the current supplied

to the motors, thus they didn't start turning. The short between the supply and the

transistors dissipated heat and might have destroyed the transistors. Worse was when

the supply was able to provide a large amount of current through that short, but that

didn't happen since a low current draw power source since a Carbon-Zinc battery was

used.

Basis Circuits

The Schematic diagram was based on the Transistor-Based Line Following

Robot of http://www.ermicro.com/blog/?p=1097 and the LDR switch from


http://www.buildcircuit.com/how-to-use-a-relay/. The line following robot schematic

incorporated the two mentioned circuits in a modified and a more modular circuit that

is suited to the mechanical design and the philosophy of the proponents, which is, the

design will be based on the available parts. The original authors of the line following

robot schematic had parts unavailable to the proponents, and changes were made to

suit this. One was the modification of amplifier-type LDR sensor and motor

triggering.
SCHEMATIC DIAGRAM

Fig.1.3. Line Following Robot with Front Collision Countermeasure Schematic

Diagram.
PRINTED CIRCUIT BOARD LAYOUT

Background

The Printed Circuit Board (PCB) was designed to have multiple modular parts

that had large copper traces so to compensate for the error in any kind of PCB

fabrication because ordinary PCB fabrication was not as good as factory standards,

and ordinary fabrication with small copper traces were usually dissolved or cut. Also,

the printed PCBs in this report were in 1:1 scale. Any printing error or blotting

resulted in an inaccuracy of PCB fabrication. So, to be safe, a large copper trace was

implored to create a safe margin for successful PCB fabrication.

Technicalities

The PCB was designed in three parts that were to be connected in cables that

ran through the robot and was connected via terminal blocks and speaker wires, which

can carry a high load of current and voltage while offering a sturdy and ductile

conductor with a safe kind of plastic insulation. Unlike using solid or stranded core

wires, it served both purposes of being sturdy and flexible.

The terminal blocks offered a versatile connector for any kind of wire that wa

used in the robot. In case a wire was to be replaced, it can be most likely compatible

with the terminal block connection. Unlike soldering the wires, which was a dirty

maneuver in this kind of modular circuit because it made replacement difficult,

terminal blocks minimized the chances of a wire breaking up. It lets the wire clip on

more tightly with an option to be easily removed, compared to soldering, which was a

permanent process.
These PCBs were the main board, which contained the switching transistors of

the motors, the relay with the relay driver, and other power supply connectors that

needed to be inside the enclosure. The other PCB was the LDR sensor PCB. It's

placed outside the robot. It consisted of a two pairs light sources-White Light

Emitting Diode (LEDs) closely attached to a Light dependent resistor. They were

spaced quite fairly apart so to give a bandwidth of detection for the line on a clean

surface. The last PCB was the front collision detector circuit. It was composed of one

pair of LED and LDR. It was just a sensor placed at the front of the robot. Its

detection distance of a white object was about 3-5cm from the robot's front.

These sensors were connected using 3-pin terminal blocks. These terminal

blocks had a convention to follow so not to confuse the user in case repair or

modification. Facing the user, an image below describes the terminal block

configuration.

Fig. 1.4. 3-Pin Terminal Block Convention.

2-pin terminal blocks were either dedicated for the motors or for the power

supply. The motors' terminal block were not polarity-sensitive, but the power supply

terminal blocks were.


RECOMMENDATIONS

-Make the switching transistors more modular, yet secure.

-Error or fault finding circuitry for error checking

-Reduction of weight by reducing metallic parts, and maximization of space and

minimizing the material used

-Use of bearings with a proper alignment of motors to the rim-driven wheel

-Use of a faster response photo transistor

-use of more LDRs for line detection a more accurate transistor logic

-smaller and space saving battery with a high current and charge rating

-use of pulsated or modulated infrared light to isolate the beams from the robot to

detect distance or a line instead of just using continuously lit LEDs so to make a more

accurate reading by removing the factor of ambient light. It's like creating a very fast

shutter speed that rejects ambient light and only detects the in-phase pulsated infrared

lights.

-use of pulse width modulation to control them motor's speed rather than use of

switching transistors to reduce the wasted power in heat, and also to remove the in

series trimmer resistor.

\
REFERENCES

-Buildciruit.net.(2010)."How to Use a Relay". Retrieved on July 10, 2015 from

http://www.buildcircuit.com/how-to-use-a-relay/

-Rwb. (2009). " Build Your Own Transistor Based Mobile Line Follower Robot

(LFR) – First Part". Retrieved on July 10, 2015 from

http://www.ermicro.com/blog/?p=1097
EXTERNAL WIRING DIAGRAM (NOT TO SCALE)

Fig. 1.5. External Wiring Diagram.


BILL OF MATERIALS

Table 1.1. Bill of Materials.

Part Description Quantity Price (PHP)

1/4W resistor- 10K Ohms 2 0.60

1/4W resistor- 100K Ohms 2 0.60

1/4W resistor- 220 Ohms 3 0.90

1/4W resistor- 300 Ohms 1 0.30

1/8" nut and bolts 3 25.00

10K Ohms Trimmer Resistor 2 10.00

100K Ohms Trimmer Resistor 1 5.00

1N4007 diode 3 3.00

2N3904 10 45.00

2-pin Terminal Block 2 24.00

3-Pin Terminal Block 6 90.00

3-6VDC Geared DC Motor 48:1 Speed Reduction 2 400.00

2x AA Battery Holder 1 15.00

4x AA Battery Holder 1 15.00

6V Relay 1 20.00

BC547 6 27.00

Drill bit 2 24.00

Ferric Chloride (small) 1 25.00

Green lunch box enclosure 1 30.00

Light Dependent Resistor (small) 3 18.00

LED (White) 4 32.00


Presensitized Printed Circuit Board (4"x6") 1 135.00

Rolling wheel 1 75.00

Speaker wires 2m 36.00

Toggle Switch SPST 1 15.00

Zip Ties 1 50.00

Total 1121.40

There were several parts such as the speaker wires, zip ties, 2xAA battery

holder, a few small 1/8" nuts and bolts that were found lying around the house, but the

market price as of July 2015 was placed there as reference. Wheels and their axles

were also made from parts lying around the household, but the market prices of these

objects are unknown.


DOCUMENTS

Figure 1.6. Basis Circuit: LDR Relay Light Switch.

Retrieved from http://www.buildcircuit.com/how-to-use-a-relay/

Figure 1.7. Basis Circuit: Line following Robot. Retrieved from

http://www.buildcircuit.com/how-to-use-a-relay/
Fig. 1.8. Final Line Following Robot with Front Collision Countermeasure.

Fig. 1.9. 3-6VDC Geared DC Motor 48:1 Speed Reduction.


Fig. 1.10. Robot's Removable Lid, and Scale with the hand.

Fig. 1.11. Robot's Internal Circuitry.


Figure 1.12. Robot's pivot wheel.

Fig. 1.13. Robot's LDR sensors.


Fig. 1.14. Robot's Front Collision LDR sensor.
RECEIPTS

Potrebbero piacerti anche