Electronics 101 Workshop by ThinkLABS. The main aim of this workshop is to use pure simple analog electronics to build cool robots like the Line follower, Light Follower, Clap Activated Bot and the Obstacle Avoider. Along the way we shall also learn some important concepts about basic electronics and how they affect the world around us. In this lesson, we shall learn more about Basics of Electronics, Sensors, Transistors, Motor and Motor Drivers, OP-Amp and the 555 Timer IC.
First lets talk about Thinklabs Technosolutions for a bit.
Thinklabs, was founded in 2005 by 3 IITians Mr. Gagan Goyal, Mr Abhishek Biswal and Mr.Gaurav Chaturvedi who are passionate about robotics, especially when applied in the education domain. We at Thinklabs conduct many other workshops such as RoboTRIx, iTRIx, mouseTRIx and VisionTRIx. Along with conducting workshops we also have a very active R&D Lab that is dedicated to building newer better robots. Some of our creations include the Excavator, MouseTRIx, iBot, i-ARM, LogiBot and the Micromouse to name a few.
Starting off, we need to first think why does the world needs robots? Why is it gaining so much importance in today’s life? The simple answer to that question is that as mankind evolves it faces newer challenges which can only be dealt by having a scientific edge. Imagine making products having nanoscale precision, building machines that have a response time in microseconds, Its robotics all around. Also learning about them is fun because it incorporates expertise from all fields such as Electronics, Computer Science, Mechanics, Art etc, hence there is something for everyone over here.Robotics can be basically classified in three types, Tele Operated, Semi Autonomous and Autonomous. Fully Autonomous can be made PC Controlled, Controller Controlled or by using Discrete Electronics. Some examples of the three types of bots are given in the slides.
BEAM Robotics is an acronym that stands for Biology, Electronics, Aesthetics, Mechanics which refers to a style of robotics that uses only analog circuits such as comparators instead of microcontrollers. The invention of the same goes to Mark Tilden who is a robotics physicist and has produced several robotic movements by using simple analog circuits. Some of the examples of Tilden’s robots are given in the slides. You must visit http://www.wowwee.com/ to see more of his creations.
Controller Less Robotics are built around basic discrete components and have Hardwired Intelligence. They do not have any microcontrollers/microprocessors. The basic anatomy of a robot involves sensors/feedback, Drivers, Interface, Power Supply, Actuators and most importantly the Brain, that is responsible for the hardwired intelligence imparted to the bot.
In this section we shall see about basic electronic components such as Resistors, Capacitors, LED’s and some basic circuits such as lighting a LED and Voltage Divider.
The OHM’s LAW forms the basic relation between Current, Voltage and Resistance. Ohm’s Law states that Current passing through a conductor is directly proportional to the voltage applied between those two points and inversely proportional to the resistance between them. Similar to the Ohm’s LAW we have the Power Equation, which states that Power equals voltage times current.
There are two types of resistors Fixed and Variable. The different types of variable resistors are Slider, Preset, Rheostat, Potentiometer etc. The values of resistors(fixed) can be determined by the Color Coding. There are several techniques to remember the Colour Code for eg. BB ROY Great Britian Very Good Wife who wears Gold and Silver. The letters in bold correspond to the colors such as Black, Brown, Red, Orange, Yellow, Green, Blue, Violet, Grey, White, Gold and Silver respectively.
The Voltage Divider circuit is a linear circuit that produces a Output Voltage which is a fraction of the Input Voltage. The ‘Fraction’ can be decided by the value of the resistors R1 and R2. The connection of R1 and R2 and the formula for the same is given in the slide.
Capacitors are passive two terminal electric component used to store electric charge. Capacitors are also used as timing element and to block D.C component from A.C. Capacitors can be used as a timing element, filter and for energy storage.The different types of capacitors are Polarized and Non-Polarized. The sub types of the same are shown in the slides.
LED’s or Light Emitting Diodes are semiconductor light. The physical structure of a LED is same as that of a normal diode i.e it has a P Junction and a N Junction. We have to forward bias this diode in order for it to glow. But one cannot connect the LED to a source because the LED cannot take so much of current and it shall blow, as shown in the slide. The current given to the LED has to be limited by connecting a resistor in series, which is shown in the next slide.
Breadboards are precursors to final PCB’s. The prototyping and testing of any given circuit is done on the breadboard. The internal electrical connections of the breadboard are shown in the slide.
The motor driver board is basically a H bridge amplifier that amplifies the current present across the Input and gives a amplifies output at the Output terminal. The H bridge also prevents back emf that comes from the motor from coming into the logic circuit. We have upgraded the same circuit and we now use a L293D motor driver ic that has a inbuilt H bridge. Please check the pin diagram and internal structure of the L293D by following this link.
Broadly speaking sensors are electronic devices that comprehend different and vague environmental conditions such as Light, Temperature, Humidity etc into comprehensible electrical quantities on which logical and arithmetic calculations can be done. There are basically two types of sensors Proximity/Range and Environmental. The different subtypes of the same are given in the slide. We can aver that the capability and complexity of any robotic system depends on the number of sensory inputs it has. Let’s have a look at them.
Tactile Switches are mechanical switches that detect the presence of an obstacle once it physically touches the obstacle. It basically works like a switch where on closing the switch the circuit is complete and opening the switch the circuit is open. They are very reliable and are widely used, the only drawback of using the mechanical switches is that there is no range involved i.e a proper input can only be achieved once the switch physically touches the obstacle. Watch this video to get an idea for the working of Bump Sensors
We shall now see the working of a infrared sensor. There are two main components involved in a infrared sensor, the IR Led and the Photodiode, but first lets see what is Infrared. Infrared is basically a spectrum of light that is outside the visible light domain from (wavelength from 790 to 1300 nm) and hence are invisible to the human eye. Cameras have a infrared filter inbuilt and hence you can see infrared light from the viewfinder of any camera.
The IR led is similar to a normal led, the only difference being that it transmits an IR light instead of normal light. Connect the circuit as shown in the slide and use a camera to see the output.
The photodiode is used as a receiver. Basically a photodiode is a electric unit that varies its resistance along with incident light when connected in reverse bias. The voltage divider circuit shown in the slide(10) we have connected a photodiode in place of R2. Now one can access that due to the varying intensity or the type of light we can get a voltage associated with that light. When the photodiode and the IR led are used together it forms a IR Sensor. Here is a video description.
Ultrasonic sensors operate in the range of 20Khz to 300Khz while the human audible frequency range is from 20Hz to 20Khz. The work on the principle of SONAR, which states that sound takes an appropriate time to travel in a specific time. The ultrasonic pulses are sent from the transmitter and the time taken for it to come back is counted. Dividing this value by two and knowing the speed of sound in that medium one can assess the distance of the obstacle.
Transistors today form the basic building blocks of modern day electronics. It is mostly used as an amplifier or a switch. Transistors are classified into BJT and FET. BJT’s again are classifies as NPN and PNP. The three terminals of a transistor are Collector(C), Base(B), and Emitter(E). In case of NPN the Collector and Emitter terminals are N type semiconductors which are fused with a P-type semiconductor (Base) in between them. In case of a PNP transistor the Collector and Emitter are P type semiconductors fused with a N-type semiconductor(Base) in between them. Refer the diagrams for PNP and NPN as a switch.
For the NPN as a switch, we need to provide Vcc and Gnd to Collector and Emitter terminals respectively and we need a small current at the Base for the current to flow from Collector to Emitter and the Led to glow. For the PNP as a switch we need to provide Vcc and Gnd to Emitter and Collector respectively and ground the base to glow the Led connected at the collector. Have a look at the water analogy to get a more clearer picture. And a look at this video to understand the working of PNP and NPN transistors.
OP-Amp (Operational Amplifier) is a DC coupled high gain electronic voltage amplifier with a differential input and a single ended output. They have a very high input impedance and a very low output impedance. They are used as Filters, Comparators, Amplifiers and Oscillators and are available in multiple packages starting from single to Quad Op-amps. In this workshop we are goin to learn to use the OP-Amp as a Comparator and develop some cool robots.
When the OP-Amp is being used as a Comparator, it basically compares the voltage at the non-inverting terminal and the voltage at the inverting terminal. If the voltage at the inverting(-ve) terminal is greater than the voltage at the inverting terminal, the output is pulled low to –Vcc or gnd, If the voltage at the non-inverting(+ve) terminal is greater than the voltage at the inverting terminal output is pulled high to Vcc.
In the Light Activated Bot(slide 6) the voltage divider circuit along with the photodiode is connected at the non inverting terminal and a potentiometer is connected at the inverting terminal. What we are trying to do here is to make the voltage output coming from the photodiode sensitive to only a certain type of light(sunlight, ambient light, torch light etc) by adjusting the potentiometer. Only when that light is incident across the photodiode we shall get a high output. Now connect the motors in the manner shown in the diagram and voila we have a Light Activated Bot!!! We shall next see how to make a Line Follower.
The basic principle of light reflecting surfaces is that a black surface shall absorb light and a white surface shall reflect it. We are going to use this principle for our line follower. Now imagine our bot kept on a black line, the algorithm to follow the line is if it senses a black surface turn right else turn left and hence in a zig zag manner it shall follow the entire line. Have a look at the circuit diagram on slide 11.
The Photovore is similar to the Light Activated Bot the only difference being that the motors are connected a bit differently. In the Photovore the bot shall constantly rotate n search for a light source, as soon as it gets that light source it shall follow it.
Motors are classified as Rotational and Linear. Rotational motors consist of DC motors and Stepper motors, whereas Linear Motors consist of Pneumatics and Artificial Muscles. We are going to study about DC motors in detail in this section.
DC motors are widely used for robotic applications because of its variety, ease of availability and ease of use. DC motors have a geared shaft at its output head. The reason for using gears is that we need to reduce the speed and increase the torque. Gears can be used in different combinations and variations depending upon the application of the user. For example to design a small robot, a speed of about 60-150 RPM having a torque of 2Kg-cm is desirable. The bigger the motor the better.
Motors as such cannot be interfaced directly to a logic block(microcontroller or logic circuit). The reason being that motors act as inductors due to presence of a coil inside them. The very basic property of a inductor is to resist change in current i.e if switching of the motor happens(to change the direction of rotation of motor) the motor shall try to resist the change in current blowing up the logic circuit. To avoid this we have to interface a Motor Driver in between the motor and the Logic circuit as shown in slide 7.
Motor drivers are of two types, Electromechanical and Solid State. Electromechanical motor drivers consist of Relays and Solid State Motor Drivers consist of BJT’s and MOSFET’s. Relays basically use a semiconductor device to perform switching and can handle high power to directly control a motor. To see the exact working of a relay view this video.
BJT’s or Bipolar Junction Transistors are three terminal devices that rely on the contact of two semiconductors for its operation. The three regions of a transistor are called as Collector, Base and Emitter and they can be used as amplifiers, switches or in oscillators. To see the working of BJT watch this video.
In slide 12, 13 and 14 you can see that a motor is connected directly across the collector terminal of the BJT. As we discussed earlier the motor behaves like a inductor, meaning it shall oppose any change in current. Upon attaching the motor directly to the BJT, the motor shall blow the BJT because it shall try and extract as much current as possible from the BJT. To avoid this we connect a diode across the motor as shown in slide 14.
What is most important quality of a motor driver is that we can achieve motor switching without damaging the circuit. We achieve that switching by using a H bridge. As you can see in slide 16, 17 and 18 we can change the direction of motors by just pressing two switches. One can also conclude that by using switches we are changing the direction of current. Consequently in slide 19 and 20 instead of manually pressing the switch, the switching is obtained by using transistors and not gate. In slide 20, on giving a logic 0 at A and logic 1 at B, transistors Q1 and Q4 shall be ON and transistors Q2 and Q3 shall be OFF, causing the motor to move in CCW direction. The same thing can be achieved by using transistors instead of a NOT gate(slide 21). In the said slide if one provides logic 0 to A and logic 1 to B, transistors T1 and T4 are ON and transistors T2 and T3 are OFF causing the motor to move in direction as specified in slide 22 and vice versa in slide 23. The complete H bridge circuit along with Schimtt Triggers is shown in slide 25.
Modern day motor drivers have the H bridges incorporated inside the IC. This makes connection a lot easier and these IC’s can provide high current and voltage rating as compared to BJT’s. We are using such an IC called as the L293D in our course. Do check its datasheet for more information.