Lessons
All Projects
Lesson RC Car with Appshed
Overview
This project is creating a remote control car with AppShed. This is projects requires some experience with programming and circuit design. This is a 1-6 lesson project depending on if you have access to the hardware and duration of your lessons. The complete project can be completed in 3 x 1 hour lessons and extended to 6 if you breakdown the learning into in depth points. We used this project in 2 x 2hour workshop for 14-15 year olds. We had pre-soldered jumper cables to the motors as most IT labs don’t allow soldering in the classroom.
The App can be built in an hour should wish to be this for the #HourOfCode
Theories covered in this project. Motors, Circuits, LEDS, Power & Programming: Loops, data types, data, code libraries, APIs, physical computing, data transmission, latency.
Kit List
Internet Access
Smartphone (Android to link to IOIO board, Other phone for remote access)
Appshed Account www.appshed.com
For the RC car
IOIO OTG
2 x Motors & Wheels
Motor driver block
9V power supply
Jumper cables (male to male)
Bluetooth dongle & usb cable
Lesson breakdown but take as much time as required/available in your classroom.
- Introduction to the Project. Build Remote Access App using modules
- JavaScript Drive Engine and coding (optional)
- IoT and circuit design. Building the car
- IoT – what is Internet of things – designing different board layouts and car configurations (optional)
- Redesign their controller app for better user experience. Add additional functionality to the car (optional)
- Showcase lesson – Challenges. Parking into a specific space, obstacle avoidance
Starting the project
[insert video]
The video is of our first model built using recycled material.
NOTE: This project can be completed without hardware by remote controlling either Appshed’s car, based in South Africa or our car, based in the UK) email to organise a time to use the car.
Lesson 1 Introduction to the Project. Build Remote Access App using modules
Starter: Play the above video or the one below from APPLE keynote 2013 ANKI.
https://www.youtube.com/watch?v=QnsR-kZUx6o
Questions:
1.What is a remote controlled vehicle?
2.How do they work? Think about what you can buy from a toy shop or any devices that you use and control in school.
3.What Remote Control device could help society? Older, younger generation, in school environments, health, leisure…. (this is a good group discuss and presentation activity)
4.How do you think the Appshed RC Car controller app works? The car is based in South Africa
5.What other objects/things are remote controlled over large distances?
Task 1 Design your App
This can be done on paper by hand drawing 5 rectangles to represent the 5 tabs. Alternatively, there free online tools for wire framing such as Moqups.com or Wireframe.cc to name but two. This task can be removed if you have a time constraint or reduced to a time activity- quick design.
Quick design: 7mins
Using the App design layout PDF. Students have 7 mins to decide the order of their tabs and sketch what each tab does. This can be words and or pictures.
Remember when designing your app you have a maximum of 5 tabs. The control of the remote vehicle is based on the movement of the phone itself or trigger by button presses within each tab of the app. What order do you think they should be in?
Required Tabs
INFO: Explains what your app does and how to use it
STEERING: To activate the steering API call
GEAR: TO activate the gear/ speed API call that detects the angle and speed of motion of the phone.
DATA: Displays the data the phone is generating and transmitting via the API calls and event handling.
DEMO: this tab has a demo mode plus individual commands to control the car
Task 2 Building your App
STEP 1 Login
Login into your account at appshed.com. If you don’t have an account you can open a free account very quickly at the site.
Once you have logged there are 2 options to create apps. One is App builder and the other is IoT. We will be using app builder for the first part of the project.
If you are new to appshed check out these resources for an overview of the platform
http://appshed.com/help/resources/item/appshed-basics
STEP 2 New App
Create new project and name it appropriately. The details added here are what would be shown if the app was added to any of the “app stores”.
STEP 3 JavaScript Engine
Go to the settings tab > Advanced and scrolled down to the bottom of the page to custom JavaScript and paste the ( JavaScript drive engine) code inside the box. Code available here
The JavaScript engine has been written in a way that you can use various IOIO board configurations. It uses variable names and not pin numbers or names. As long as you have selected the correct pin output and wired it effectively it does not need to be exactly the same as this project.
Using PINS that are Digital and PWM will allow for further modification to the actual car to improve the drive function without having to re map the IOIO board pins. See Lesson 3 for more details.
For Additional JavaScript Learning see lesson 2 (optional lesson)
STEP 4 Modules
Go to modules “pane” and type “rc car” into the search box and press enter
This is allow you add the modules for each tab. Click the USE button and confirm with the YES green button for each module tab. Remember this is being developed online and sometimes the internet connection is greatly if you get an “Oops” just refresh the page.
[screen shots]
Change some of the colours or images to make it your own.
Useful links for images and icons
Optional Lesson 2: JavaScript Drive Engine and coding (optional)
Looking at the JavaScript Engine you can use this as a learning opportunity for your class. Either print out the code or display it on screen.
- Ask the students to highlight all the functions in the code. See example here
- Add comments to the code to explain (what they think) each functions purpose and how it interacts with the board and phone.
- Challenge. In the app get the students to add functionality or fun to the app using some javascript. example: Play a sound on start engine button press. (This particular challenge can be completed after the initial app has been built and tested). You can set this challenge as this point in the project but can be done afterwards. Depending on your class dynamic and ability, you will be able to judge the best time to set this activity.
[insert links to code example for each above bullet point]
External links for learning JavaScript:
Khan Academy
Code Avengers
w3schools
Lesson 3 IoT and circuit boards
Task 1 Login or select IoT Project
Task 2 Creating your hardware IoT project. Select NEW PROJECT (blue button)
Name your project RC CAR + “your name” This will help others find your specific project in the AppShed Store. Change the Featured image
Task 3 Selecting the PINS which ones to use and why
Questions:
What do each of the acronyms mean: PWM, I/O, ADC and why is it important to select the correct pin. PIN Numbers: 2 pins per motor as we are using digital outputs to control the motors
10 & 11 for ‘right’ motor (connect to Pins a1a & a1b on the driver mini board)
39 & 40 for ‘left’ motor (connected to Pins a1b & b1b) Remember that even though we are using motors they are connected through a driver. This means that they are DIGITAL outputs. Motors have 4 states: Forward, reverse, stop and pause
To open this IoT project in Appshed
The additional connections are headlights and indicator lights using a simple toggle button for the headlights. The indicator lights are link to the steering “current direction” they will activate when the data indicates that the car is turning hard left or hard right.
Select: LED > Pin location> Name the variable – headLights or other appropriate name
DIGITAL OUTPUT (sending signals from the board to the motors)
PIN LOCATION (which pin the LED will be physically attached to)
Variable Name (name the variable to match the item physically – headLights, breakLights using camel-case)
Task 4: Building the Car & Circuit
Remember you can choose different PINs but the IOIO board and Appshed IoT project must match.
This diagram doesn’t include the connections for the LEDs. See here for LED wiring. Note the Power supply. This can be replaced with 6 AA batteries or other similar power supply. If using 9V batteries ensure that both batteries are new and replace at the same time.
Curriculum Mapping:
UK Keystage 3 / 4
understand several key algorithms that reflect computational thinking, such as ones for sorting and searching; use logical reasoning to compare the utility of alternative algorithms for the same problem
use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures such as lists, tables or arrays; design and develop modular programs that use procedures or functions
understand simple Boolean logic [such as AND, OR and NOT] and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers [for example, binary addition, and conversation between binary and decimal
undertake creative projects that involve selecting, using, and combining multiple applications, preferably across a range of devices, to achieve challenging goals, including collecting and analysing data and meeting the needs of known users.
develop their capability, creativity and knowledge in computer science, digital media and information technology.
develop and apply their analytic, problem-solving, design, and computational thinking skills.
USA
Project mapped to commoncore
xxx
AUS/NZ
Digital Technologies knowledge and understanding
6.1 Investigate the main components of common digital systems, their basic functions and interactions
Digital Technologies processes and production skills
6.4 Define problems in terms of data and functional requirements, and identify features similar to previously solved problems
6.9 Manage the creation and communication of ideas and information including online collaborative projects, applying agreed ethical, social and technical protocols
8.10 Create and communicate interactive ideas and information collaboratively (online), taking into account social contexts
8.11 Plan and manage projects, including tasks, time and other resources required, considering safety and sustainability
Design and Technologies knowledge and understanding
6.2 Investigate how forces or electrical energy can control movement, sound or light in a designed product or system
8.3 Analyse how motion, force and energy, are used to manipulate and control electromechanical systems when designing simple, engineered solutions
Design and Technologies processes and production skills
6.8 Apply safe procedures when using a variety of materials, components, tools, equipment and techniques to make designed solutions
8.9 Effectively and safely use a broad range of materials, components, tools, equipment and techniques to make designed solutions
4.9 Plan a sequence of production steps when making designed solutions individually and collaboratively
6.10 Develop project plans that include consideration of resources when making designed solutions individually and collaboratively
8.11 Use project management processes individually and collaboratively to coordinate production of designed solutions