Hacking Electronics

Hacking Electronics: An Illustrated DIY Guide for Makers and Hobbyists

[code] [Contents] [Errata]

Buy a kit of parts designed for this book from MonkMakes.


cover_medThis is my first full-color book. It explains electronics in a way that is easy to understand and concentrates on those areas of electronics that you really need to make or modify electronic equipment  while avoiding a load of theory that you might never use.

As you might expect, as well as the basics, there is  plenty about Arduino in there too.



Chapter 1: Getting Started

1.1 Getting Stuff
1.2. How to Strip a Wire
1.3. How to Join Wires Together by Twisting
1.4. How to Join Wires by Soldering
1.5. How to Test a Connection
1.6. How to Hacking a Computer Fan to Keep Soldering Fumes Away

Chapter 2: Theory Guides
2.1. How to Assemble a Starter Kit of Components
2.2. How to Identify Electronic Components
2.3. What are Current, Resistance and Voltage?
2.4. What is Power?
2.5. How to Read a Schematic Diagram

Chapter 3. Basics
3.1. How to Make a Resistor Get Hot
3.2. How to Use Resistors to Divide a Voltage
3.3. How to Convert a Resistance to a Voltage (and make a light meter)
3.4. How to Hack a Push Light to Make it Light Sensing
3.5. How to Chose a Transistor
3.6. How to use a Power MOSFET to Control a Motor
3.7. How to Select the Right Switch

Chapter 4: LED Hacks
4.1. How to Stop an LED Burning Out
4.2. How to Select the Right LED for the Job
4.3 How to Use a LM317 to Make a Constant Current Driver
4.4 How to Measure the Forward Voltage of an LED
4.5 How to Power Large Numbers of LEDs
4.6 How to Make LEDs flash
4.7 How to Use Stripboard (LED Flasher)
4.8 How to Use a Laser Diode Module
4.9. Hacking a Slot Car Racer


Chapter 5: Batteries and Power
5.1. Select the Right Battery
5.2. Charging Batteries (In General)
5.3. How to Charge a NiMh Battery
5.4. How to Charge a Sealed Lead Acid Battery
5.5. How to Charge a LiPo Battery
5.6. Hacking a Cell Phone Battery
5.7. Controlling the Voltage from a Battery
5.8. Boosting Voltage
5.9. Calculating How Long a Battery Will Last
5.10. Battery Backup
5.11. How to Use Solar Cells

Chapter 6: Arduino Hacks
6.1. How to Set up Arduino (and Blink an LED)
6.2. How to Make an Arduino Control a Relay
6.3. How to Hack a Toy for Arduino Control
6.4. How to Measure Voltage with an Arduino
6.5. How to Use an Arduino to Control an LED
6.6. How to Play a Sound with an Arduino
6.7. How to Use Arduino Shields
6.8. How to Control a Relay from a Web Page
6.9. How to Use a Alphanumeric LCD Shield with Arduino
6.10. How to Drive a Servo Motor with an Arduino
6.11. How to Charlieplex LEDs
6.12. How to use a 7-Segment Display with an Arduino (I2C)
6.13. How to make an Automatic Password Typer

Chapter 7: Module Hacks
7.1. How to Use a PIR Motion Sensor Module
7.2. How to Use Ultrasonic Range Finder Modules
7.3. How to Use a Wireless Remote Module
7.4. How to Use a Wireless Remote Module with Arduino
7.5. How to Control Motor Speed with a Power MOSFET
7.6. How to Control Motors with a H-Bridge Module
7.7. How to Control a Stepper Motor with an H-Bridge Module
7.8. How to Make a Simple Robot Rover
7.9. How to use a 7-Segment LED Display Module
7.10. How to use a Real Time Clock Module


Chapter 8: Hacking with Sensors
8.1. How to Detect Noxious Gas
8.2. How to Measure Something’s Color
8.3. How to Detect Vibration
8.4. How to Measure Temperature
8.5. How to Use an Accelerometer
8.6. How to Sense Magnetic Fields

Chapter 9: Audio Hacks
9.1. Hacking Audio leads
9.2. How to use a Microphone Module
9.3. How to Make an FM Bug
9.4. Selecting Loudspeakers
9.5. How to Make a 1W Audio Amplifier
9.6. How to Generate Tones with a 555 Timer
9.7. How to make a USB Music Controller
9.8. How to Make a Software VU Meter

Chapter 10: Take Electronic Devices Apart
10.1. How to Avoid Electrocution
10.2. How to Take Something Apart AND Put it Back Together Again
10.3. How to Check a Fuse
10.4. How to Test a Battery
10.5. How to Test a Heating Element
10.6. Finding and Replacing Failed Components
10.7. How to Scavenge Useful Components
10.8. How to Reuse a Cell Phone Power Adapter


Chapter 11: Tools and Testing
11.1. How to Use a Multimeter (General)
11.2. How to Use a Multimeter to Test a Transistor
11.3. How to Use a Lab Power Supply
11.4. Introducing the Oscilloscope
11.5. Software Tools



Page 41 Figure 3-15 is missing a wire from row 15 to GND. The figure should look like this:



Page 44, Figure 3-22 has both resistors labelled R2. I think the top one should be R3. (thanks to Alan Jones for finding these two).

Page 84 writes 1/100 of an hour, then 6 minutes in brackets. It should be 36 seconds. (thanks Alan).

