-
11Step 11
1A: Soldering (Rev 1A-ST -- Solder all components)
Overview
If you have a Barnabas Noggin version Rev 1A-ST, you need to solder all your components
Things that you'll need:
- Soldering Iron
- Solder
- Flux (not needed if you are using rosin core solder)
Tutorial Video
-
12Step 12
1: Getting Started with Programming
Overview
Robots, just like us, need to know what to do! We have put our robot's body as well as heart system together. We even connected our brain. We need to program our robot, but before we do that, we need to connect it to your computer.
What you'll need:
- 1 x Assembled Barnabas-Bot (Body and wires)
- 1 x Barnabas Noggin - Arduino Compatible Board
- 1 x Computer (PC or Mac)
- 1 x USB Cable
Install Arduino IDE
WINDOWS USERS
We will be using the open-source software, Arduino IDE. Install Windows-based Arduino IDE.
MAC USERS
We will be using the open-source software, Arduino IDE. Install MAC-based Arduino IDE.
Install ArduBlock and the CH340 Driver
WINDOWS USERS
EASY INSTALL
We have created a batch file package to streamline this process. Follow the directions:
- Unzip the downloaded package.
- Move all the contents of the zip file inside your "Documents" folder. The files are:
- "CH341SER"
- ArduBlock_CH340_Install_WIN_1.3.bat
- ardublock-all-201610.jar
- README.txt
- Double click on "ArduBlock_CH340_Install_WIN_1.3.bat"
- When the driver installer pops up, click "Yes"
- Once it finishes, you are done!
- Note: If you are using Arduino version 1.6.12 or later, you will need to use this .jar file.
- Video Instructions
ADVANCED INSTALL
- ArduBlock & Hardware Driver.
- Install the CH341 USB Driver. You will need this to connect an Arduino board that uses a CH341 chip.
- Download the CH341 driver software.
- Once downloaded, windows users should open the "CH341SER_WIN" folder. Mac users should open the "CH341SER_MAC" folder.
- Go to CH341SER
- Install the CH341 USB Driver. You will need this to connect an Arduino board that uses a CH341 chip.
- Run "SETUP.EXE"
- Click on "INSTALL"
- Install ArduBlock.
- Download Ardublock .jar file.
- Note: If you are using Arduino version 1.6.12 or later, you will need to use this .jar file.
- Create the following folder inside your "Documents" folder "\Arduino\tools\ArduBlockTool\tool"
- Place .jar file inside this new folder
- Download Ardublock .jar file.
- Video Instructions
MAC USERS
- ArduBlock & Hardware Driver.
- Install the CH341 USB Driver. You will need this to connect an Arduino board that uses a CH341 chip.
- Download the CH341 Mac driver software.
- Open the installer and follow the instruction
- Install the CH341 USB Driver. You will need this to connect an Arduino board that uses a CH341 chip.
- At the end of the installation, make sure to restart your computer.
- Install ArduBlock.
- Download Ardublock .jar file.
- Note: If you are using Arduino version 1.6.12 or later, you will need to use this .jar file.
- Create the following folder inside your "Documents" folder "\Arduino\tools\ArduBlockTool\tool"
- Place .jar file inside this new folder
- Download Ardublock .jar file.
Identifying your Barnabas Noggin Type
Our kits ship with different types of Barnabas Noggins (the brain of your robot) depending on when you purchased your kit. See below to identify your type. This is important because the way you program it will be a little different.
Rev 1X (Arduino Clone version)
This Arduino-Uno compatible board can be purchased from us as well as third party vendors (Amazon, Ebay, etc). It is a good choice for anyone building their own Barnabas-bot kit. You will always need a breadboard to get your robot to work when using this version.
Rev 1A (Fully soldered version)
This Arduino-Uno compatible board was designed specifically for the Barnabas-bot kit. It has special modifications made so that Barnabas-Bot's buzzer, light and servo motors are built into the board. This fully soldered version requires no soldering or breadboarding.
Rev 1A-S (DIY solder version)
This Arduino-Uno compatible board was designed specifically for the Barnabas-bot kit. It has special modifications made so that Barnabas-Bot's buzzer, light and servo motors are built into the board. This DIY soldering version is made for the adventurous maker! It requires soldering of 4 components: 2 x resistors, 1 x buzzer, 1 x LED.
Opening the Arduino Software
- Using the USB cable, plug in the Arduino to your computer. Make sure to unplug any battery that may be connected to your Arduino. At this point the Arduino's on-board LEDs should turn on.
- Open the Arduino IDE software by click on the Arduino icon
Selecting the right Board
You'll need to make some settings in your Arduino software to make sure that your computer is able to talk to your Barnabas Noggin.
- If you have a Rev 1A or Rev 1AS board do the following: (If you have a Rev 1X board, move to the next step)
- In your toolbar, go to Tools->Board and select: "Arduino Duemilanove or Diecimila"
- In your toolbar, go to Tools->Processor and select: "ATmega328"
Selecting the COM port
The COM port is used by your computer to talk to your Barnabas Noggin. It is kind of like a phone number to your Barnabas-Bot. We need to make sure that we have the right number, or we won't be able to talk to him! These directions will show you how to set the right COM port. Make sure have selected the right board (the step before this) before you start this.
- Go to Tools->Port, and click on the the first item that starts with the 3 letter, "COM". In the picture, it says "COM21". Yours will have "COM", but might have a different number. That is OK.
- NOTE: For MAC users, the port will show up as "/dev/cu.wchusbserialfd..."
- Upload to test. Click on the "Upload" button, and wait. There will be a green progress bar at the bottom of your page.
- It will take a few minutes, but you should then see the "Done Uploading" message on the bottom right of your screen.
- If you get an error:
- Double check that you chose the right board (see previous step)
- If there are multiple "COM" options under Port, try selecting the other "COM" options and try clicking on "Upload" again
- Note: for MAC users, look for another "/dev/cu.wchusbserialfd..."
- Once you see a "Done Uploading", you're done! Congratulations, you are now able to write a program to your Arduino!
Writing Your First ArduBlock Program
ArduBlock is a block-based programming language that is great for those who are new to programming.
- Open ArduBlock by going to TOOLS->ARDUBLOCK.
- Once ArduBlock opens, you should see the following screen
- Go to [CONTROL], and drag in a [LOOP-DO] block. Click on [SAVE], type in your name, and click [SAVE] again. Note that every program needs a [LOOP-DO].
- Now click [UPLOAD], type in your name, and click [SAVE]. Your program will now upload code into your robot.
- Congratulations, you just wrote your first program! In the future, you will want to always click [Save], and then [Upload] when loading your program to your Barnabas-Bot.
-
13Step 13
2: ArduBlock Basics
Overview
Now that you know how to connect your Barnabas-Bot to your computer, we will go over some basics so that you can write your own programs.
Basic Commands
LOOP do
Where is it? Go to CONTROL-> LOOP-DO
Every ArduBlock program needs a LOOP-DO. You put command blocks inside of the LOOP-DO. Each command block is executed in order until it reaches the bottom of the loop. Once is reaches the bottom of the loop, the program will jump back to the beginning of the loop and continue to cycle forever.
You can only have one LOOP-DO per program.
DELAY milliseconds
Where is it? Go to UTILITIES -> DELAY MILLISECONDS
This tells your program to wait there for a set amount of time. It is useful when you want to turn things on and off with different timing patterns. The unit is milliseconds. 1000 milliseconds = 1 second.
How to delete blocks
- L-CLICK on the block and drag it all the way to the left column.
Errors while uploading
- "Socket Null": There is a block or parameter of a block that is not fully snapped in. Re-check your block and parameter connections, and try again.
- "Multiple Loop Block Found": You have multiple LOOP-DO blocks in your program. Every Ardublock program can only have one LOOP-DO. Find the extra one, delete it, and try again.
-
14Step 14
3: Making Barnabas-Bot Blink
OVERVIEW
Here we will learn how to turn on Barnabas-Bot's light on and off.
SET DIGITAL PIN
Where is it? Go to PINS -> SET DIGITAL PIN
Use this command block to control the LED. You'll need to make sure you set the pin number (#) correctly. You'll notice on the wiring diagram that pin 7 is connected directly to the LED. Therefore, you will need to set the pin # to 7.
The HIGH/LOW value will turn your light on and off. See below for a sample program that will:
- Turn your LED on
- Wait 1 second
- Turn your LED off
- Wait 1 second
- Repeat
SAMPLE CODE
CHALLENGE
- How fast can you make his light blink?
-
15Step 15
4: Making Barnabas-Bot Play Music
OVERVIEW
Here we will learn how to make Barnabas-Bot play music using his buzzer.
TONE milliseconds
You will need to use the tone block to turn on your buzzer.
Where is it? Go to PINS -> TONE
Use this command block to have Barnabas-Bot play a tone. You'll need to make sure you set the pin number (#) correctly. You'll notice on the wiring diagram that pin 6 is connected directly to the buzzer. Therefore, you will need to set the pin # to 6.
The frequency value determines the note that you want to play. See below for a table of frequencies. The left column are low notes, and the right column are high notes.
See below for a sample program that will play the high C.
noTone
The noTone command turns your buzzer off. You will need to use this if you want a moment of silence, or rest in your music.
Where is it? Go to PINS -> NOTONE
See below for a sample program that will play the high C,
- Play C
- Wait 1 second
- Turn your buzzer off
- Wait 1 second
- Repeat
SAMPLE CODE
-
16Step 16
5: Making Barnabas-Bot Dance
OVERVIEW
Here we will learn how to make Barnabas-Bot dance to his music!
SERVO
You will need to use the servo block to move your arm and head motors. Where is it? Go to PINS -> SERVO
You'll need to make sure you set the pin number (#) correctly. The pin number refers to the orange wire of each servo motor. You'll notice on the wiring diagram that pin 9 is connected directly to the head motor. Therefore, you will need to set the pin # to 9 to move the head. You will need to use pin 10 and 11 to move the arms.
See below for a program that moves from 1 degree and 180 degrees and back and forth.
NOTES:
- If your servo motor movement is not stable, we recommend plugging in the 9V battery using the 9V battery holder. This will give your robot more power to move its motors!
SAMPLE CODE
CHALLENGE
- Make your robot do this!
- Can you make your robot wave and blink his LED at the same time?
- Can you make your robot wave and also play a song at the same time?
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.