SunFounder GalaxyRVR User manual

SunFounder GalaxyRVR Kit for Arduino
Release 1.0
www.sunfounder.com
Sep 07, 2023


CONTENTS
1 Assemble Video 3
2 Play Mode 5
2.1 Quick Guide ............................................... 6
2.2 Avoid(E) ................................................. 10
2.3 Follow(F) ................................................. 10
2.4 STT(J) .................................................. 10
3 Course Mode 13
3.1 Lesson 1 Unveiling the Mars Rover ................................... 13
3.2 Lesson 2 Understanding and Making Rocker-Bogie System ....................... 19
3.3 Lesson 3: Entering the World of Arduino and Coding .......................... 22
3.4 Lesson 4: Mastering the TT Motor ................................... 32
3.5 Lesson 5: Unleashing Mars Rover Mobility ............................... 46
3.6 Lesson 6: Exploring the Obstacle Avoidance Module .......................... 50
3.7 Lesson 7: Enhancing Rover Navigation with Ultrasonic Module .................... 59
3.8 Lesson 8 Advanced Obstacle Avoidance and Intelligent Following System ............... 66
3.9 Lesson 9: Lighting the Way with RGB LED Strips ........................... 70
3.10 Lesson 10: Exploring the Mars Rover Visual System - Servo and Tilt Mechanism ........... 75
3.11 Lesson 11: Exploring the Mars Rover Visual System - Camera and Real-time Control ........ 82
3.12 Lesson 12: Driving the Rover with the App ............................... 94
3.13 Lesson 13: Investigating the Mars Rover Energy System ........................ 103
4 FAQ 111
4.1 Q1: Compilation error: SoftPWM.h: No such file or directory ..................... 111
4.2 Q2: avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x6e? ............... 111
4.3 Q3: How can I use the STT mode on my Android device? ....................... 113
4.4 Q4: About the ESP32 CAM Firmware .................................. 115
i

ii

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
Imagine piloting a rover on the desolate terrain of Mars, exploring alien landscapes and confronting the unknown.
Sounds like a dream for NASA engineers, right?
Not anymore.
Welcome to the world of the GalaxyRVR, a Mars Rover kit from SunFounder, designed to bring interplanetary explo-
ration right into your living room.
Built upon the same universal rocker-bogie system employed by NASA’s real Mars rovers, GalaxyRVR is capable of
traversing all kinds of terrains – be it rocky mountains, sandy beaches, or grassy fields. The suspension system ensures
smooth mobility, making the alien world of Mars feel just like home.
Equipped with a high-definition camera module, GalaxyRVR offers a first-person view, providing an immersive piloting
experience as if you’re truly navigating the Red Planet. Its advanced obstacle avoidance module and ultrasonic module
ensure it can dodge obstacles, embodying a spirit of autonomy and resilience.
Delve into the Cosmos: The Courses
•Play Mode: Want a quick start? Play Mode is designed for those who can’t wait to start their Martian jour-
ney. With factory-preloaded code, simply assemble your GalaxyRVR and control it using the convenient app to
explore its multitude of functions.
•Course Mode: Intrigued by the underlying technology? Course Mode is for those who want to delve deeper.
Understand the principles behind the GalaxyRVR’s design, learn to code, and empower your rover with a variety
of exciting features.
This documentation is your guide to exploring the intricacies of GalaxyRVR. It includes detailed assembly instructions,
programming guides, and insights into the working principles of a Mars Rover, all aimed to stimulate your curiosity
and foster creativity.
CONTENTS 1

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
The GalaxyRVR isn’t just a toy, but a gateway to Mars, an educational tool, and a catalyst for limitless imagination.
Start your cosmic journey today with GalaxyRVR, and let your world become an extension of Mars.
2 CONTENTS

