Raspberry Pi Imager: Used to flash the Raspberry OS onto a memory card, which is then used to connect the Raspberry Pi to a laptop/desktop remotely. Download Link: Raspberry Pi Imager
MobaXterm: Used to push code from the laptop/device to the Raspberry Pi remotely. Download Link: MobaXterm Installer Edition
Python: Required for writing code. Download Link: Python
VS Code: Integrated development environment used to write code, which is then transferred via MobaXterm to the Raspberry Pi. Download Link: VS Code
To understand how Raspberry Pi works, let's build a simple project to control a servo motor with Raspberry Pi as demo shown below :
Step 1: Insert the SD Card into the Pendrive and connect it to the CPU.
Step 2: Open Raspberry Pi Imager and follow these steps:
Press Shift
+ Ctrl
+ X
on your keyboard and perform the following:
Step 3: Open VS Code or any Code Editor, create a file with the extension .py
, save the file, and close the Editor.
Step 4: Open the Settings of your Laptop, go to Settings > Network & Internet > Mobile Hotspot, turn on the Mobile Hotspot of Laptop, and set the Properties to the username and password you provided in Raspberry Pi Imager. Copy the IP Address displayed in the connected devices section. This step ensures that your laptop and Raspberry Pi are connected to the same wifi.
Step 5: Now open MobaXterm, click on Session
in the top right corner, then click on SSH
. Paste the IP Address copied earlier into the Remote host input, and provide the username you set in Raspberry Pi Imager. Click on "ok" and "accept".
Step 6: Your laptop and the Raspberry Pi are now connected. To control the Raspberry Pi with your laptop, push the code from your laptop to the Raspberry Pi. As they are connected to the same internet, you don't need any manual connection. Simply transfer the code via the internet to make the Raspberry Pi work.
python3 filename.py
Ctrl
+ C
in the terminal. This action will terminate the code execution and stop the Raspberry Pi.