Arduino Mega

Introduction
In my journey of learning everything about PCB design I often find myself looking at PCBs on the internet or those that are laying around in my room. When observing them I sometimes spot mistakes or odd things of which I think are remarkable because the company behind it is so big.

Arduino Mega
In this post I will discuss the things I saw when looking at the Arduino Mega PCB. I marked the spots with red circles or squares. (Click the image for a larger view).

MEGAWRONG.png

Mistakes and oddities
First of all the PCB is full of 90 degree angles and bad impedance matching. Datalines are all kept thight to make it aesthethically pleasing, while it introduces alot of capacitive and inductive crosstalk.

It’s quite visible that they chose to place vias only at places where there is no silkscreen. The board has a lot of empty space but still they cramp all these vias together.

Also the crystal oscillator for the ATMEGA2560-16AU seems to be placed very closely to what seems to be a power line. There might be some filtering on that line, but why place the crystal oscillator so far away from the IC?

Got comments or know why certain design choices were made? Leave your thoughts down below!

 

Image source: Reichelt Elektronik

Advertisements

Delivery Optimization hogging bandwidth

Some users with an average internet connection found out after a while that when Windows 10 starts downloading updates, the internet stops working in games, browsers and even on other devices connected to the same router. The problem lies with a Windows service called Delivery Optimization that has been introduced in Windows 10. In this post I’ll be showing possible solutions to the problem.

Disabling the service through firewall

  1. Press the Windows key on your keyboard
  2. Type “Allow a program through Windows Firewall” and click the search result
  3. Scroll through the list of apps and deselect the checkbox in front of “Delivery Optimization”
  4. Press OK and you’re done

firewall

Disabling the service by enabling metered connection

  1. Press the Windows key on your keyboard
  2. Type “Manage wi-fi settings” and click the search result
  3. Click on the connection you are currently having
  4. Scroll down and enable “Set as metered connection”

Wait about 10 seconds and see how Delivery Optimization slowly stops taking up bandwidth.

More solutions will be added when I find them

 

 

Square FM

schema40106
Square FM is a simple schematic I designed a while ago which exists of a triangle wave oscillator (U1A) and a square wave oscillator (U1B). The triangle wave is oscillating at a low frequency so you might call it the LFO. The squarewave oscillator is oscillating in a wide range so might as well call it the VCO (while it is actually current controlled).

The LFO is fed into the VCO by a potentiometer (R1) that allows you to set the depth of the frequency modulation. With R2 you can set the frequency of the LFO and with R3 you can set the frequency of the VCO.

Change the value of C1 and/or C2 to change the range of the VCO and LFO respectively. Using the CD40106 from different companies might yield different results.

BOM:
1. CD40106    x1
2. 10k pot      x3
3. 100nF cap x1
4. 1uF cap     x1
5. 47uF cap   x1
6. Speaker     x1

M-AUDIO Fast Track BSOD

Owners of the M-Audio Fast Track (see picture) and who updated their PC to Windows 10 (might also be happening with Windows 8), experience frequent Blue Screens Of Death that occur randomly.

26808

The occurence of this BSOD might de daily or weekly but it will always be the same error code:

DRIVER_IRQL_NOT_LESS_OR_EQUAL 

The Fast Track was one of the most versatile audio cards out there that was able to multihost. This means that the program (like a DAW) does not claim the audio card. When the audio card IS claimed (like pure ASIO4ALL cards), it is not possible to work in your DAW and stream a video on Youtube at the same time. This is highly annoying when you want to cover a song or want to play along a piano tutorial.

To get your Fast Track back in business this is what you have to do:

  1. Remove your current Fast Track drivers
  2. Go to the AVID driver page
  3. Download the drivers from November 14, 2005 (second-last on the page)
  4. Install these drivers
  5. Done

Your Fast Track will work as it always did but there are a few important things to keep in mind:

To multihost you first have to open the DAW you want to use, and then all the other programs. Let’s say you want to play guitar to your favorite youtube video, then you open the DAW, select the M-Audio driver and after that is done, you open your browser.

I am currently using the Fast Track for a few months with these older drivers, and everything works like a charm BUT I had one occassion in which I got the same BSOD as with the newest drivers. For me this is totally worth it because I went from a BSOD a day to a BSOD a half year.

I hope this guide helped you with your BSOD headaches

 

 

Pancake Printer

Context
We got the assignment from the university to make something innovative with a delta robot. This could be anything as long as it was not a simple pick and place robot. After quite some brainstorming we figured it would be a cool idea to make a robot that could print various shapes with pancake batter. The idea originated from videos where people draw with different colored batter on a cooking plate and when flipping over the pancake, it would reveal Barack Obama or Mario.

Delta robots
Delta robots are robots that use three arms simulteneously to move a platform in a 3D space (X, Y and Z). By writing smart programs it is possible to move the platform to very specific locations within this 3D space. When attaching a claw or electromagnet to this platform, it is possible to pick up stuff and place them somewhere else in the 3D space. These robots are used alot in factories where PCBs (Printed Circuit Board) are made and assembled or in factories where unsorted batches of stuff have to be sorted.

Final result
It took about 8 weeks (of which 2 fulltime) to finalize the pancake printer. The printer was capable to print a regular pancake, a square pancake and a star pancake. As WOW factor we added a wireless controller so pancakes could be made manually over a distance of about 20 meters.

 

Arduino 1: Introduction

I remember the first time I got ‘blink’ to work on my Arduino Uno. I never knew a blinking LED could be this exciting. But that was just the start!

In this course I’d like to take complete Arduino beginners by the hand and walk through everything you need to know to start engineering with an Arduino platform.

What you will need

  • Any Arduino platform. I recommend the Arduino Uno
  • The Arduino software
  • USB A/B Cable
  • Computer (or laptop). I’ll be using Windows 10.

Setting up the Arduino

Software
Download the latest software from the Arduino website. Install the Arduino IDE (Integrated Development Environment).

Hardware
Attach the Arduino to your computer with the USB A/B cable and wait for the drivers to install. Windows will notify you when this is done.

Testing your setup with blink sketch

Open up the Arduino IDE. You will see the following screen:

nuibbb

Check if under Tools > Ports the Arduino is present and select it. Now go to File > Examples > 01.Basics and choose blink. The code (sketch) will be loaded into the IDE.

In the topleft corner are the verify (left) and upload button (right).

huig

When pressing the verify button, the code will be checked on mistakes and errors. When pressing the upload button this will also happen but when the code is alright, it will be uploaded to the connected Arduino platform. If the code contains errors and mistakes, then they will be visible in the black box at the bottom of the IDE. This black box is called the console. When the verification fails, the code wont be uploaded to the Arduino Board.

Press the upload button and wait a few seconds. While the code is being uploaded to the Arduino board, you will see some LEDs blink and text flash in the console. When this stops, you will see that one LED is blinking slowly on the Arduino Board.

Mission succesfull!

Now we know your setup is working and your Arduino Board isn’t faulty.

 

KICAD 5: Beginners Tutorial (4.0.5)

With KiCAD it is possible to easily make your electronics dreams come true. In this tutorial we’ll go through the whole process from an idea to a 3D render of a PCB with the use of KiCAD.

Installing

First we’ll need to download KiCAD. I’ll be using version 4.0.5. for Windows (10) for this tutorial. KiCAD is totally free and can be downloaded here

Making a schematic

After installing and starting KiCAD you’ll see the main workspace.

ONE.PNG

Most work will happen with the first and third button of the 8 big buttons. Each button represent a seperate program that is used to make the PCB.

Start a new project by pressing CTRL+N or by clicking File > New Project > New Project. Give the project a nice name and after that press the first big button on the left.