CHAPTER
ONE
ASSEMBLE VIDEO
Note:
•If you want to learn while assembling the various components, you can refer to Course Mode. In Course Mode,
each lesson comes with assembly videos, component principles, and related test code, allowing you to learn as
you go. So, you can skip this chapter.
•If you want to quickly assemble and start playing, you can watch the assembly video first. After completing the
assembly, proceed to Play Mode to learn about the app installation and connection. Then, you can use the app
to control the GalaxyRVR.
For the assembly of the GalaxyRVR, we provide printed assembly instructions in the kit. Here is the PDF version of it:
If you are having difficulty understanding the printed assembly instructions, you can instead follow our step-by-step
assembly video.
Note:
•The assembly videos are in a series of 7. You can check out other videos from the playlist in the upper-right
corner, or let it play automatically.
•When inserting the ESP32 CAM into the Camera Adapter, be aware of its orientation. It should align properly
with the ESP32 Adapter.
3

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
4 Chapter 1. Assemble Video

CHAPTER
TWO
PLAY MODE
Are you eager to kick-start your Martian journey right away? Our Play Mode is perfectly tailored for those of you who
just can’t wait to dive in. Equipped with factory-preloaded code, you can jump straight into the action after assembling
your GalaxyRVR. Use the user-friendly SunFounder Controller app to explore its myriad of functions including first-
person driving, switching between obstacle avoidance and follow modes, and even voice control.
But before you set off to explore the Red Planet, let’s make sure you are fully equipped and ready for the adventure.
Below is a Quick Guide to assist you in this exciting journey!
Note:
•If your R3 board has already been uploaded with other code, but you want to continue using Play Mode, you will
need to download the relevant code.
–GalaxyRVR Codes
•Then, open the galaxy-rvr.ino file located in the galaxy-rvr-main\galaxy-rvr directory.
•Move the switch to the right and then click Upload.
5

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
2.1 Quick Guide
1. Let’s start the GalaxyRVR.
•If it’s your first time using the GalaxyRVR or if the battery cable has been unplugged, the GalaxyRVR Shield
will engage its over-discharge protection mechanism. To deactivate this protection, plug in the Type-C cable
for approximately 5 seconds. If the power indicator lights up, the protection status has been released. Check
the battery indicators – if both are off, please continue charging the battery using the Type-C cable.
•To activate the ESP32 CAM, move the mode switch to the Run position, and press the reset button to
reboot the R3 board. You will then observe a cyan light flashing on the bottom strip.
2. Install SunFounder Controller from APP Store(iOS) or Google Play(Android).
3. Connect to the GalaxyRVR Network.
For optimal communication between your mobile device and the Rover, you’ll need to connect them
to the same local area network (LAN) provided by GalaxyRVR.
•Find GalaxyRVR on the list of available networks on your mobile device (tablet or smartphone),
enter the password 12345678, and connect to it.
•The default connection mode is AP mode. After you’ve connected, there might be a prompt
warning that there is no internet access on this network. If so, choose “Stay connected”.
6 Chapter 2. Play Mode

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
4. Set up a controller.
•To create a controller on SunFounder Controller, tap the +icon.
•Preset controllers are available for some products, here we choose GalaxyRVR. Give it a name, or simply
tap Confirm.
2.1. Quick Guide 7

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
•Once inside, the app will automatically search for the GalaxyRVR. After a moment, you will see a prompt
saying “Connected Successfully”.
Note:
–If not connected, please confirm that your Wi-Fi is connected to GalaxyRVR.
–You can also tap the button to connect manually. After a short wait, you should see
GalaxyRVR(IP) appear. Tap on it to establish a connection.
8 Chapter 2. Play Mode

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
•Now, tap the button enables you to view the live video feed from the camera and control the car using
the provided widgets.
5. Let’s now delve into the functions of each widget:
•Servo(D): Controls the tilt mechanism of the Rover’s camera, allowing you to observe a wider range.
•Avoid(E): Switches the Rover into obstacle avoidance mode. The factory-set detection distances for each
obstacle avoidance module may differ. Manual adjustment is required.
•Follow(F): Toggles the Rover into follow mode. The factory-set detection distances for each obstacle avoid-
ance module may differ. Manual adjustment is required.
•Stop(I): Immediately halts all Rover movements.
•STT(J): Press this widget to initiate voice recognition and make the Rover perform corresponding actions.
•HeadLamp(M): To turn the LED on/off on the ESP32 CAM.
•Throttle Widgets on K and Q: The throttle widget in the K area controls the Rover’s left motors, while
the one in the Q area controls the right motors. Coordinating both widgets allows the GalaxyRVR to move
in any direction.
•Left IR(N): Displays the readings from the left obstacle avoidance module.
•Ultrasonic(O): Shows the distance measured by the ultrasonic module.
•Right IR(P): Displays the readings from the right obstacle avoidance module.
2.1. Quick Guide 9

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
2.2 Avoid(E)
Tap the Avoid(E) widget to activate the obstacle avoidance mode.
Before enabling this mode, you may need to adjust the detection ranges of the sensors according to your current envi-
ronment, as the factory settings may not be ideal for all situations.
If the detection range of the two infrared modules is too short, the Mars Rover might bump into obstacles. Conversely, if
the range is too long, the Rover might start swerving too far away from an obstacle, potentially disrupting its navigation.
Here’s how you can fine-tune the settings:
1. Start by adjusting the right obstacle avoidance module. During transportation, collisions may cause the trans-
mitter and receiver on the infrared module to tilt. Therefore, you need to manually straighten them.
2. Place an obstacle about 20 cm directly in front of the right module. The box in which our Rover kit came is
a good choice for this! Now, turn the potentiometer on the module until the indicator light on the module just
lights up. Then, keep moving the obstacle back and forth to check if the indicator light comes on at the desired
distance. If the light doesn’t turn on at the correct distance or if it remains on without going out, you’ll need to
adjust the other potentiometer.
3. Repeat the same process for the other module.
2.3 Follow(F)
When you’re ready to activate follow mode, simply tap the Follow(F) widget. If you haven’t previously adjusted the
detection distance of the obstacle avoidance modules, you will need to follow the steps in Avoid(E) first.
Once in follow mode, the GalaxyRVR will move towards an object in front of it or turn left or right to follow the object’s
movement.
2.4 STT(J)
STT stands for Speech to Text. The SunFounder Controller app integrates with your mobile device’s voice recognition
engine. Hence, when you tap and hold the STT(J) widget on the SunFounder Controller and speak into your mobile
device,
Your device will capture your speech, convert it into text, and send it to the GalaxyRVR. If this text matches the pre-set
commands in your code, the Rover will carry out the corresponding actions.
The following are the commands currently preset in the code. Speak any of the following commands and observe how
the GalaxyRVR responds.
10 Chapter 2. Play Mode

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
•stop: All movements of the rover can be stopped.
•forward: Let the rover move forward.
•backward: Let the rover move backward.
•left: Let the rover turn left.
•right: Let the rover turn right.
Note: The STT (Speech to Text) function requires an internet connection and Google services on Android devices.
However, this doesn’t work with the pre-set AP (Access Point) mode on the GalaxyRVR.
In AP mode, the GalaxyRVR creates a local Wi-Fi network that your mobile device can connect to, but it does not
provide internet access.
To use the STT function on Android, switch the Rover’s code from AP to STA mode as outlined in Q3: How can I use
the STT mode on my Android device?.
Note: iOS devices, using an offline voice recognition engine, work fine in both AP and STA modes.
2.4. STT(J) 11

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
12 Chapter 2. Play Mode

