Grab a fresh piece of your grandma's best baked bread.
I keed, I keed. This is what you really need.
Breadboarding is what we do to test out concepts or make sure code and the various components are working.
It is quick, requires almost no work and allows you to play around with different layouts and designs.
They can be long or short. I recommend getting 2 of the longs ones. This will give you more freedom and space to work and even leave one project all hooked up on one end while you work on a separate project on the other. Go long, trust me. The more the merrier. They are cheap anyway!
When breadboarding you must know that the individual holes are actually connected because there are metal rails underneath them. The rails in the middle of the board run horizontally while the rails on the sides run vertically. This will make sense once you start hooking things up with wires.
It doesn’t matter if you connect positive to the red rail or negative to the red rail. The rail doesn’t know and doesn’t care. The colors and symbols are just to help you out, for reference!
The letters or number along the sides and top help to make a grid for you to reference as well.
I almost never use it so don’t worry about it.
Notice there is a separation in the middle, this is important to know.
We need to put our AVR chip so that one side of its pins are inserted on the left side and the other side of pins to the right.
If this confuses you, just imagine if there were no separation on the middle.
The pins on each side of the chip would always be connected to the same rail…
Nothing would work, the chip may fry itself, your family could even disown you!
Although I’m not sure about that last one.
In order to better understand this, look at the back of the breadboard. See the rails?
Vertical rails are one solid piece from top to bottom so we can tap into our voltage and ground easily anywhere on the breadboard.
The horizontal rails are split in the middle because if they were each one solid piece they would connect both sides of the chips and would short out the connections.
We wouldn't be able to get anything done.
We would also have half as many options to place components. So, we need that separation in the middle.
Also, notice how when I peeled back this foam tape on the bottom one of the metal horizontal rails stuck to it and came out.
Here is a side view of that rail. This is what your pins and wires touch.
Kind of looks like a metallic comb or hair clip right?
I told you, this stuff is incredibly simple at its core.
The electricity from our power source and the manipulation of that electricity back out through the microcontroller pins is what is backing the entire modern world around you.
Take a minute to reflect on that. I'll still be here...
This is why you will be excited, you are gaining valuable insight into the magic that makes wireless VR headsets and haptic glove controllers possible. These tools can be used for fun or to save lives. This power can be yours if you take the time to practice the fundamental concepts.
From now on you will need the pinout diagram for your chosen chip.
Here is the 328p pinout we looked at in the microcontroller lesson.
If you need to brush up on that lesson, go ahead and come back. No shame in reviewing!
The best way to learn is in doing.
We are now in the doing phase of this course.
Let’s connect a few of our components to see how this breadboard works.
First we connect a wire from your power source to the red and blue rails. Let’s use red for positive voltage and black for negative.
It will also be helpful to use those same colors for our wires so we don’t get confused!
Ok! Looking good!
Now, we don’t need the AVR chip for any of this.
Which side of an LED is positive?
That’s right, the longer leg because we can imagine cutting it and making a plus sign with the piece we cut off.
Just hook up an LED to two rows of the middle section on the breadboard. It should look like this.
Now, let’s put a resistor on the negative, shorter leg.
We don’t need another row for this. We can just hook it up on the same row like in this picture.
If we didn’t use the breadboard we would just solder it onto the LED negative pin and then solder the black wire from the power source onto the other end of that same resistor.
Don’t get confused. Remember, we are just testing things out instead of having to solder them permanently to see if they work or not.
Here I spun the board around 180 degrees.
We can hook up the resistor like this but its so cramped so people usually move the resistor so it touches another row.
What value is this resistor? (Answer will follow soon.)
Ok, now let’s bridge the connection between the positive rail and the negative rails appropriately.
You now have an LED shining, if not, check your wiring, try replacing the resistor or even the LED, your battery pack may also have died so any one of these parts could be swapped out to find where it went wrong.
See that bright shining LED? That’s you. You are shining bright…"shine on you crazy diamond"…
If you don't have a resistor what will happen?
The LED could burn out. Go ahead, try it. I did and mine dimmed until it fizzled out. If your LED is the tiny kind it will barely glow then fizzle in a second so keep that in mind.
Try to draw the schematic now. Just try, it can be wrong it’s ok, you won’t catch any disease or anything.
Alright so we used a power source, LED, and resistor!
You could solder these connections to make it permanent
Just make sure to disconnect or pop out your batteries.
DO NOT SOLDER ANYTHING DIRECTLY TO A USB PROGRAMMER…that is just STUPID, although you may solder to any wires that are able to disconnect from the usb programmer.
Now that we have a closer look at this resistor, we can answer the pop quiz question from above.
Notice there is a gold band. This cannot be the beginning value so the resistor is "backwards" although it doesn't matter.
It only matters when looking at its value.
So, we start with the brown band which = 1
The black bands are always 0.
The red band = 2.
The gold = +/- 5% range of accuracy.
So, the value of this resistor is 1 + 0 + 00 = 1,000Ω +/- 5% or 1kΩ +/- 5%
Ok, now its time to use a pushbutton!
Take that LED set up and add a pushbutton between it like this.
All we are doing is adding a disconnected or connected bridge between the positive and negative connection. When we push this button it will either connect or disconnect that connection. Different push buttons exist. Can you guess which kind I have below? Hook yours up and see what you have!
That's right mine is the normally closed, normally connected type. If I push it down it disconnects the connection and current no longer flows through.
Take a second to trace your finger along the current flow path from the battery source through the wires, button and LED back to the power source.
Overthinking is your enemy in robotics and electronics, it can really slow you down.
Nice! Now, test out your push button, LED, resistor setup!
Look how awesome you think you are now!
The good news is, you are right!
If you REALLY want to look cool to your friends, try drawing this schematic up! Remember, you should be making mistakes, that’s how you get better.
What else can we play with? What would go well with this setup?
How about a potentiometer!
Now things are getting slightly complicated but take a breath!
We need voltage running through our potentiometer so hook the red voltage wire, VCC, to one end and the black wire, GND to the other end.
Remember, the LED needs GND and VCC.
But, we want to vary that VCC.
So, we connect the GND to the smaller end of the LED like usual but the longer, positive end will connect to the variable output pin in the middle of the potentiometer.
It should look like this.
That way, we can set the brightness of the LED.
Play around with this! If it doesn't work check your wiring and try swapping the positive and negative wires on the potentiometer. Also, make sure you have fresh batteries.
When we twist the knob it will vary the brightness of the LED.
Now try and draw this schematic. If you do, grab a cookie. You deserve it!
Take a break!
The secret to making things fast in this game is having a fresh mind.
Due to the complicated nature of it all, it is easy to quickly become frustrated, trust me, I know from experience.
The great news is most of these components won’t break if you throw them at a wall, multiple times even!
So go ahead, print out that bullseye and tape it to your least favorite wall! Have at it!
Ok, now for the most advanced and complicated breadboard experiment.
You will need a small, simple DC motor, a diode, a small capacitor, a transistor and some wires.
Put some tape on the DC motor’s shaft like a flag or attach a wheel so you can see when it moves.
You may need to solder some wires to the metal contacts on the DC motor if it doesn’t already have wires on it. If so, see the Soldering tutorial.
This setup is going to be intermediate electronics so don't feel bad if you don't get it at first because it IS complicated.
I just want to expose you to it and let it mature in the back of your mind over time.
Try to remember what each piece does and why we are including each here.
If not, go back and review, it’s free and painless.
Here is what this setup looks like on our bread board.
This looks very complicated and it is and isn’t.
Notice the chip isn't even connected, you don't need it at all, I just left it on there.
The white line could be connected to any of the pins to turn it on and any pin outputting PWM to rev up the motor or rev it down, etc.
You can do so many things once hooked up to a pin outputting voltage which I will show you soon!
We need to introduce a little voltage and current to the gate pin of our transistor to let the current flow, remember?
Touch the white wire with your finger and connect it for a second or two. The motor should rev up!
If not, triple check your connections. This took me forever to get right when I was finally in a relaxed state of mind.
I was preventing myself from letting it work correctly.
I had to take the wiring apart and swap out the motor for a different one a few times.
But each time I calmed down, thought about what I did wrong and tried it again.
Then, it finally worked.
I don’t know how else to explain it.
That's why I always say repetition and consistency is crucial to your success.
It's the same as calming down before you bench press or squat. If you are too tense, nervous or frustrated something is likely to snap...
Also, make sure you are using a low amp(current) pulling hobby or toy motor for this.
If not, the transistor will heat up significantly.
Try and draw out the schematic for this. Don't stress if you get it wrong, this is pretty complicated and a great challenge to get your brain exercising.
Have fun with it and remember to laugh at yourself because it's a miracle any of this stuff works at all.
Get my favorite books on programming AVR chips I use.
Equip yourself with the most dependable, no hassle, quality usb programmer I use daily.
I started with something very similar.
This lesson should have increased your confidence power level to about 5000.
Keep playing around with the components and drawing schematics.
Practice makes good enough.
In the next lesson you will learn how to solder the easy and correct way, saving you time, money, and headache.
Even if you don't have a respectable soldering iron you need to learn the basics.
You COULD leave everything on this breadboard and attach it to your project with power source and all.
However, we both know you want to become a legend. Creating sleek, discrete, encasable, wearable technology, right?
See you in the next lesson!