Professional Documents
Culture Documents
by shubham_bhatt
This is an open-source project which aims to inspire young students in the eld of space and technology by simulating
a small-scale moon mission. This is a multi-disciplinary project we don't just rely on software to do all the work. We have
a physical model of lander which has various sensors like gyro, accelerometer, camera, and wi . Lander can transmit data
and video feed over wi . On the other hand, we have our mission control center which is a program that receives the
data sent from the lander just like a real moon mission. The Control center lters this data and applies some maths(High
school level) to draw graphs and generate the rotation angles for the 3D model which represents the real state of the
physical model. This project was designed for beginners and is user-friendly.
This project is not just about coding. It combines cad modeling, maths, and UI design skills. This project is better if done
with a small team so each member can focus on di erent aspects of the project. Someone might be good with design so
they can work on the look of the control center or if someone ikes maths they can change tweak how the values for
graphs are processed and give out better reading.
I put some external links along with this tutorial for a better understanding of the concepts. Please go through those they
cover almost everything you are going to need to make this project. If this is your rst time it might take a week to
complete this project.
Supplies:
1. ESP32-CAM
2. MPU-6050
3. 9-7 volt battery
4. FTDI Programming cable
5. Ubec(9v to 5V Dc converter)
6. Glue gun
7. 2mm-screw
8. 3D printed parts
The design of the model is based on Vikram Lander by Indian Space Research Organisation. The spacecraft was launched
on its mission to the Moon on 22 July 2019 However, the lander crashed when it deviated from its intended trajectory
while attempting to land on 6 September 2019. I have given up a few details for easy 3Dprinting.
Lander model is 3D printed. You will need a glue gun to stick the legs. Using screws for everything was making the model
complicated and increased the 3D printing time so it's easier this way. All les can be downloaded from grabcad.
Grabcad has a neat feature to let you see and explode the full 3d model on the browser itself. Please use it if you get
confused about how to assemble the lander.
Download cad les from here
Note:-
If you do not have access to 3D printer no problem you can use a plastic coca-cola botel cut it in the middle and paint
from outside. Electronics don't take up that much space. Just make sure you stick the sensor rmly otherwise it will have
false readings. Cardboard is also a good alternative.
MPU6050 sensor module is a complete 6-axis Motion Tracking Device. It combines 3-axis Gyroscope, 3-axis
Accelerometer, and Digital Motion Processor all in a small package. it has the additional feature of an on-chip
temperature sensor. It has an I2C bus interface to communicate with the microcontrollers.
So this one small sensor takes care of everything we don't need any other sensor.
We also have an OLED screen to display information like IP address and connection status. When you power up the
lander you will see various messages displayed on it as it checks for wi connection and MPU6050. If everything is ok you
will see the nal screen as shown above. It will show an error message if anything is wrong. Think of it as a console. You
can display any image on it.
Here are a few tutorials to help you get familiar with it.
Arduino o cial
Youtube
Before compiling and uploading the program we need to install the libraries for both Arduino and Processing IDE.
Most of them can be found by simply searching on the library manager. Here are some links to help you install
everything.
Arduino
https://www.arduino.cc/en/Guide/Libraries?setlang=en
https://www.digikey.com/en/maker/blogs/2018/how-to-install-arduino-libraries
Processing
Video
Add external libraries
Wiring is very simple. Both MPU6050 and Oled screen use an I2C bus and have to be connected to the same pins. You will
ESP32-CAM works like an Arduino but it's a little tricky to program because it does not have a USB port onboard so we
will have to use a programming cable. ESP32-CAM is also not listed on the default board list on Arduino software so we
will have to add it there. So please follow the link below on how to do all this.
Install ESP32 boards on Arduino IDE
Upload code on ESP32-CAM
This part of the processing sketch receives the data as a single line then separate individual value into an array by using
commas present in the line
data = subset(data, 0, data.length);
String message = new String( data );
String[] list = split(message, ',');
Angles are received in degrees and need to be converted to radians before applying rotation to the 3D model.
//convert angles to radians
rotateX(-Euler[2]*3.14/180);
rotateZ(Euler[0]*3.14/180+calib*3.14/180);
rotateY(Euler[1]*3.14/180);
Lander also acts as a Hotspot. The IP address of the lander is displayed on the Oled screen. You can use this IP address to
get a live video stream on any web browser. There are two ways to connect either you connect your PC to the lander
hotspot or connect both of them to the same external wi network.
WiFi.softAP("ESP32", "12345678");// Lander hotspot SSID and password
This is the most important line as it de nes how the data is sent over the network. Data is sent as a single line separated
by commas. Processing sketch then reads this line and separates each value with the help of a comma. These values are
then stored in an array. To add anything extra you just add the variables below and then increase the array size on the
processing sketch.
udp.printf("%f,%f,%f,%f,%f,%f,%f",AccX,AccY,AccZ,temperature,yaw,roll,pitch);// Sends the data over wifi
Make sure everything is connected to the same network and you have entered all the IP addresses and port numbers
correctly. I normally make a hotspot on my android phone and connect everything to it makes getting the IP address
easier.
If you don't know how to nd an IP address please use the following links
Windows PC
Please make sure all wires to sensors are connected properly otherwise it gives annoying errors even if everything seems
to be connected properly.
Basic working
1. ESP32 reads data from MPU6050
2. Packs it in one line separated by commas and sends it over the network.
3. The processing sketch or control center reads this line then separates this data into an array.
4. It uses commas to separate each reading.
5. This new array is used to draw the graphs.
6. Rotation angles received are used to rotate the 3D lander model.
Please feel free to ask questions in a comment. There are multiple things happenings at the same time so I am sure you
will run into some annoying situations. Please be patient good things take time.
This is not the end of this project I aim to build a small-scale lunar mission with rover and lander in the future all desktop
size. This is just the start there is still a lot more that can be done with this project.
The live video stream can be accessed by a python program. You can do all types of computer vision stu like mapping
an area object detection e.t.c. ESP32 also has SD card support so you can save data into excel sheets, save video and
images onboard the lander itself. Due to time constraints, I have kept the tutorial short but in the next version, I will
implement all these ideas and more.
Enjoy your tiny lunar mission :)