A program called Eeschema will start now. In this program we will be making our schematic. You will see a big white canvas with a red border. The schematic will be made within this border. To the right are a few buttons we will be working alot with and to the left are a few buttons we’ll leave alone for now.

We will be making a LED strip with 8 manual selectable LED’s. This is done by a DIP switch, 8 resistors and 8 LED’s. We’ll use a screw terminal as input for the power supply. Ofcourse this is a very easy project but it’s all for you to get used to KiCAD.

Adding components

First press the place component button jijijbbbbb or SHIFT+A  and click somewhere within the red borders. A new screen will pop up where you will have to pick the component to place in the schematic. All components are stored in libraries. There are libraries for LED’s and resistors etc. The project will have a few default libraries imported already but the one we’ll need for the DIP switch isn’t included in any of them. Therefor we’ll need to import that library ourselves.

Close the component selection screen and go to Preferences > Component Libraries. Press the most upper ‘Add’ button and find switches.lib. Open it and close the component library screen. Now go back to the component selection screen.

jijhbbbb

Go to switches and select SW_DIP_x08 and press OK. The component will be stuck to your cursor so find a nice spot and drop it there. Congratulations you placed your first component!

Now for the other components:

  • 8 Resistors: Type R as filter and choose R. This is a standard resistor schematic symbol. Repeat this another 7 times or press C when hovering over a resister to copy it.
  • 8 LED’s: Type in LED as filter and choose LED. This is also a standard schematic symbol for a LED. Do the same as above to get 8 of them.
  • Screw terminal: Type in screw as filter and select Screw_Terminal_1x02 from the conn library.

Wire it all up

Now that we have all the components on screen, we’ll have to connect them together. Press the Place Wire button okokojm or SHIFT+W and connect them in the following way:

opopi.PNG

Don’t worry too much about overlapping labels, you can move them by hovering over them and pressing M. You can find the +5V and GND symbols by pressing the Place Power Port button jhgvf or SHIFT+P.

The schematic is almost done. First we’ll want to give the resistors a value. Do this by hovering over the R of a resistor and press V. A screen will pop up where we can change the R into any value. Let’s do a quick Ohm’s law calculation to find out what value we need:

Calculating the current limiting resistors value for the LED’s

We’ll most likely be using a standard 5mm red LED. These LED’s burn nicely when 20 mA flow through them. Because we probably use an Arduino or other digital output, we’ll be working with a 5V power supply to the LED’s. Now you might think: “We got the amps, we got the voltage… we can calculate the resistance needed!”. That’s not completely true! A LED is a weird thing as it needs at least (about) 2 volts to start working. Therefor we need to subtract 2 volts from the supply voltage. Let’s see:

U = 5-2 = 3 v
I = 20 mA
R = ?

R = U / I = 3 / 20mA = 150 Ohm

Seems like we’ll need to give the resistors a value of 150 Ohm.

Finishing the schematic

When all the resistors have a value we’ll need to number all components so it is easier to refer to them. We luckily don’t have to do this manually! Press the Annotate schematic components button huhvvv on the top bar. The following screen will popup:

annotata

Use the above settings and press Annotate. Before annotating the components you might have noticed that the components said things like R? and D?. When annotating these question marks change into a number.

Fixing bugs

The last step is to check if there are no bugs in the schematic like unconnected components. Press the Perform electric rules check button huio. In the new popup press Run.

mkmm

Two error messages appear and in the schematic there will be an arrow pointing at the places where the error is found. In KiCAD you have to ‘drive’ power pins to make this error go away. To do this go back to the schematic and press the place power port button jhgvf again. Type pwr_flag as filter and choose PWR_FLAG. Add two of these in the schematic and copy the power ports and connect them in the following way:

huyg

Run the Perform electric rules huio again and see the errors disappear.

Assigning footprints

Now that we are done with the schematic, it’s time to assign footprints to the components. Footprints contain the solder pads (and silkscreen) that correspond to the physical components. This will be used later when designing the PCB. Press the Run CvB button ojojojojoj. It will take a while for the screen to load. The following screen will appear:

