OK! So I have received my first free gift from Jaycon Systems, a 5V FTDI programmer and a DIY Arduino kit. Both these products you can find in these two links:
Now let’s go through the parts included in the kit:
- Atmega IC Microprocessor 328P (32Kb)
- 16 MHz Crystal Oscillator
- 22pf Capacitors (2x)
- Push button (to be used for resetting the board)
- 0.1uf capacitor (reset capacitor)
- 10K Resistor 1
- 330 Ohm Resistor 2
- LED 3
One more note before I start: On this assembly you need quite a few breadboard jumper wires. Some very cheap and very good ones you can find here on this link: 140-Piece Wire Kit
Or you can use any kind of wire available to you.
Important note: The IC is POLAR SENSITIVE!!!! So be extremely careful how you fix this on the breadboard (the position of the small circular indicator and the letters both starting from the left! (Really pay attention to this! I burned a considerable number of IC to get this! You have the chance not to!)
In this tutorial. I will be showing you how to construct a fully functional Arduino board. This you can do on a prototyping breadboard or even a PCB.
One thing that you should never ever forget if you are planning to solder this baby, you need to use a 28 DIP socket. I’ve seen amateurs solder the IC directly to their PCBs without using any kind of socketing. While some people may argue that this is not so wrong, look at it this way:
- Soldering needs HEAT! HEAT damages the IC!
- More importantly, if you ever need to change the IC, how are you going to do that when the thing is soldered on your PCB?
One more thing:
In all my tutorials, you will find that I use Black Jumper cables for GND and RED jumpers for +ve voltage – unless specified otherwise.
This is a common electronics principle, and using it will most likely help you be organized, and make your circuit way more easily understandable. So, anywhere you see BLACK jumper cables, that means I am connecting to GND and anywhere you see RED jumper cables, it's +ve.
So let’s get this thing running!
"Connecting the IC to the Breadboard (BB)"
There really is no special way to do this, but REMEMBER!
ALL breadboards work the same way, so never forget that the rails of the breadboard (talking about the main ones – yes the ones that are inside the breadboard and not the 2 horizontal rails) are connected VERTICALLY! This means that if you connect an LED like this, it will not work:
When you connect the GND from the battery to the black wire and the red one to the +ve of the battery, you will be correct! But if you have connected the two – on the breadboard – horizontally, there is nowhere for the electricity to go (the circuit is OPEN)!
Pretty straight forward? You will be surprised how many people make this mistake, and then wonder why the thing does not work.
One more thing about the breadboard. If you haven’t already noticed, there is a line on the center (the one that looks greyer on the image above). Through that line there is no current flowing, plus this line was designed to be able to take your IC without short-circuiting it. So the first thing you need to do is connect the IC as such:
GOOD! Now let’s move to something more interesting.
"Connecting the Jumpers"
For this step, you need:
- 6x RED jumper wires
- 6x BLACK jumper wires
- 1x GREEN jumper wire
- 1x BLUE jumper wire
- 1x ORANGE jumper wire
- 4x YELLOW jumper wires (to be used later)
Step 2 is all about connecting the jumpers to the board, so let’s start with my favourite ones…. RED.
Do you remember the top HORIZONTAL rail that we were talking about earlier? Yes that one on the breadboard that you are now holding…. THIS rail is connected all the way through horizontally. Well this is exactly the property that we are going to exploit here in order to make our life easier on looking for a power source. So pick up your 6x RED jumpers and connect them on the top rail as such:
For now, just leave them hanging just like I did until we connect the smaller electronic components on the board.
Great! Now that we have the first jumpers added to the Breadboard, let’s move on to making a bigger mess on this breadboard just as I personally like it! Move on and connect the BLACK jumpers like this:
Very straight forward. Now take the remaining jumpers according to the colors, and connect them like this:
"Connecting Components to The BreadBoard"
We have completed step 2 that was all about wires, and now you have ended up with a messy breadboard. It’s about to get a little more complicated, and even messier.
For this part of the tutorial, you will need ALL the electronic components that came with the kit.
Ok let’s start with the easy ones. Find the reset button. The push on button is the one that is responsible for resetting the board, so connect that on the first pin of the IC as follows:
Now find the 3x capacitors and starting from left to right on the image below, connect the 0.1uF and the 2x 22pF like this:
At this point it seems pretty random. But don't worry, it will all come together!
So now we have the capacitors and the reset button connected. One thing to note - so that we start getting a little familiar with some of the electronic components that we are seeing and playing with here: Capacitors are rather amazing and they are used everywhere….when I say everywhere I LITERALLY mean EVERYWHERE! I won’t go too much into explaining what they are made of and what they CAN or cannot do, but I will give you a little bit of an experiment for you try in your own free time… I hope this makes you understand the riddle of capacitors better... well at least it worked with me when I figured it out.
Side experiment: Take the capacitor and connect it to a battery source… preferably the largest capacitor that you can find…. connect the capacitor DIRECTLY to the battery, and allow it to rest there for as long as you like, it doesn’t really matter... the point is to get some flow running and charge it. Now find a metallic object and CONNECT BOTH THE PINS OF THE CAPACITOR TO THAT METALLIC OBJECT. Because metal is the perfect conductor, notice what will happen. Try this with both CERAMIC and ELECTROLYTIC capacitors... take note of what just happened.
The capacitor is exactly what it says.... IT HAS CAPACITY! And by that I mean it acts as a little tiny battery that – depending on the capacity of the unit – withholds some voltage. There are 2 kinds of capacitors that are most familiar, the electrolytic and the ceramic. What you have here are 3 ceramic capacitors. They are used literally everywhere. In TVs, laptops, as means to delay switches on lamps of large factories etc. etc. BUT mostly small value capacitors are used to FILTER electricity passing through the boards.
So now that you have a bit of background knowledge, it is time to get back to work, and that involves nothing more than looking for the resistors and the LED that you have. So, 2 resistors (330Ω – for LED and 10K) will be connected as such on your breadboard:
I know, I know…. Things ACTUALLY started to get complicated…. bear with me here and I’ll make it much easier for you. So what I have done here is simply connect the 2 resistors and the LED. The LED is the basic indicator that this is:
- Working well; in the sense of uploading some code in there and testing.
So what have I done and what connects where. To all you that are afraid of resistors and their deadly colors.... I really feel you. I find it hectic to understand and realize how to figure out the numbers on the resistors.
The program that I am using to make the schematics and the images that you see above, FRITZING, allows me to just type in the value and it informs me the true colors of the resistors.
To make a long story short, what you are seeing on the breadboard is: the bottom resistor is the 10K and the one on the top part connected to the LED is the 330Ω.
At first I found it very interesting that the LED resistor is actually connected on the GND side of the LED.
I will give you a small explanation incase you have not figured it out already:
One of the reasons why the LED and the resistor are connected in such way is that current flows through the +ve side of the LED.
But the current also comes out of the GND –ve Side of the LED!
The Resistor is then connected on the opposite side of the LED than what you already know because we need to make sure that no more current than what we need is going to the IC.
So we have connected mostly all the components of the Kit on our breadboard. Now the last thing to do is find the Crystal Oscillator….
Yea that’s it….the small silver looking thing that has the carving 16.0UH09 on its top. Let's connect it!
At some point I have mentioned 4x YELLOW Jumper cables… well this is the time to use them. But pay attention because now is the part where you REALLY need to focus…connecting the crystal can be tricky, so make sure that you follow the image below AND the written instructions:
- From the right lower side of the IC, count 6 pins, or DIPs if you prefer, and then add 1x jumper. Connect the other side of the jumper to the left side of the oscillator crystal.
- Now do the same from pin 5 of the IC and the right leg of the crystal. From that leg, pull one more jumper wire and connect it to the filtering ceramic capacitors as shown below.
Finally pull one last jumper from the left side of the crystal to the left leg of the second (top) ceramic capacitor.
"Connecting the Jumpers to the IC and finalizing the installation"
You have finally connected all Electronic Components and the IC to the Breadboard. Now it is time for the final step of the hardware setup for this small DIY board.
We have added some Colorful jumpers on our BB. Now it’s time to connect them. Pay attention to the image below and connect them as shown:
I know it looks complicated....bear with me.
- Starting from the top HORIZONTAL rails of the breadboard, take the first black and red jumper wires and connect them as shown.
- TOP horizontal rail, 2nd from RIGHT RED jumper wire. Connect that on the +ve of the LED.
- Moving on the 3rd from RIGHT RED jumper. Connect this on pin 5 of the IC (starting from the top right side). That is the pin where you have added the resistor
- On pin 6 of the IC, connect the last RED jumper.
- TOP horizontal rail, where the BLACK GND is located (there's only 1 left). Connect it to pin 7 of the IC.
- BOTTOM horizontal rail. Take the first BLACK GND that you find (from the right) and connect it to the LEFT leg of the LOWER RIGHT capacitor.
- NEXT BLACK from RIGHT connect to bottom pin 7 (Counting from right to left) of the IC.
- The RED jumper, located DIRECTLY below the BLACK one you have connected on 7 should be connected to pin 8 of the IC, right next to the previous one to the left.
- Almost there! Now the last cable that you are going to connect is one of the remaining BLACK GND jumpers. It really does not matter which one you choose as long as they are both connected to the HORIZONTAL BOTTOM GND rail. So take one of them, and connect it to the LEFT leg of the push/reset button that you installed previously.
That’s it....You're done assembling this awesome kit!!
Now that we have finished connecting I want to draw your attention to 2 important things:
For the loose cables, you need to know the following:
DTR, TX and RX are the signal and communication ports that you will be using to control and program this IC. This is the second important thing, and this is step 5!
"Connecting the Programmer and Uploading the First Test sketch"
This is the FTDI Basic 5V. It is the device you need to program the IC, and once you get to know it, you will also think that it’s pretty cool. Maybe a little complicated to figure out and maneuver around with at first, but very cool and powerful once you get to understand it.
This kit comes in 2 parts. The pin headers that are perfectly made and perfectly bended to avoid people like me who are clumsy, breaking them into millions of pieces and the actual FTDI programmer. The only thing that you need to add here is a micro USB cable. You definitely have at least one of these cables lying around in your house, as those are a standard used for smarthphones.
So now that we know what the kit includes, there is only one major problem here: you need to solder the pins in position!
I personally am not so keen of soldering, and I try as much as possible to avoid it. However there’s no chance you can avoid it here. You need to be VERY VERY CAREFUL.... you are dealing with very sensitive microcontrollers and microchips here.... besides, the material base that the headers are made of is PLASTIC! This means that it will melt if you try and leave the solder on for a long time, and if you have no more pin HEADERS like those, you would have done all this for nothing....
The FTDI board specification sheet (or datasheet) clearly mentions:
"Do not leave the solder on the BOARD for more than 3 seconds"
This is the mistake that most of us, including me, MUST do at least once.... leave the solder iron on the board for more than 3 seconds and you literally have no board… SO BE, CAREFUL. Now as much as this will provide a challenge for you and I know that we all love challenges you need to add the PERFECT amount of solder… too much or too little will not do....
"OVERDESIGN IS AS BAD AS UNDERDESIGN"
This makes it sound bad, but my point is: be careful! If you are, you won't have any problem soldering the pins into place!
IF you hold the FTDI board as shown on the image above, you will notice from RIGHT to LEFT that pin inputs are labelled DTR, RX, TX, 5V, CTS, and GND.
But we only have 5 free cables!!!
Yes that’s correct…because we only need 5 inputs to be able to program the 328ATmega.
Orange, Green, Blue and Red jumpers need to be connected to DTR, RX, TX, 5V respectfully. Finally connect the remaining BLACK jumper to GND.
You are ready to fire this up. To do so, you first need to connect the USB cable to your computer. If you are using Win 7, as I am, you will notice that the drivers will download and install the plug and play device automatically for you so you do not need to mess with that. Now the real challenge is if you are using different kinds of Windows or other platforms. However I trust that you know your stuff, so here’s the link where you can find the drivers for the FTDI BASIC 5V programmer:
Now that you have downloaded and installed the drivers, you are ready to test this (and I am sure you are so eager to do so). Once you have connected the board to your PC open the Arduino C console.
The first thing that you need to do is define how you will use your hardware setup. I find that for this chip, the best way to define the programmer is an mkII, because that is how this works, it acts exactly like an mkII programmer and it should be defined as such. In order to do that, you need to go to Tools>Programmer and from that dropdown, choose AVRISP mkII. DONE
Before you start coding and testing, what you need to do is DEFINE what kind of BOARD you are using. And just to make things easier for you; and here is an ego booster for you as well:
CONGRATULATIONS!!!! YOU JUST MADE YOUR FIRST UNO!!!!
So to define that, go to Tools -> Board and select the Arduino UNO!
Important note: TOP RIGHT of the IC…. THIS IS ARDUINO PIN 9!!!!
So just to make things a little more challenging for you, do you think that you can experiment with this board and find out where the other pins are?
I will not go into testing this board, I will leave you to it, however I will give you some really good tips on how to do this, which is also an overview of my next tutorial.... SERVOS!!!!
So you want to test this board SOOOOOO much.... here’s what you should do:
- DOUBLE CHECK THAT YOU DID EVERYTHING AS MENTIONED, AND AS SHOWN.
- TRIPLE CHECK THAT YOU DID EVERYTHING AS MENTIONED, AND AS SHOWN.
- Get your servo – there are 3 wires on the servo.... a BLACK, RED and possibly WHITE or YELLOW.... doesn’t really matter. The thing is, BLACK is GND, RED is 5V and the other one whatever colour it is, is SIGNAL!!!!
- Connect GND to GND HORIZONTAL RAIL on the BB
- Connect RED to RED Horizontal RAIL on the BB
- Now connect the SIGNAL to PIN 9 of the board you just made
- In the Arduino programming console, go to FILE>EXAMPLES>SERVO>SWEEP
- Once you have the code in front of you, hit CTRL+U or upload to the board.
You got a servo turning 180deg to -180deg
Do not pay too much attention how this works for now I will be back with a very interesting tutorial on multi servo control very very soon.
I have to admit that I really am having fun playing around with this particular 2-part kit from www.jayconsystems.com. I have also been informed that the video accompanying this tutorial will soon be available to watch with the other videos on the site.
Have fun developing and building your prototypes on this board. Do not be afraid to play along and make mistakes. Some very interesting topics that I will cover are coming up pretty soon, so make yourself familiar with what we have so far and make sure you return strong for what is to come.
This is Mike and this is the end of tutorial 2 on FTDI and the setup of the Arduino Breadboard Kit. Hope that you have as much fun as I did composing this. If there are any questions, please feel free to contact me at, firstname.lastname@example.org.