Page 86, Table 5-2. The third row (less than 5A) says AAA for all the batteries, this should be AA.

page 90 it says “the charge time for NiMH natteries is about 3C times the charging current”, but this should be “3C divided by the charging current”

13 thoughts on “Hacking Electronics

  1. Wolfgang

    first: excuse my bad english knowledge !

    German Version of the book, page 128 , chapter 5.4.1
    The picture shows an adjustable power supply and a lead-gel-akkumulator. If so, the described charge-voltage of 14.4 volts is totally wrong !! Lead gel akkumulators must be charged with a voltage of max. 13.8 volts . The value of 14.4 volts is only correct for charging lead acid akkumulators. If the hacker follows your instructions, he might get a “cooking” or even exploding akku.

    another comment: page 151 , chapter 6.2
    why use an exotic 2N3904 tranststor which is specially designed for “high-frequency-applications” . Better use a very low-cost “low-frequency-transistor”, such as BC547 or BC548 or BC549 .

    chapter 9.2
    name of a possible IC ? 4558, would it be possible ?

    Kind regards !

  2. admin Post author

    Hi, You are right about the SLA batteries. 2N3904 is very cheap and much more common in the US than we European’s much loved BC series. What do you mean ‘name of a possible IC’. I’m not sure what you mean here.

  3. daddy099999

    Hi, great book, am trying to teach my daughter who is interested in bending electronics. Any chance you could come up with some sort of giant parts list as referenced in the book with a vendor like sparkfun so there could be a “push-here-dummy” button to buy the whole list at once? Am sort of dreading 87 separate purchasing sessions for parts.

  4. admin Post author


    Actually we have put together a beginners kit for the Hacking Electronics book which will be available by the end of the week! It covers most of the stuff required for the basic projects but not the stuff requiring an Arduino (kit for those is in pipeline depending on how well this kit sells!)

    Should definitely cut down your shopping time!


  5. Rob

    In your book Hacking Electronics, you refer to sketch “rover” in the How to make a simple robot rover section. I cannot find this sketch in the IDE.
    Is there any way I can find it somewhere?

  6. Paul Garrett

    Hi Simon. I just wanted to say thanks for this book. I came to electronics “late in life” and dived straight into Arduino stuff. I wish I had this book a couple of years ago. It would have saved me a great deal of confusion. I have only had the book for a couple of days and am already benefiting greatly from your concise and practical explanations and examples. The section on batteries has been particularly useful and has prompted me to redesign a few of my projects already.

  7. Paul Garrett

    A couple more suggested errata:

    Page 62; “You Will Need” table should include 1 IC1 LM317 (TO package) and this IC should be added to the Appendix and labelled IC1 on the schematic at Figure 4-10

    Page 68; First sentence, last word should be “resistor”, not “LED”.


  8. John Robinette

    Is there a 1K resistor missing in Figure 7-19, page 166? Figure 7-17 has one and I think I spy one in figure 7-18.


  9. admin Post author

    Oops – yes, you are right. People argue long and hard about whether a resistor is needed here. It is considered good practice to include one, because MOSFETs have a relatively high gate capacitance, so when you turn one on, there is a rush of current of very short duration while this capacitor fills up with charge. This may exceed the maximum current that you should draw from a pin, but only for a matter of micro seconds. The capacitance depends on the transistor and the load and so actually for a small motor, there is very little chance of damaging the Arduino.

  10. John Robinette

    Well, since you were kind enough to teach me something with my last comment, it’s your fault that you’ve encouraged me,
    I have a couple of items that may be errata, but I’m easily confused so I may be wrong.
    The LM311 comparator that I am using is the LM311P from TI, so maybe what follows is unique to that particular component.

    1) On pages 194-195, it’s stated that “if the voltage at its “+” connection is greater than its “-” connection, then its output turns on.” From the data sheet it doesn’t look like this would be the case. In any event, I’ve tried several times but I’ve never detected current when the “+” is greater than the “-”. From other sources it appears that in this situation pin 7 floats and so you’ll need a pull-up resistor to sort of make that statement true. Does that sound about right?

    2) It’s not explicitly stated, but in the reverse situation (“-” > “+”) pin 7 becomes a sink (if I’m using that term correctly). The circuit in figures 8-2, 8-4 and 8-5 seem to be depending on this behavior.

    3) On page 194, figure 8-2, the output from the sensor is sent to pin 2 and the trimpot is connected to pin 3. Isn’t that the reverse of what is needed? Otherwise I would think that in the presence of methane the internal voltage would decrease in the sensor and therefore the voltage at pin 2 would increase. In figures 8-4 and 8-5 these assignments appear to be the reverse of figure 8-2.

    4) Pins 5&6 are left to float. Another book that I’m working through warns against this. Is there a rule of thumb as to when this is OK?

    Thanks, by the way, for this book. It helps to get my hands on a variety of components quickly just to be familiar with them and how to use them.

  11. Danylo

    To add to your errata list: “How to Make an FM Bug” under “You Will Need” first item FM Microphone Module should be M14 (under Appendix code) and not M5, which is a PIR module. M14 is the SparkFun mic module BOB-09964.

    Great book. Hope Simon thinks about expanding this series, especially on Chapter 10; Scavenging useful components. Good to know what most dead consumer electronics have inside their skeletons.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>