One of the most important things for us about the HIDIOT was to make it a piece of Open Source Hardware. That means that it's possible for you to study it, learn how it's made, modify it, build your own and pretty much do anything you want with it. This freedom might seem a little strange, but it's how hardware used to be for most of the 20th century.
An important electronics skill is being able to read an electrical schematic. We thought we’d teach you how to read a schematic by reading ours, and comparing it to some similar circuits. Open this link in a new tab for a full-size copy of the schematic to play along with this blog post.
What is that thing?
A Schematic is a drawing that explains how the different parts of a circuit are connected together. The most important thing to understand in a given schematic is how the active components are interlinked. This will tell you what’s being used as well as what’s not, and is very handy to have in combination with datasheets (which we’ll cover in a future post). Don’t worry if this looks a little scary, we can break it down fairly easily.
We’ll start with the frame. Most (but not all) schematics have a frame around them with some notes in the bottom right hand corner. These notes just tell the reader the version of the schematic and it’s author, as well as any other important information.
For each component, there should be a label and (where appropriate) a value on the schematic. Components are linked together into nets, which are labelled.
In the image above there’s an arrow pointing to the word VCC, and a weird T-shape with GND next to it. These are references to networks for the power supply (VCC) and ground (GND). By naming these networks, we avoid having to wire each VCC and ground pin for each component. If we had to do that, the schematic would look a lot like a bowl of spaghetti! Any point with VCC on it is connected to every other VCC point. All GND points are also connected to each other.
At the top left of our schematic we have some curious looking holes. These are the holes at each corner of the board used for mounting spacers and other things. They’re not common on schematics and not in any way required for the board, but it makes it easier to mount the HIDIOT with them in. The holes are connected to the ground net, which is a nice way of minimising electrical problems when connecting or mounting.
Looking at our earlier picture, you might be forgiven for not noticing our C1 and C2 capacitors. Our power is normally supplied from the USB connection. This changes whenever USB devices are connected and disconnected. To smooth out the noise from changes we use a pair of capacitors in what’s called a decoupling arrangement.
This is very common. If you take apart electronics in your home, you’ll see that there’s often a pair of capacitors where the power source meets a chip. There are two common types of capacitor and we use both.
The C2 capacitor is the big black capacitor in your kit. This is much more effective at filtering out power supply noise than C1, but only at lower frequencies. The symbol for a polarized capacitor is a line with a + symbol, a space and a curved line.
The C1 capacitor is the small yellow ceramic capacitor in your HIDIOT Kit. This acts as a reservoir for high frequency wobbles in electrical supply. The schematic symbol for non-polarized capacitors is two thick lines separated by a space.
Resistors are easy to spot. They’re represented by zig-zag lines. Resistors should have labels and values on them. The picture above shows resistor R3, which has a value of 330 ohms.
Down towards the bottom left of the schematic you’ll find this tiny circuit on it’s own. This is the HIDIOT’s power LED circuit. We see that power comes in from VCC, passes through PWR on to R3 then on to ground.
The PWR component is our red Light Emitting Diode, or LED. Most people don’t realise but LEDs are as much a diode as any other type of diode. The minus and plus symbol above are the value (like the 330 in symbol to the right), and PWR is the symbol’s label. The minus and plus are there so that they show up the right way round on the board. This means on the schematic, they’re actually the opposite way around. To avoid confusion, just pretend it isn’t there.
The standard diode symbol is a Triangle with the anode (positive terminal) as it’s base and a line running across it’s narrowest point, indicating the cathode (negative terminal). Two arrows pointing outwards indicate that this is a Light Emitting Diode. There are many types of diode, each with differences in the symbol, but the triangle is common to them all.
Our Zener diodes allow current to flow in one direction, but also permit it to flow in the opposite direction when a certain voltage (known as the breakdown voltage) goes over a certain level, in this case 3.6 volts. The USB communication lines top out at 3.6 volts, but our ATTiny85 runs at 5 volts. The Zeners provide a convenient way of bleeding off any voltage over 3.6 volts by letting it run directly to ground. We can tell these diodes are Zeners by the squiggles on the line next to the triangle.
The Schottky diode is your kit’s black diode with a grey stripe. This is a special type of fast-switching diode with a low voltage drop. The symbol is different to the Zener diodes, in that the squiggle goes back on itself.
Switches are represented by symbols that show the number of poles and number of ‘throws’ the switch can have. Sparkfun have a really good tutorial about the different types of switch. We use a type of switch called a momentary tact switch in the HIDIOT.
Chips and ICs
A square or rectangle with a bunch of pins sticking out usually indicates an Integrated Circuit (ICs, or chips). Here we can see that this a TINY85-20-DIP, which we can find out through some googling means that it’s an ATTiny85 20P chip in a Dual Inline Package (DIP).
We can see the 8 pins sticking out, which understandably represent the ATTiny85’s 8 pins. The grey text inside tells us what each pin is, for example VCC and GND are the voltage and ground pins on our ATTiny85.
On a real ATTiny85 there are 4 pins on each side. On the schematic, these are bunched up to one side. The reason for this is that the schematic represents how components are linked, not what they look like. Sometimes it’s easier to keep the power supply pins separate to the data pins. There’s no common convention for this, and it will vary from schematic to schematic.
You might notice that the numbers go from 1 to 8 instead of 0 to 7. The Arduino IDE (and Digispark board layout) has their own numbering convention. The layout here uses Atmel’s own numbering convention. This makes sense because on the schematic we’re looking at the physical chip, not how it’s used in the Arduino IDE. You can see the pins mapped to numbers on page 2 of the ATTiny datasheet.
You should watch out for numbering when reading a schematic, as it’s easy to get confused. On bigger data sheets it’s often useful to write down each pin number for each chip on a piece of paper, and make notes as you figure out the connections.
Jumpers and breakouts
Across the top and to the right of the main schematic are a selection of jumper layouts. These represent the holes in your HIDIOT’s breakout area. Looking at the schematic we can see what some of these are. To work out where they physically sit on the board you’ll need the layout files, which we’ll walk through in another post.
In the picture above we can see the -V2 and +V2 rails as well as the P4 and P3 holes. Each pin is linked together, but -V2 is linked to GND and +V2 is linked to VCC. P3 corresponds to the two holes next to the P3 label on the breakout area on your HIDIOT. P4 represents the two P4 holes on the board. J1 through J12 are the 3 holes in a row next to each two-pin hole on the physical board. None of the J1-J12 holes are linked to anything other than themselves.
The final part of the schematic we’ll look at is the USB PCB connector. This isn’t a standard piece, so there’s no standard symbol for it. This is a good example of a non-standard symbol, something you’ll come across a lot if you start looking at prototype hardware designs. The most relevant thing isn’t really the symbol itself, but the connections made.
We can see that the ground and power supply lines are connected to GND and VCC. Without this, the board wouldn’t receive any power. The USB communication lines (normally called D+ and D-) are called USB_M and USB_P here.
We link pins via nets, which are represented by the green lines on the schematic. Whenever a net splits in 3 directions (as shown in the picture above) a junction node is created. This is a way of showing that all 3 intersecting nets are connected (as highlighted by the red arrows above). If a line crosses over another without a circle (as highlighted by the blue arrows), it means the nets aren’t connected.
Reading a schematic
There’s many different ways to read a schematic, and at least 10 times as many ways to produce one. Sometimes you’ll come across beautiful, almost artistic schematics that explain everything. Most of the time you’ll get something vaguely confusing until you’ve spent some proper time with it.
I like to start by identifying the main power source, as that should be at least indirectly connected to everything. In this case, the USB port in the bottom left of our schematic is the obvious choice, but on other schematics you may see symbols for batteries or other power sources. Understanding the power source will also tell you about how the schematic treats power and ground nets, and is the first step into enumerating all of the nets used.
Once I know the main power source, I can start looking at the on-board ICs. These are usually depicted as squares or rectangles. For each IC, you can look up the name and usually find a datasheet to match. The datasheet contains almost everything there is to know about that chip, and nothing about how it’s being applied in the schematic. Once you have a datasheet, you can find out what the chip does, and what the pins are for.
By now you should know what each chip is, what it’s capable of doing and (roughly) how power is managed. The next thing I look at are LEDs and displays. These are normally used to provide user feedback, and tracing the nets back to ICs will tell you which pin on which chip is used for which LED. If you have a manual or documentation to hand, you’ll be able to find out which pin is used to trigger warning messages for example.
Finally, looking at IC to IC connections, you’ll be able to find which pins are used to talk to which chips. For example, you might find out which pins a processor uses to talk to a storage device, which would then allow you to intercept the data being sent back and forth with a logic analyzer.
Schematics are also useful when combined with datasheets to find debug ports and unused pins. Unconnected pins aren’t necessarily unusable, and when combined with datasheets and the right connectors means that you might be able to use them to either gain information about the running operations of a chip, or to perform some function not originally intended for use by the manufacturer. Working through each chip, and ticking off functionality on a pin by pin basis is a laborious but comprehensive way of working out what everything does. It’s usually worth the time. This will often give up secrets about the thing you’re looking at that you otherwise would never know.
Understanding a schematic
Lets have a look at the HIDIOT schematic and see if we can work out what the HIDIOT does, pretending we’ve never seen it before.
In our example above, we know that the ATTiny85 is used on the HIDIOT, but there’s no idea about it’s purpose. In this case, the way the 68 ohm R1 and R2 resistors are connected to the USB M and P pins on the USB PCB makes it clear that PB3 and PB4 on the ATTiny85 are used for USB communications.
We can also see on our schematic that the R5 resistor is electrically connected to USB_M and PB3, and is being used as a pull-up. A quick web search for 1.5k pullup usb leads us to this forum post, that links on to chapter two of the excellent USB in a nutshell’s speed identification section.
The section talks about how the speed identification is set by pulling either D- or D+ up to 3.3 volts. Figure 3 on the page shows a Low Speed Device with a pull-up resistor connected to D-, matching our schematic.
If we follow the line from USB_M up through the junction nodes we’ll see two jumper pads on PB3. Following USB_P we can see jumper pads on PB4. If we were to put some logic analysis tools on those pads we should be able to decode all of the USB traffic going on between the chip and the USB port, but that’s for another blog post.
So in this case, with a few minutes looking at a schematic we’ve found out:
- Where the power comes from
- How the IC communicates with the non-standard blob in the bottom left
- Where the test points are for the communications between the chip and the blob
- What standards apply (in this case, low speed USB)
In this blog post we’ve looked at:
- The HIDIOT’s Open Source schematic
- Some common schematic symbols
- Reading a simple schematic
- Identifying functionality from a schematic
You’re now ready to look at some other schematics and see what you can find out. At it’s core, the HIDIOT is a simple V-USB circuit, like the Digispark or Trinket. If you look at their schematics you’ll see the core functionality is pretty much identical. The V-USB site lists a bunch of different open source projects, pretty much all of which can be recreated with a HIDIOT.
Why not take a look at these schematics, and see what you can identify?
The Beagle Bone Black is a great example of a well-documented open source full-blown computer capable of running Linux, but it’s a heck of a lot to read through! Can you find the USB D+ and D- connections on the Beagle Bone Black, and find out which pins on the AM335X they’re connected to? What are the ICs involved in USB connectivity, and what do they do?
The schematic is only one part of the HIDIOT’s open source material. You can find all of our open source code on our GitHub.
Never miss a post
Like what you see?.
Get our latest electronics and security content in your mailbox. We won't send you spam. Unsubscribe any time.