Pages

20200127

HACKING ELECTRONICS by Simon Monk


  • When it comes to areas of electronics where a microcontroller would be useful, an Arduino Uno board is best.
  • You don’t need a degree in electronic engineering to create or modify something electronic.
  • The best way to learn is by having a go at it.
  • Soldering is the main skill necessary for hacking electronics.
  • The main thing to remember is that you heat up the item you want to solder and only apply the solder when that thing is hot enough for the solder to melt onto it.
  • As the word suggests, resistance is actually resistance to the flow of current. So a high-resistance resistor will not allow much current to flow, while a low-value resistor will allow lots of current to flow.
  • Resistors are the most commonly used component you can find.
  • For the curious, capacitors store charge, a bit like a battery, but not much charge, and they can store the charge and release it very quickly.
  • You will occasionally need to use diodes. They are kind of a one-way valve, only allowing current to flow in one direction. They are therefore often used to protect sensitive components from accidental reverse voltage that could damage them.
  • While transistors can be used in audio amplifiers and in many circumstances, for the casual electronics hacker, the transistor can be thought of as a switch. But rather than a switch controlled by a lever, it is a switch that switches a big current, yet is controlled by a small current.
  • Generally speaking, the physical size of the transistor (Figure 2-8) determines how big the current that it switches can be before it starts producing smoke.
  • Generally, the rule for a component is that if it’s ugly and has three legs, it’s probably some kind of transistor.
  • Voltage, current, and resistance are three properties that are fundamental to almost everything you will do in electronics.
  • Current, rather like the current in a river, is measured by counting how much charge passes you per second
  • A resistor’s job is to provide resistance to the flow of current.
  • Power is all about energy and time.
  • Power is the best measure of how much electricity is being used.
  • The First Rule of Schematics: Positive Voltages Are Uppermost
  • A convention that most people follow when drawing a schematic is to put the higher voltages near the top,
  • Second Rule of Schematics: Things Happen Left to Right
  • it is common to start with the source of the electricity—the battery or power supply on the left—and then work our way from left to right across the diagram.
  • It is normal to give every component in a schematic a name.
  • It is also normal to specify the value of each of the components where appropriate.
  • There are two main styles of circuit symbol: American and European.
  • Resistors are designed to cope with a bit of heat.
  • A very common technique in electronics is to use a pair of resistors (or a single variable resistor) as a “voltage divider.”
  • This transistor has three leads: the emitter, the collector, and the base. The basic principal is that a small current flowing through the base will allow a much bigger current to flow between the collector and the emitter.
  • MOSFETs do not have emitters, bases, and collectors, they have “sources,” “gates,” and “drains.”
  • LEDs (light-emitting diodes) are diodes that emit light when a current passes through them.
  • A diode is a component that only lets current flow in one direction.
  • The 555 timer IC is a useful little IC that can be used for many different purposes, but is particularly convenient for making LEDs flash or generating higher frequency oscillations suitable for making audible tones
  • Breadboard is very useful for trying things out, but not so useful as a permanent home for your electronics.
  • A good way of checking that you have made all the connections you need is to print off the schematic and then go through each connection on the stripboard and check off its counterpart on the schematic.
  • Lasers are best bought as laser modules. The difference between a laser module and a laser diode is that the module includes a laser diode as well as a lens to focus the beam of laser light and a drive circuit to control the current to the laser diode. If you buy a laser diode, you will have to do all this yourself.
  • Capacitors only store a tiny fraction of the charge that a battery of the same size can store.
  • Batteries use a chemical reaction to store electrical energy. This means their voltage remains relatively constant until they are spent, at which time it falls off rapidly.
  • Capacitors, however, drop evenly in voltage as they discharge, just like the level of water decreasing in a tank.
  • Everything that you make or adapt is going to need to get its power from somewhere.
  • all batteries actually have an internal resistance. So, it is as if there is a resistor connected to one of the terminals.
  • when a battery is discharged too quickly, by too high a current, it gets hot—sometimes very hot, sometimes “on fire” hot. This will damage the battery.
  • A variable power supply lets you set both an output voltage and a maximum current.
  • The thing with batteries is that even though they may say 1.5V, 3.7V, or 9V on the package, their voltage will drop as they discharge—often by quite a high percentage.
  • Replacing batteries is a nuisance, and expensive, so it is often cheaper and more convenient to power things from a wall-wart power supply.
  • Recall that diodes act rather like one-way valves. They only allow current to flow in the direction of the arrow.
  • Solar cells, unless they are very large, produce fairly small amounts of electricity and so are most suited to low-power devices and projects that are outdoors away from household electricity.
  • Projects that use a solar panel to provide power nearly always also use a rechargeable battery. So the panel charges the battery and the project draws its power from the battery.
  • It will probably be easier and cheaper to put your efforts into minimizing the current consumed by the system rather than increasing the size of the solar panel and battery.
  • Microcontrollers are essentially low-powered computers on a chip. They have input/ output pins to which you can attach electronics so the microcontroller can, well, control things.
  • A relay is basically an electromagnet that closes switch contacts. The fact that the coil and the contacts are electrically isolated from one another makes relays great for things like switching home-powered devices on and off from something like an Arduino.
  • The great thing about a relay is that it behaves just like a switch.
  • The success of Arduino had been in no small part due to the wide range of plug-in shields that add useful features to a basic Arduino board. A shield is designed to fit into the header sockets of the main Arduino board.
  • PIR motion sensors are used in intruder alarms and for automatic security alarms. They detect movement using infrared light. They are also cheap and easy to use.
  • Ultrasonic rangefinders use ultrasound (higher frequency than the human ear can hear) to measure the distance to a sound-reflective object. They measure the time it takes for a pulse of sound to travel to the object and back.
  • Ultrasonic range finding works the same as sonar used by ships and submarines. A sound wave is sent out from a sender, hits an object, and bounces back. Since we know the speed of sound, the distance to the sound-reflecting object can be calculated from the time it takes for the sound to come back to the receiver
  • To change the direction in which a motor turns, you have to reverse the direction in which the current flows.
  • Comparators, as the name suggests, compare voltages.
  • Sensing a magnetic field is made easy using a three-pin sensor IC like the A1302 linear hall effect sensor.
  • Microphones (mics) respond to sound waves, but sound waves are just small changes in air pressure, so it is not surprising that the signal you get from a mic is usually very faint. It requires amplification to bring it up to a useable level.
  • Whereas a comparator turns its output on when the “+” input is higher than the “–” input, an op amp amplifies the difference between the “+” and “–” inputs.
  • The human ear can pick out the direction of a high-frequency sound very easily.
  • When working on something that is powered by household electricity, NEVER work on it when it is plugged into the outlet.
  • Unless it is a very small capacitor, it should not be discharged by shorting the leads with a screwdriver.
  • Fuses are basically just wires designed to burn out when the current flowing through them gets too high.
  • Calculating what you expect before you measure it is always a good idea, because if you measure it first, it is all too easy to convince yourself that it was what you were expecting.
  • When something stops working on a PCB, it is often the result of something burning out. This sometimes leads to charring around the component. Resistors and transistors are common culprits.
  • Dead consumer electronics are a good source of components. But be selective, because some components are really not worth saving.
  • When measuring high-value resistors of 100kΩ and up, remember that you yourself are also a big resistor, so if you hold the test lead to the resistor at both ends (see Figure 11-2), you are measuring both the resistor in question and your own resistance.
  • Fritzing (www.fritzing.org) is a really interesting open-source software project that lets you design projects. It is intended primarily for breadboard design and includes libraries of components and modules, such as an Arduino, that can all be wired up
  • To get yourselves a basic stock of components, you are strongly recommended to buy a starter kit of components.