Short Circuits

MOTHERBOARD (V1)

The MOTHERBOARD kit lets you build a circuit with a microcontroller at its heart. A microcontroller controls inputs and outputs depending on how you program it and what is connected to it. Inputs could be in the form of sensors, switches or other microcontrollers. Outputs could be as simple as an LED (Light Emitting Diode), number display or speakers, or something more complicated like the stepper motors, LCD screen and heating element of a 3D printer.

The MOTHERBOARD includes screw terminals for digital and analog Inputs and Outputs, a voltage protection circuit, headers to connect a serial to USB module (used for programming), and a Bluetooth module. We’ve also included a Real Time Clock (RTC) circuit on board, so making a clock with the DIGITISER display is a breeze. This kit will be the “brain” of your project, so lets get familiar with its functionality!

Tools Needed:

Soldering Iron

Solder
0.3-0.5mm

Flush Cutters

Flux

Screw Driver
2mm

Alan Key
2mm

Serial-USB adapter

In your kit you will find the following components. Click on any component with an information symbol to learn more about it.

1 x PCB

1 x ATMega328P

1 x DIP28 Socket

1 x DS1307

1 x DIP8 Socket

3 x 0.1uF Capacitors

2 x 22pF Capacitors

2 x Blue LEDs

1 x 5.1V Zener Diode

1 x 0.5A Polyfuse

2 x 2K Resistors

5 x 10K Resistors

1 x 16MHz Crystal

1 x 32.768KHz Crystal

1 x 2032 Battery Holder

1 x USB Micro-B Socket

1 x Momentary Switch

1 x 4-pin Header

1 x 6-pin Header

11 x 2 Position Terminal Blocks

4 x 6mm M3 Screw

1 x 20mm Standoff

Strip of 18 x 2K SMD Resistors

Strip of 18 x Blue SMD LEDs

DesignationValueNameFootprint / PitchDatasheet
BT12032Battery HolderLINK
C1, C2, C5100nF (0.1uF)Ceramic Capacitor2.54mmLINK
C3, C422pFCeramic Capacitor2.54mmLINK
D15.1VZener Diode12mmLINK
D2, D325mA, 3.3V, BlueLED5mm, 2.54mmLINK
D4-D21 (opt)20mA, 2.5V, BlueLED SMD0805LINK
F10.5APolyfuse5.1mmLINK
J1Micro BUSB SocketLINK
J211 x 2 positionScrew Terminals3.5mmLINK
J34 positionPin Header2.54mmLINK
J86 positionPin Header2.54mmLINK
R1, R22K, 1/4WResistor THT7mmLINK
R3 R710K, 1/4WResistor THT7mmLINK
R8 – R25 (opt)2K, 1/4WResistor SMD0805LINK
SW1SPSTMomentary SwitchLINK
U1DIP28IC SocketDIP28LINK
U1ATMega328PMicroprocessorDIP28LINK
U2DIP8IC SocketDIP8LINK
U2DS1307RTC ChipDIP8LINK
Y116MHzCrystalLINK
Y232.768KHzCrystalLINK

Our PCBs are designed to make the circuit easier to understand at a glance. This means they aren’t designed in the most electrically optimal way. You are probably here to learn some basics about electronics and build some skills to enable you to design your own PCBs for some cool ideas you have. We aren’t designing military, medical or aerospace grade tech here. We also aren’t using super high speed communications, so we can design circuits with a fair amount of freedom and forgiveness. 

With that said, there are a few guidelines to follow to make sure your circuits actually work. The easiest way to help protect your circuit from Electromagnetic Interference (EMI) is to add a ground plane. This is a a filled copper area covering the back side of the board that is connected to the circuit’s ground. It’s a really convenient way to connect all the components to ground that need to be, as the circuit’s ground plane is right under each component. It’s also better to keep things tight together, especially the power supply circuitry. For example, bypass caps must be as close to the device they are filtering power for. 

If you are designing your own PCB, you can use the smaller surface mount versions of each part. This will make the device much smaller and also cheaper. PCB manufacturers like JLCPCB do a great assembly service, so you won’t even need to solder anything. Check out our KiCAD to Custom PCB guide to learn how to make your own PCBs using our schematics. You could grab the bits you need from the Motherboard and the bits you need from the Digitiser and make your own mini clock for example. 

USB Power 

You can power the board through the Vcc and GND terminal blocks. But USB is more convenient. It is a difficult part to solder, but don’t worry, if you mess it up, you can snip an old USB cable and connect the red and black wires to the terminal block’s VCC In and GND respectively. This USB socket is not used to communicate with a PC. The data connections aren’t connected. This is because the ATMega328P can’t communicate directly through USB. You need to use a Serial to USB board or a more feature-packed microcontroller to translate for the 328P.