CHAPTER
THREE
COURSE MODE
Welcome to the Course Mode, a structured journey through 13 enlightening lessons. We kick off with a fascinating
glimpse into the history of Mars rovers, setting the stage for our own rover assembly.
From the second lesson, we’ll start getting hands-on. Each lesson spotlights a unique component crucial to our Mars
rover. You’ll not only understand its purpose and significance but also master its assembly and integration into the
rover.
Whether you are a novice eager to dive into the world of Mars rovers or an experienced hobbyist looking to hone your
skills, these lessons are crafted to provide a comprehensive understanding of the mechanics, electronics, and software
that bring our GalaxyRVR to life. By the end of the course, you’ll not only have assembled your very own Mars rover,
but you’ll also possess the knowledge to troubleshoot, modify, and further experiment with your rover.
So, buckle up for an exciting journey into the world of Mars rovers! Dive in and start exploring the red planet from the
comfort of your home.
3.1 Lesson 1 Unveiling the Mars Rover
Welcome to Lesson 1: Understanding the Mars Rover. Today, we dive into the thrilling world of Mars rovers—our
remote explorers on the Red Planet. We will learn about their evolution, their functions, and the technological marvels
that they are. Furthermore, you’ll channel your creativity to design your own rover and hone your presentation skills
by explaining your unique design. Get ready to explore Mars from your classroom!
3.1.1 Learning Objectives
•Gain an understanding of the evolution and purpose of Mars rovers
•Express creativity by designing your own Mars rover
•Enhance presentation skills by sharing and explaining your rover design
3.1.2 Materials
•Mars Rover images and technical specifications for reference
•Documentary video on the history of Mars rovers
•Computer with internet access for research and viewing documentary
•Presentation slides or interactive whiteboard for lesson delivery
•Drawing paper, pencils, and coloring materials for rover design activity
•Worksheets for guided note-taking, reflection, and design planning
13

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
3.1.3 Steps
Step 1: What are Mars Rovers?
Before we dive into Mars rovers, let’s first acquaint ourselves with Mars itself. As we can see from the images and
models, the surface of Mars is marked with craters, mountains, valleys, and dust storms, painting a picture of a landscape
that is both fascinating and challenging.
Can you imagine what it would be like to navigate through such a rugged terrain? Now, suppose you have the task of
designing a rover for Mars.
•What considerations will you keep in mind given the terrain and conditions of Mars?
•What features will you equip it with to ensure it can perform its functions effectively?
•What tasks do you envision your Mars rover would need to accomplish?
Remember, a Mars rover is a robot designed to explore Mars, study its environment, and send data back to Earth. So
think about aspects such as movement, communication, power supply, scientific research capabilities, and durability
under Mars’ extreme conditions.
Let’s take a moment to brainstorm and share our ideas. It’s interesting to think like engineers and scientists, isn’t it?
14 Chapter 3. Course Mode

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
We’ll delve deeper into actual Mars rover designs and their functions in the following steps, so keep your creative ideas
in mind as we progress.
Step 2: Exploring the History of Mars Rovers
Next, we’ll embark on a journey through time by watching a documentary that details the history of Mars rovers. The
documentary takes us from the first attempt at deploying a rover on Mars, the Soviet Mars 3 rover which unfortunately
didn’t succeed upon landing in 1971, to NASA’s first successful Mars rover, Sojourner, in 1997.
Our journey doesn’t stop there, as we venture further to understand the adventures of the most advanced rovers yet:
Spirit, Opportunity, Curiosity, and Perseverance.
This documentary not only presents a historical context but also provides a comprehensive understanding of the pro-
gressive scientific and engineering milestones that have led to the current Mars exploration era.
Step 3: Summarize the Mars Rovers
After watching the documentary, let’s summarize the different Mars rovers that have been sent on the red planet.
•Sojourner (1997)
Sojourner, the pioneer of Mars rovers, embarked on its journey as a part of the Mars Pathfinder mis-
sion. It made a successful landing in the Ares Vallis region on July 4, 1997. As the first wheeled
vehicle to roam on a planet other than Earth, Sojourner marked a significant milestone in Martian ex-
ploration. Although it was operational on Mars for only 92 Martian days, or sols, it set the groundwork
for future exploratory rovers.
3.1. Lesson 1 Unveiling the Mars Rover 15

SunFounder GalaxyRVR Kit for Arduino, Release 1.0
•Spirit (2004–2010) and Opportunity (2004–2018)
Spirit and Opportunity are twin rovers of NASA’s Mars Exploration Rover (MER) mission. Spirit,
also known as MER-A, operated on Mars from 2004 to 2010.
On the other hand, Opportunity, or MER-B, had a remarkably long run from 2004 to 2018. Together,
they greatly expanded our understanding of the Martian surface and geological history.
•Curiosity (2012–present):
Curiosity, a car-sized Mars rover, was designed to explore the Gale crater on Mars as part of NASA’s
Mars Science Laboratory (MSL) mission. Since its arrival in 2012, Curiosity has made numerous
significant discoveries, including evidence of past liquid water on Mars.
16 Chapter 3. Course Mode
Table of contents
Other SunFounder Computer Hardware manuals