We will start by just learning how to send a code to the arduino to make sure it works. You will also learn to name and save your files to a flash drive.
Open the Arduino software and plug in the Arduino board to your computer's USB. Type in the code below (without the // symbols). Follow instructor directions.
When you are finished, click the check mark in the upper left. Upload your code to the Arduino by clicking the right arrow.
If you ever get an upload "Problem uploading to board" error, click Tools, then Port, and then select Arduino (shown below).
Once you see the onboard light blinking, play with the wait variable and upload changes it to see how it affects the light. After you are done coding the onboard LED, save the file and open a new Arduino IDE code.
Lighting an LED
You just made your first Arduino program! Congratulations. Now we are going to figure out how to light LEDs from the Arduino board so that you can use lights on your robot later. You will need: Wires, a 220 ohm resistor, an LED.
Set up the board like below and see if you can figure out how to get one light on. (MAKE SURE YOU USE THE RESISTOR OR THE LIGHT MAY BREAK)
Once you get one light to work, figure out how to light more LEDs using your board.
It is important to know that LEDs only let current flow through it one way. The LED will only work if you plug the longer end up to positive pins on the board and plug the shorter end up to ground or negative ports on the bards. If your light does not turn on, try to flip your LED. It may just be in backwards.
Now that you have one light working, see if you can get more lights to turn on.
Series and Parallel
If you want wiring to stay together, the breadboard is very useful. Breadboards help you wire electronics together. The side bar holes are all connected and each of the rows left and right side are connected, as shown in the picture below.
Connect up your lights to the breadboard like below. See what changes between each type. Can you figure out how to power all three setups off the same board? Once you get your lights to work in parallel, try to use different colors. What happens when you try to use all different colored lights?
Single LED
Series LEDs
Parallel LEDs
Control with a button
We will now figure out how to control the LED using a button. Materials: LED, 220 Ohm resistor, wires, 10 kOhm (10,000 ohm) resistor, and board. Wire up the board as below. (Make sure to use the 220 Ohm resistor with the LED and the 10 kOhm with the button)
Here we are adding new types of statements to your code. Before we had just the loop, now we add if and else. Every green part of your code needs an open and closing { } to run. The curly brackets are like sandwiches for your statements. Make sure each has them.
Write a code similar to below and upload it to your board to see if it works.
Once you get the one LED code to work, try to figure out how to get more lights to work with buttons if you have time. You basically just have to add an extra line to each part and name new variables for the new lights. Look at the difference between the code above and below to try and figure out the pattern for adding more parts.
Engineering Design Process: Start your robot arm frame!
Your teacher will discuss how engineers plan for a project and you will use this process to plan your robot. You will learn about constraints, requirements, planning, prototyping, testing, and improving!
Plan out a design for your arm and base. Your main building materials will be cardboard, K’nex, or maybe more You will learn about constraints, research different ways to make robot arms, and you will then draw out a plan for your arm. You will build prototypes with any extra time in the day.
Constraints (Ask, Research)
We first have to know our robot arm's constraints (limitations, expectations) before we design it. Circled above are the key engineering constraints important for this camp. Get out some paper and prepare to plan out your robot arm.
Write out each header and we will go through the first 4 steps of the engineering design process to answer each one (Ask, Research, Imagine, Plan). We will then share your plan with a classmate/teacher. Intended Function: What will you want your robot arm to be able to do (wave, shake, pick up and put down, etc) Size and Shape: How big or small can my robot be? Will this shape and size requirement allow it to do the function above? Quality and Reliability: How sturdy will your robot have to be? How long should it last?
Corporate Objectives/Culture: What is the overall class objective for my robot? Will I work in a team? Risk Tolerance: What happens if my robot breaks and how will I take failure? Price Expectation: What supplies am I allowed to use and how many of each type am I allowed to use?
Technology Limitations: Will I be able to learn how to make the robot do my function and do I have the parts? Resource Allocations: Considering supplies given to me, will I want to share or ask others to share some items with me? Scheduling: When is my completed and working robot arm due? What are mini deadlines I can set for parts to be done? Design Tools: What tools are available to help me learn or where could I look things up help to make my robot arm?
Design (Imagine, Plan)
Now that you have researched the constraints above, take out another sheet of paper and do the (Imagine, Plan) part of the engineering design process. Develop and talk with your classmates about solutions to your constraints and draw out a plan for your robot arm.