5v Input 

This is where a regulated 5V can be connected to The MOTHERBOARD (and any other Boards connected to the 5V Output). This could come from your favourite bench power supply, or our upcoming POWER BOARD, which provides 5v (for all the 5v components in our circuit), and a variable voltage from 1.2v up to 20v+ (for most other needs). As mistakes do happen, we’ve added a Zener Diode and a Fuse to protect the rest of the circuit from overvoltage. If the voltage exceeds the breakdown voltage of the diode (5.1v), current will start flowing through the Zener to ground, rather than the rest of the circuit where it can damage components. This will in turn increase the current draw to a point that would trip the fuse and save your components. (See Component Index for more info)

5v Output 

Here we have a convenient 5v output, to power all the other boards that you want to use with your microcontroller. Power the DIGITISER, the RGB MATRIX, the SENSOR ARRAY, or any other board we produce. Boards powered from these outputs also benefit from the voltage protection circuit we added to the 5v input.

  Ground Planes 

The back of the board is covered with a layer of copper that is connected to GND. This is called the ground plane. We add this for a few reasons. One reason is that it’s just easier to design that way. When you need to connect something to ground, just connect it directly to the ground plane underneath the component. That way you don’t have to worry about adding any ground traces all the way back to the power input. If this was a 4-layer board, then a 5V plane would also be a good idea. Another reason is to add some electromagnetic shielding to the circuit, this reduces the chance of erroneous results due to the effect of electromagnetic interference on our circuit.

Design Considerations

When laying out power traces, and the components themselves while designing PCBs on the computer, it is important to consider current loops. When electric current moves around your circuit, it can create electromagnetic interference (EMI). This messes with some sensitive components. The larger the loop, the more EMI is caused. This is one of the reasons why using the bottom copper layer as one big ground plane is preferable. This way, the current can take the shortest and most direct route back to the power supply. Try and make the 5V traces as direct as possible. When we designed this circuit, we had to balance this with readability, so our boards aren’t optimally designed for EMI.

ATmega328P Microcontroller 

The ATmega328P is the brain of our circuit. This chip can read changes in the voltage at its input/output pins and also set them to a chosen value. Using the Arduino programming software, we are able to program it to respond to inputs from other modules and send responses to other modules as outputs. This gives us the ability to create unlimited ways to manipulate other devices to build and program useful gadgets. You could read data from a Real Time Clock module then process the data to send to a 7-Segment display… A Digital Clock! Or you could read the data from a thermometer and process that data to send to an RGB LED array… A Graphic Thermometer! The possibilities are near endless!

Bypass Capacitor C1 

A decoupling capacitor. It’s function is to smooth out any noise (spikes or drops in voltage) due to other components affecting the power supply to the microcontroller. It ‘decouples’ the chip from the other parts of the circuit. It does this by holding an amount of charge and releasing it when the voltage drops, to compensate. It is placed between power and ground, as close to the IC’s (Integrated Circuit) pins as possible.

Bypass Capacitor C2 

This is another decoupling capacitor that makes sure the analog reference voltage (AREF) measured from pin 21 of the microcontroller is at a steady value. In our case, that value is the same as our reference ground, or approximately 0v.

Crystal Oscillator 

The crystal oscillator mechanically oscillates to provide a square wave signal at a stable reference frequency. This is used by the microcontroller as a clock signal, or its heart beat if you like. It determines how many times a second the microcontroller can do the actions needed to execute instructions.

Pin 1 

The pad for the first pin of any IC footprint is usually indicated by a square pad. Other indications are the semi-circle on DIP ICs or some other mark close to the first pin. When oriented correctly, the first pin is on the bottom left. The microcontroller in this circuit is oriented upside down due to the design of the PCB, so make sure you check this before soldering the IC socket and inserting the chip. Pins are numbered anti-clockwise.

Load Capacitors C3, C4 

These are the load capacitors for the crystal oscillator. They are reactive components that help create the feedback loop that enables the crystal to start oscillating at the intended frequency.

Reset Switch & Pull-Up Resistor 

This resets the microcontroller. A Single Pull Single Throw switch with a 10K Ohm pull-up resistor. This switch pulls the RESET pin on the microcontroller to ground (0V) when pressed. This resets the microcontroller. As electricity takes the path of least resistance, when the switch is not pressed, the only path is to VCC (5V) through the 10K resistor. When the switch is pressed, the easiest path is to ground. If the resistor wasn’t there and the switch was pressed, there would be an uninterrupted path from VCC to GND. This is a short circuit, and will probably burn out the microcontroller. 

Circuit_IO
Schema_IO

Digital IO  

