Here we will discuss electronics as it relates to robotics but its best to first get the definitions out of the way like how electricity is related to electronics.
Electricity refers to the flow or electrons through a circuit and the two types of electricity are ac(alternating current) in a plug in item like a hair dryer and DC (direct current) used in a battery powered toy robot.
Now electrical devices like a toaster are devices that simply “convert” the electric energy that flows through it to some other type of energy like heat, light or sound while electronics is more concerned with “controlling” the flow of electrons to do some task.
It is often said that electrical circuits are simpler in that they have no decision making ability while electronic circuits do.
Now what is an electron and what is a circuit?
Basically electrons are the negatively charged particles that go around an atomic particle.
When you attach a battery to a wire or a circuit you cause the electrons to move from the negative side of the battery all the way around to the positive side and they may bump into a motor along the way or a resistor device to slow down the flow of electricity.
So a very simple music playing circuit would have a simple 1.5 volt DC battery attached to some wire which goes to a switch and then to a music making chip or IC (integrated circuit) to a speaker and then back to the battery.
You are pretty well safe from getting killed or hurt when playing with low power 1.5 volt DC batteries but if you are working with AC or plug in alternating current you could kill yourself.
So try to make all your robotic devices DC powered and if you work on dancing santas or other animatronics that are plugged into a wall, you need to remember that there is a real danger of getting a shock.
An electric component called a capacitor is used to store electricity and often if you touch one shortly after you unplug something you could get a pretty severe shock. Capacitors are one of the most often burned out components when working on a 20 year old electronic piano or 30 year old Radio Shack computer or even some robots.
So lets use the example of a childs riding battery powered car to explain the handful of electrical terms like voltage, current, amperage and the types of batteries that you can use for a car or a robot.
Your ride on car will have a battery and a few motors to drive the front or back tires and there will be a few switches like a foot pedal on off switch and a shifter know which would probably go forward in fast and slow and reverse and some wires for the circuit which could be either a parallel or a series circuit.
Lets start with the wiring which could have a break in it called a short or could have the plastic covering called the insulation falling off it like what happens with older 25 year old Robosapien V2 robot toys where they are so badly wired that you must rewire the whole toy to be safe.
So wires can be of different thickness and can be solid core or twisted wire and there are industrial code numbers like AWG18 or AWG 22 to tell what you have as well as with other electrical components like resistors and capacitors and just about everything else.
Usually a modern house has outlets that accept 3 pronged cords which have a positive, negative and a ground.
Usually on a car or car toy battery the red side is positive or hot and the black is negative. It can also get attached to the ground or body of the car.
Now with robot building with an Arduino micro controller and a breadboard you will be using small thin single core wire which is easy to plug into the tiny holes on the breadboard. There isn’t that much voltage going through these thin wires.
If you had to cut or reattach some wiring you would use a knife or a stripping/crimping tool to remove some of the plastic insulation from the wire to then tie the two wires together.
Electricity flows easily or is conducted through most metals and water and is slowed down or resisted when it comes in contact with plastic or paper and wood and air etc.
If your robot toy was not working you would check the battery to see if they were dead or there was a lot of acid corrosion in that area which happens with almost all thrift store purchased Furby dolls. You would scrape off the corroded acid from the terminals with sandpaper and you would probably have a working toy unless the spring terminals fall off because of excessive rust which happens with some old Joy Companion robotic cats.
If you choose to totally rewire something like a Robosapie V2 robot then you should remove one wire at a time and trace where it comes from and where it goes to with a color that makes it easier later to tell which wires go where. Of course before you rewire a Robosapien make sure that this is worth fixing and that other things aren’t also wrong with it. Because of its heavy weight on the legs and the brittle plastic it is quite common to see the hip joints broken on them. Also make sure to do the self test and see if it is making movements or sounds.
You can attach wires to your projects in many ways. On a breadboard you just shove the wire into the appropriate hole. Some wires can be attached to another wire to make it longer by using some crimping attachments or you can get a soldering gun and attach a wire to the circuit board…carefully so you don’t burn the components near it.
An Arduino has 14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input pins, a USB connection,
Now lets talk a bit about the battery in a childs ride on toy car.
The battery may be an older SLA “gel” 12 volt or 6 volt battery which is different than what you have in your car which is a “liquid” 12 volt battery. These days everybody is talking about using Lithium (lithium ion or lithium Polymer (LiPO) batteries and these are found in just about everything from robot toys to the Toyota Prius and the Tesla.
Now there are words like volts, current, amperage and ac dc power etc.
Most robot toys will have one or more 1.5 volt batteries and the circuit used is a DC or direct circuit which means that the electrons will flow in one direction or the other and will not alternate quickly like with AC circuits.
So what is a volt and and current (amps) and resistance(ohms).
Most experts explain volts and current in terms of a river or a lake. They say that current is the rate of flow of electrons or charge and voltage is the differnece in the charge between two points.
You can measure how many pails of water flow past a certain point in the river in a second and you can measure the current or amperage of how many units of charge can flow past a point as well.
You don’t get any current unless you have voltage or a difference in charge. You won’t get any movement in a river unless one side is higher than the other so it will flow. With electricity you can create some current flow by not raising something in height but you add voltage and this creates current.
So slow down or cause less current through a speaker or a motor, you would add a resistor to the circuit. Resistance is measured in Ohms and these components can be placed in either direction but will have markings on them to tell how much resistance they can offer. You would test a circuit for resistance using an ohmmeter to tell if there is a short in the circuit for example.
Now AC power is more powerful and can travel large distances unlike battery or DC power. You can use things like transformers and inverters to raise and lower the voltages in a circuit. We get our house power from huge transformers which convert the huge voltages down to the 120volts that we need in our homes.
A rectifier is a component that converts from AC to DC and an inverter goes in the opposite direction.
Later you can learn about bridges and H bridges which are in many robot toys and large robots as well.
An H bridge is often used when working with an Arduino board to make a DC motor go backwards and forwards. It is said that with the Arduino you should turn off the circuit before you change the direction of the motor.
Now you could use servos instead of motors because servos are “smarter” and you can control their direction and speed thru the PWM (pulse width modulation) port and software.
Now the Arduino board is a very low voltage micro controller. You will plug low voltage items into it but if you have other devices that need higher voltage then you can plug the higher voltage power sources directly to those devices like big motors which can still be controlled by the low voltage powered Arduino.
In terms of the ride on car you can say that the voltage will tell you how fast you can go and the amperage will tell you how long the battery will last.
The interesting thing about the shifter and how it gets the fast and slow speeds is that the slow speed uses wiring which accesses the motors in series and the fast speed switch will access a different set of wires which will access the motors in parallel.
Later we will talk about using servos which basically have the three parts included in them of the motor, the circuit board and the potentiometer.