| Acknowledgments |
|
xix | |
| Introduction |
|
xxi | |
| Chapter 1 Getting Started |
|
1 | (18) |
|
|
|
1 | (4) |
|
|
|
1 | (1) |
|
Where to Buy Things to Hack |
|
|
2 | (1) |
|
|
|
3 | (2) |
|
|
|
5 | (2) |
|
|
|
5 | (2) |
|
Joining Wires Together by Twisting |
|
|
7 | (1) |
|
|
|
7 | (1) |
|
Joining Wires by Soldering |
|
|
8 | (4) |
|
|
|
8 | (1) |
|
|
|
9 | (1) |
|
|
|
10 | (1) |
|
|
|
11 | (1) |
|
|
|
12 | (2) |
|
|
|
12 | (2) |
|
Hacking a Computer Fan to Keep Soldering Fumes Away |
|
|
14 | (4) |
|
|
|
14 | (1) |
|
|
|
14 | (4) |
|
|
|
18 | (1) |
| Chapter 2 Components |
|
19 | (14) |
|
A Starter Kit of Components |
|
|
19 | (1) |
|
Identifying Electronic Components |
|
|
20 | (5) |
|
|
|
20 | (1) |
|
|
|
21 | (1) |
|
|
|
22 | (1) |
|
|
|
23 | (1) |
|
|
|
23 | (1) |
|
|
|
24 | (1) |
|
|
|
24 | (1) |
|
|
|
24 | (1) |
|
What Are Current, Resistance, and Voltage? |
|
|
25 | (2) |
|
|
|
25 | (1) |
|
|
|
26 | (1) |
|
|
|
26 | (1) |
|
|
|
26 | (1) |
|
|
|
27 | (1) |
|
Reading a Schematic Diagram |
|
|
28 | (3) |
|
The First Rule of Schematics: Positive Voltages Are Uppermost |
|
|
29 | (1) |
|
Second Rule of Schematics: Things Happen Left to Right |
|
|
29 | (1) |
|
|
|
30 | (1) |
|
|
|
30 | (1) |
|
|
|
31 | (2) |
| Chapter 3 Basic Hacks |
|
33 | (20) |
|
Making a Resistor Get Hot N |
|
|
33 | (1) |
|
|
|
33 | (1) |
|
|
|
33 | (1) |
|
Using Resistors to Divide a Voltage |
|
|
34 | (3) |
|
|
|
34 | (1) |
|
|
|
35 | (2) |
|
Converting a Resistance to a Voltage (and Make a Light Meter) |
|
|
37 | (2) |
|
|
|
37 | (2) |
|
Hacking a Push Light to Make It Light Sensing |
|
|
39 | (7) |
|
|
|
39 | (1) |
|
|
|
40 | (1) |
|
|
|
41 | (4) |
|
|
|
45 | (1) |
|
PNP and P-Channel Transistors |
|
|
45 | (1) |
|
|
|
46 | (1) |
|
Using a Power MOSFET to Control a Motor |
|
|
46 | (3) |
|
|
|
47 | (1) |
|
|
|
47 | (2) |
|
|
|
49 | (3) |
|
|
|
49 | (1) |
|
|
|
50 | (1) |
|
|
|
50 | (2) |
|
|
|
52 | (1) |
| Chapter 4 LEDs |
|
53 | (28) |
|
Preventing an LED from Burning Out |
|
|
53 | (4) |
|
|
|
53 | (1) |
|
|
|
54 | (1) |
|
|
|
54 | (2) |
|
|
|
56 | (1) |
|
Selecting the Right LED for the Job |
|
|
57 | (2) |
|
|
|
57 | (1) |
|
|
|
57 | (1) |
|
|
|
57 | (1) |
|
|
|
58 | (1) |
|
Experimenting with RGB LEDs |
|
|
59 | (1) |
|
|
|
59 | (1) |
|
Making a Constant Current Driver |
|
|
60 | (4) |
|
|
|
60 | (1) |
|
|
|
61 | (1) |
|
|
|
62 | (1) |
|
|
|
63 | (1) |
|
Powering Large Numbers of LEDs |
|
|
64 | (2) |
|
|
|
66 | (2) |
|
|
|
66 | (1) |
|
|
|
66 | (2) |
|
How to Use Protoboard (LED Hasher) |
|
|
68 | (1) |
|
Using Stripboard (LED Flasher) |
|
|
69 | (6) |
|
Designing the Stripboard Layout |
|
|
69 | (2) |
|
|
|
71 | (3) |
|
|
|
74 | (1) |
|
|
|
75 | (1) |
|
|
|
75 | (4) |
|
|
|
76 | (1) |
|
Storing Charge in a Capacitor |
|
|
76 | (1) |
|
|
|
77 | (1) |
|
|
|
78 | (1) |
|
|
|
79 | (1) |
|
|
|
79 | (2) |
| Chapter 5 Batteries and Power |
|
81 | (24) |
|
Selecting the Right Battery |
|
|
81 | (5) |
|
|
|
81 | (1) |
|
|
|
82 | (1) |
|
|
|
82 | (2) |
|
|
|
84 | (2) |
|
Charging Batteries (in General) |
|
|
86 | (1) |
|
|
|
86 | (1) |
|
|
|
87 | (1) |
|
|
|
87 | (1) |
|
|
|
87 | (1) |
|
|
|
87 | (2) |
|
|
|
88 | (1) |
|
|
|
89 | (1) |
|
Charging a Sealed Lead-Acid Battery |
|
|
89 | (1) |
|
Charging with a Variable Power Supply |
|
|
89 | (1) |
|
|
|
90 | (1) |
|
Hacking a Cell Phone Battery |
|
|
91 | (2) |
|
Controlling the Voltage from a Battery |
|
|
93 | (2) |
|
|
|
94 | (1) |
|
|
|
95 | (1) |
|
|
|
95 | (1) |
|
Calculating How Long a Battery Will Last |
|
|
96 | (1) |
|
|
|
97 | (3) |
|
|
|
97 | (2) |
|
|
|
99 | (1) |
|
|
|
100 | (3) |
|
|
|
100 | (2) |
|
Trickle Charging with a Solar Panel |
|
|
102 | (1) |
|
Minimizing Power Consumption |
|
|
102 | (1) |
|
|
|
103 | (2) |
| Chapter 6 Hacking with Arduino |
|
105 | (42) |
|
|
|
106 | (6) |
|
|
|
106 | (1) |
|
|
|
106 | (4) |
|
Modifying the Blink Sketch |
|
|
110 | (2) |
|
Controlling a Relay Using an Arduino |
|
|
112 | (4) |
|
|
|
112 | (1) |
|
|
|
113 | (1) |
|
|
|
114 | (1) |
|
|
|
114 | (1) |
|
|
|
115 | (1) |
|
Hacking a Toy for Arduino Control |
|
|
116 | (4) |
|
|
|
117 | (1) |
|
|
|
117 | (1) |
|
|
|
118 | (1) |
|
|
|
119 | (1) |
|
Measuring Voltage with an Arduino |
|
|
120 | (2) |
|
|
|
121 | (1) |
|
|
|
121 | (1) |
|
|
|
121 | (1) |
|
Controlling an LED with an Arduino |
|
|
122 | (3) |
|
|
|
123 | (1) |
|
|
|
123 | (1) |
|
|
|
123 | (1) |
|
|
|
124 | (1) |
|
Playing a Sound with an Arduino |
|
|
125 | (2) |
|
|
|
126 | (1) |
|
|
|
126 | (1) |
|
|
|
126 | (1) |
|
|
|
127 | (1) |
|
Controlling a Relay from a Web Page |
|
|
128 | (7) |
|
|
|
131 | (4) |
|
Switching with an Arduino and Transistor |
|
|
135 | (3) |
|
|
|
135 | (1) |
|
|
|
136 | (1) |
|
|
|
136 | (2) |
|
Using an Alphanumeric LCD Shield with Arduino |
|
|
138 | (2) |
|
|
|
139 | (1) |
|
|
|
139 | (1) |
|
|
|
139 | (1) |
|
Controlling a Servo Motor with an Arduino |
|
|
140 | (3) |
|
|
|
141 | (1) |
|
|
|
142 | (1) |
|
|
|
142 | (1) |
|
Typing Passwords Automatically |
|
|
143 | (2) |
|
|
|
144 | (1) |
|
|
|
144 | (1) |
|
|
|
144 | (1) |
|
|
|
145 | (2) |
| Chapter 7 Hacking with Raspberry Pi |
|
147 | (14) |
|
Setting Up a Raspberry Pi |
|
|
148 | (4) |
|
|
|
148 | (2) |
|
Fetching the Example Code |
|
|
150 | (1) |
|
Connecting to Your Pi from a Second Computer |
|
|
150 | (2) |
|
|
|
152 | (4) |
|
|
|
153 | (2) |
|
|
|
155 | (1) |
|
Controlling a Relay with Raspberry Pi |
|
|
156 | (1) |
|
Controlling a Relay from a Web Page |
|
|
157 | (3) |
|
|
|
158 | (2) |
|
|
|
160 | (1) |
| Chapter 8 Hacking with Modules |
|
161 | (34) |
|
|
|
161 | (5) |
|
You Will Need (PIR and LED) |
|
|
162 | (1) |
|
|
|
162 | (1) |
|
You Will Need (PIR and Arduino) |
|
|
163 | (1) |
|
|
|
163 | (1) |
|
|
|
164 | (1) |
|
|
|
165 | (1) |
|
Using Ultrasonic Rangefinder Modules |
|
|
166 | (4) |
|
|
|
167 | (1) |
|
|
|
168 | (2) |
|
Using a Wireless Remote Module |
|
|
170 | (4) |
|
|
|
170 | (1) |
|
|
|
171 | (1) |
|
Using a Wireless Remote Module with Arduino |
|
|
172 | (1) |
|
|
|
172 | (1) |
|
|
|
173 | (1) |
|
Using a Motor Control Module |
|
|
174 | (5) |
|
|
|
177 | (1) |
|
|
|
177 | (1) |
|
|
|
178 | (1) |
|
Making a Robot Rover with Raspberry Pi |
|
|
179 | (6) |
|
|
|
180 | (1) |
|
|
|
180 | (2) |
|
|
|
182 | (3) |
|
Using a Seven-Segment Display with Arduino |
|
|
185 | (4) |
|
|
|
187 | (1) |
|
|
|
187 | (1) |
|
|
|
188 | (1) |
|
Using a Seven-Segment Display with Raspberry Pi |
|
|
189 | (1) |
|
|
|
189 | (1) |
|
|
|
189 | (1) |
|
|
|
190 | (1) |
|
|
|
190 | (3) |
|
|
|
191 | (1) |
|
|
|
191 | (1) |
|
|
|
191 | (2) |
|
|
|
193 | (2) |
| Chapter 9 Hacking with Sensors |
|
195 | (22) |
|
Measuring Temperature with an Arduino |
|
|
195 | (3) |
|
|
|
195 | (1) |
|
|
|
195 | (1) |
|
|
|
196 | (2) |
|
Threshold Sensing with Raspberry Pi |
|
|
198 | (3) |
|
|
|
198 | (1) |
|
|
|
199 | (1) |
|
|
|
199 | (2) |
|
Switching with a Sensor and Comparator Chip |
|
|
201 | (2) |
|
|
|
202 | (1) |
|
|
|
202 | (1) |
|
Using a Digital Temperature Sensor |
|
|
203 | (4) |
|
|
|
204 | (1) |
|
|
|
204 | (1) |
|
|
|
205 | (2) |
|
|
|
207 | (4) |
|
|
|
208 | (1) |
|
|
|
208 | (1) |
|
|
|
209 | (2) |
|
Measuring Something's Color |
|
|
211 | (4) |
|
|
|
212 | (1) |
|
|
|
212 | (1) |
|
|
|
213 | (2) |
|
|
|
215 | (2) |
| Chapter 10 Audio Hacks |
|
217 | (20) |
|
|
|
217 | (5) |
|
|
|
217 | (2) |
|
Soldering Audio Connectors |
|
|
219 | (2) |
|
Converting a Stereo Signal to Mono |
|
|
221 | (1) |
|
Using a Microphone Module |
|
|
222 | (2) |
|
|
|
224 | (3) |
|
|
|
225 | (1) |
|
|
|
225 | (2) |
|
|
|
227 | (1) |
|
|
|
227 | (1) |
|
Making a 1-Watt Audio Amplifier |
|
|
228 | (3) |
|
|
|
229 | (1) |
|
|
|
230 | (1) |
|
|
|
231 | (1) |
|
Generating Tones with a 555 Timer |
|
|
231 | (2) |
|
|
|
233 | (1) |
|
|
|
233 | (1) |
|
Making a USB Music Controller |
|
|
233 | (3) |
|
|
|
234 | (1) |
|
|
|
234 | (1) |
|
|
|
234 | (2) |
|
|
|
236 | (1) |
| Chapter 11 Mending and Breaking Electronics |
|
237 | (10) |
|
|
|
237 | (1) |
|
Taking Something Apart AND Putting It Back Together Again |
|
|
238 | (1) |
|
|
|
239 | (2) |
|
|
|
241 | (1) |
|
Testing a Heating Element |
|
|
242 | (1) |
|
Finding and Replacing Failed Components |
|
|
242 | (2) |
|
|
|
242 | (1) |
|
|
|
243 | (1) |
|
|
|
244 | (1) |
|
Scavenging Useful Components |
|
|
244 | (1) |
|
Reusing a Cell Phone Power Adapter |
|
|
245 | (1) |
|
|
|
246 | (1) |
| Chapter 12 Tools |
|
247 | (12) |
|
Using a Multimeter (General) |
|
|
247 | (5) |
|
Continuity and Diode Test |
|
|
247 | (1) |
|
|
|
248 | (1) |
|
|
|
249 | (1) |
|
|
|
249 | (1) |
|
|
|
250 | (1) |
|
|
|
251 | (1) |
|
|
|
251 | (1) |
|
|
|
252 | (1) |
|
|
|
252 | (1) |
|
Using a Multimeter to Test a Transistor |
|
|
252 | (1) |
|
|
|
253 | (1) |
|
Introducing the Oscilloscope |
|
|
254 | (1) |
|
|
|
255 | (3) |
|
|
|
255 | (1) |
|
|
|
255 | (1) |
|
|
|
256 | (2) |
|
|
|
258 | (1) |
|
|
|
258 | (1) |
| Appendix Parts |
|
259 | (6) |
|
Kits to Accompany This Book |
|
|
259 | (1) |
|
|
|
260 | (1) |
|
|
|
260 | (5) |
|
|
|
260 | (1) |
|
|
|
261 | (1) |
|
|
|
261 | (1) |
|
|
|
262 | (1) |
|
Hardware and Miscellaneous |
|
|
263 | (1) |
|
|
|
264 | (1) |
| Index |
|
265 | |