D2 to D13 are digital Inputs and Outputs. Digital pins can only read, or write a state of on (1, 5V) or off (0, 0V). We can however, still control the brightness of an LED through PWM (pulse width modulation), which uses the speed at which the microcontroller can turn on and off some of its digital pins. If the pulse is on 50% of the time, then the brightness will be 50%. This is called a duty cycle. D3, D5, D6, D9, D10 and D11 are PWM capable. Check for the tilde symbol (wavy line) underneath its label on the board, or on the pinout diagram of the ATMega328P. 

Analog IO 

Analog pins can read voltage between 0V and the operating voltage of the microcontroller (5V) using the internal Analog to Digital Converter (ADC). The ATmega328P has a 10-bit ADC. The largest number that can be stored in 10-bits is 1024, and as such the analog pins have a resolution of 1/1024. Which means at 0V it will read a value of 1, at 5V it will read 1024 and at 2.5V it will read a value of 512. This is useful when reading things like photoresistors, or an analog audio input. 

The ADC cannot output analog signals or even mimic them with PWM. Also, the programming syntax AnalogWrite() has nothing to do with the analog pins. To output sound you would use a PWM pin to create a square wave (alternating from on to off at a certain frequency). 

D13 LED

The D13 LED is named after the reference Arduino gives to the digital Input Output (IO) pin of the ATmega328P it is connected to (see the pin-out diagram for all the pin numbers). It is connected to this IO pin because it is also the system clock pin of the SPI (Serial Peripheral Interface). When you are communicating with the microcontroller through serial, either with the FTDI module for programming, or any other device connected to Rx, Tx, MISO, MOSI, etc. The LED will turn on when SCK (same pin as D13) is pulled high, and off when it is pulled low. That’s why you see it rapidly turning on and off when these things are communicating. It’s great to check if your circuit is working without programming the chip or having another form of output connected.

You may ask why they aren’t on all the pins as standard. Well, the current consumption of the LED, although small, may negatively affect a device connected to the same pin, or damage the microcontroller. The ATmega328P, according to its datasheet, has an absolute maximum current draw of 40mA per pin and a maximum total current draw of 200mA. Fortunately, the other kits in our series that source current from data pins (RGB MATRIX, DIGITISER etc.) all use shift registers, which source very little current from the ATMega’s pins and instead get their power from the main 5V input. Shift registers also have a maximum current draw per output pin and per chip that need to be taken into account when designing with them, but there are ways around this. Check out the kits in the series that use them to find out more. 

For your convenience, and for flexibility, we have added jumper pads between the LED and ground. If you want to use the LED, then solder these two pads together to allow a complete circuit through the LED. If you don’t like the LED, or you want to connect a high current draw device to D13, then unsolder the jumpers.

How the circuit works

To turn the LED on, you will have to tell the microcontroller to output 5V from the relevant pin. In this case you could use the following code:

digitalWrite(13,HIGH)

(See the programming section for more info)

When the microcontroller sets its pin to 5V, the difference in voltage (potential difference) across the resistor and LED will be 5V. This is because the other end of the LED is connected to GND or 0V.
If the resistor wasn’t added, 5V would be applied to the LED which would exceed its recommended limit of 3.3V (check the datasheet).

To reduce the current going through the LED we can use a resistor in series with it. To calculate the value of this resister, we use Ohm’s Law. (See the section on resistors in the component index for more) Ohm’s law describes the relationship between Voltage (V), Current (I) and Resistance (R). If we know the LED will cause a drop of 3.3V and the source voltage is 5V, then the Resistor will take care of the rest. So if we take the source voltage (5V) from the LED voltage (3.3V), we get the voltage across the resistor (1.7V).

 

From there we can use the typical current draw of the LED in amps (0.02), together with Ohm’s law, to find the minimum resistance needed. 

If we used this value, the LED would be at full brightness and consume 20mA. That would be half the pins limit! We can reduce this by adding a much higher value resistor. We have used a 2000Ω resistor which limits the current to around 0.85mA. You could use an even higher value to reduce the current draw and the brightness of the LED. Using a lower value resistor than our calculated minimum would result in the LED having a shorter life. 

Schema_IOLEDs_3

Data Indicator LEDs

As stated in the previous section, there are advantages and disadvantages to adding indicator LEDs to the data pins of the microcontroller. These are optional because they are very difficult to solder. 

We can use the LEDs to help us understand the transfer of “data”, or 1’s and 0’s, off’s and on’s, between the microcontroller and what it is connected to. A great project to help with this is to slow down the data transfer rate between the microcontroller and a shift register. When the pins are communicating at a normal rate they will be turning on and off so fast that they will show a consistent brightness. A clock pin LED will look brighter than a latch pin LED as it will be turning on more often. By adding a delay between each step in the code, you can see exactly what is happening with the data, clock and latch pins when serial data is being sent. It’s a great way to visualise the process (Learn more about this from our other kits that use shift registers).