vuvv.PNG

In the left column are the available footprint libraries, in the middle are our components in the schematic and to the right are the available parts in the library. Assign components in the following way:

  • LEDs (D1 – D8):
    Library: LEDs
    Part: LED_D5.0mm
  • Resistors (R1 – R8):
    Library: Resistors_SMD
    Part: R_0402
  • Dip switch (SW1):
    Library: Buttons_Switches_ThroughHole
    Part: SW_DIP_x8_W7.62mm_Slide
  • Screw terminal (J1):
    Library: Terminal_Blocks
    Part: TerminalBlock_Pheonix_MPT-2.54mm_2pol

The screen should look like this now:

uhgfds

Press the save button iuhgf and go back to the schematic.

Generating the Netlist

By generating the netlist we make a file that the PCB designing software can understand. The netlist contains the information about the footprints and labels to name a few. To make a netlist, press the Generate netlist button hiuh on the top bar and then press generate and save the file.

Now it’s time to make the PCB!

Making the PCB

Get back to the mainscreen and press the third big button from the left. PCBNow will open.

You’ll see the same kind of screen as in Eeschema. Our PCB will be made within the red borders. Let’s import the netlist so the program knows what it’s going to work with! Press the Read netlist button hiuh in the top bar. The following screen will popup:

yug

Use the same settings and press Read Current Netlist. Open the file we made earlier. If everything went right there won’t be any errors during opening. Press Close and see how all components are dropped on top of eachother. To spread these out press the mode footprint button ijbb. Now right click on the components and select Global spread and place > Spread out all footprints. This will evenly spread the components for a better overview.

Arranging the components

Now it’s time to arrange the components in a logical way. Hover over a component and press M to move a component. Try to make the arrangement efficient, aesthetically pleasing and logical. Try to have the gray lines overlap as little as possible. I arranged it like this:

poiuhy.PNG

Connecting components

Now it’s time to connect all the components. Press the add tracks and vias button oih on the right bar and start routing all components by laying tracks between all gray lines. A gray line will disappear when the connection has been made. Don’t route the grounds yet! We’ll use a trick to do that!

For this design the routing is fairly easy but what if gray lines overlap often? We are using a two sided PCB which means we have two layers to work on! To the right is a menu with all the available layers.

kokn

As you can see we are working on the F.Cu layer. F means Front and B means Back. You can use the ‘page up’ and ‘page down’ keys to switch between F.Cu en B.Cu. This is very useful cause it grants the ability to go under or over an already laid track like so:

mkmkkk

After laying all tracks except the grounds my PCB looks like this:

pads1

Edge cuts

Now it’s time to magically connect all grounds together. We do this by making a ground plane. Before doing that, we’ll have to define the edges of the PCB. In the layer menu select the Edge.Cuts layer. Now select the Add graphic line or polygon tool njnjnjn on the right sidebar. Draw a nice rectangle or other creative shape around the components but keep in mind to leave a little space when drawing next to the solder pads. My design looks like this:

hubbv

Maybe I should’ve left more space between the components but for now this will be quite aesthetically pleasing. Now it’s time for the ground plane!

Ground plane

Go back to F.Cu or B.Cu and select the Add filled zone tool adph and click on any edge of the edge cuts we just made. A screen will popup asking you what plane you want to make.

jiuhb

Select GND in the Net menu and click OK. Now trace the edge cuts and at the end double click to make the plane. Red dashes will appear around the edge cuts. Now right click somewhere on the board and select Fill or refill all zones. The board will magically look professional! Notice how all gray lines are gone and the ground pads have small connections going to them.

donee.PNG

3D render

The last thing to do now is to look at your PCB in magical 3D! Go to View > 3D Viewer or ALT+3 and the 3D render will pop up!

bnmbv.PNG

Noticed any mistakes or have questions? Just leave a comment! Feedback is always welcome.