As space is a concern, and because they aren’t needed for normal functionality, we decided to use surface mount, 0805 (2012 in metric – 2.0mm x 1.2mm) resistors and LEDs. Because of this, it is rather difficult to solder by hand. We recommend a steady hand and to watch our quick how-to video before tackling this upgrade. 

There is no need to worry about the polarity of the resistor, but the LED must be oriented correctly. The indicator triangle, line or other mark on the LED indicates the cathode, or ground terminal. Make sure this indicator is pointing in the direction of ground in the circuit (follow the red line from the A5 pin to Ground in fig.1). It doesn’t matter if the resistor or the LED comes first in the circuit so check the two images on the page for the different ways to install the components (fig.2, fig.3).

To turn on the LED circuits, bridge the jumper pads with solder. If you have successfully installed these components and decide you don’t need them any more, you can desolder the jumper pads to disconnect them from ground and break the circuit.

As the pin is acting as the positive end of the circuit, when the pin goes HIGH (5V) the LED will turn on. When the pin goes LOW (0V), the LED will turn off. 

Bluetooth Header 

Want to control your project from your phone? How about programming it wirelessly? Well, here’s a handy header to plug in a Bluetooth module to make those things possible. This module connects via serial communication. Rx on the microcontroller (Pin 2) connects to Tx on the module, and Tx (Pin 3) to Rx, just like the FTDI module.

When purchasing a BT module, look for an HC-06 module with 4 pins.

Resistors 

We don’t recommend connecting a Bluetooth module and using an FTDI module to program the chip at the same time. If Tx on the BT module were to go high (5V) while Tx on the FTDI module went low (0V) while connected, you have 5V connected directly to ground, which is a short circuit. Because of this, we have put 10k resistors between the FTDI and Bluetooth’s data lines. If there is a short, the amount of current would be minimal.

Capacitor 

When the FTDI module communicates with the microcontroller, the microcontroller needs to be reset at a specific time. To do this, the RESET pin of the microcontroller needs to be set low then high, just like pressing and releasing the reset button manually. When DTR on the FTDI chip goes low, the capacitor is drained and the RESET pin goes low. After a short time, the capacitor will be charged up through the pull-up resistor (R5), back to 5v, which is the same as releasing the button.

FTDI Header 

There are a few ways to communicate with the microcontroller to program its functionality. You could take the chip and plug it into a compatible Arduino Uno that has the USB functionality on board, then plug that into a PC. You could program it via another device over Bluetooth (using a Bluetooth module). Or you could use a USB interface chip and accompanying circuitry (The FTDI module for example). We’d love to put that on board for you to build, but all these chips are surface mount, so not easy to DIY. We’ve added an FTDI module header instead. These modules are cheap, easy to find and there is plenty of documentation available. Make sure the pins match when buying and inserting the module.

 

Crystal  

Just like the ATMega328P, the DS1307 needs a crystal to help it keep time. In this case, the chip requires a 32.768MHz crystal. The membrane in the crystal vibrates at 32,768,000 times a second. This oscillator circuit does not need extra capacitors like the ATMega328P’s as this is dealt with inside the Integrated Circuit (IC).

I2C Communication 

I2C is another way certain devices can communicate. It uses the SDA and SCL pins on a microcontroller. These are pins 27 and 28 on the ATmega328P. Many devices can be connected to the same I2C pins on a microcontroller. So go ahead and use the SDA and SCL screw terminals to add other I2C devices. Just remember, if the two devices have the same address, then they can’t be used together. Check the datasheets first. Some I2C devices have an address select pin to choose between two addresses. Connecting that pin to ground or VCC will give you one address or the other.

Pull-Up Resistors 

Just like the reset switch, these are pull up resistors that hold SDA and SCL signal lines high (at 5V) until they are pulled low by the communicating devices.

DS1307 RTC IC 

An RTC (Real Time Clock) module has an RTC chip, a crystal, resistors and a coin cell. Its job is to keep time even if the rest of the device has lost power. RTC chips run on very little current, so they can keep time for a long time on one coin cell. This is great for when you want to build a clock using the Digitiser kit, or even a graphical clock with the RGB Matrix. It is also useful for scheduling functions. Maybe you want the RGB LEDs to turn on and slowly change brightness as you wake up… So many possibilities!

2032 Battery Holder 

This holds the 2032 coin cell battery (sold separately). This is used as backup power for the RTC. It enables the chip to store the correct time even if power is removed from the board.

 

×
×

Cart