> ## Documentation Index
> Fetch the complete documentation index at: https://stem-docs.intellectualpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Flash the SD card

> Download the Raspberry Pi Imager, write the OS to your SD card, and configure WiFi, SSH, and Raspberry Pi Connect.

## Flash the SD card

<Info>
  **Time**: 9:45 AM to 10:30 AM
</Info>

In this section you will write a complete operating system onto a microSD card so your robot can boot up, connect to WiFi, and be accessible from your laptop. Every click is documented below with a screenshot — follow each step exactly.

### What you need before starting

Make sure you have all three of these items from your kit:

* **MicroSD card** — a small card about the size of your thumbnail
* **SD card reader** — a USB adapter that the microSD card slides into
* **Your laptop** — with internet access to download the Raspberry Pi Imager

<Warning>
  If anything is missing from your kit, let a facilitator or TA know before continuing.
</Warning>

### Remove the SD card from the robot

The Raspberry Pi sits below the Robot HAT board on the robot. The SD card slot is accessible from the **back of the robot** — you do not need to flip anything over.

To remove it:

1. Look at the back of the robot. You will see the edge of the Raspberry Pi board with a small silver card sticking out of the slot.
2. **Push the card gently inward** — you will feel a click — then release. The card springs out slightly so you can pull it free.
3. Set the card aside. You will insert it into your SD card reader in a moment.

<Warning>
  Be gentle when handling the microSD card. Do not bend it or touch the gold contacts on the bottom.
</Warning>

### Download and install Raspberry Pi Imager

<Steps>
  <Step title="Download the Imager">
    Go to [raspberrypi.com/software](https://www.raspberrypi.com/software/) in your browser and click the **Download for macOS** button (or the appropriate button for your operating system).

    The download starts automatically. Wait for it to finish — the file is about 40 MB.
  </Step>

  <Step title="Install the Imager (Mac)">
    Open the downloaded `.dmg` file. A window appears showing the Raspberry Pi Imager icon and an Applications folder. **Drag the Imager icon into the Applications folder.**

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/01-imager-install.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=6c8b052a6fcd0e8d8e860db5fbecf8fa" alt="Drag Raspberry Pi Imager into Applications" width="1024" height="736" data-path="images/day1-setup/01-imager-install.png" />
  </Step>

  <Step title="Open the Imager">
    Open **Finder**, navigate to **Applications**, and double-click **Raspberry Pi Imager**.

    <Tip>
      You can also press `Cmd + Space` to open Spotlight, type **Raspberry Pi Imager**, and press Enter.
    </Tip>
  </Step>

  <Step title="Handle the macOS Gatekeeper warning">
    Since this app was downloaded from the internet, macOS may show a security warning asking if you want to open it. Click **Open** to continue.

    If you do not see the warning, the Imager opens directly — that is fine too.
  </Step>
</Steps>

### Configure the Imager

Now you will tell the Imager exactly what device you have, what operating system to install, and where to write it. Follow each step and confirm your screen matches the screenshot before moving on.

<Steps>
  <Step title="Choose the device">
    In the Imager window, click the **Choose Device** button.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/02-select-device.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=17cc5c32773e1270d7ca4ddc9ec4e3eb" alt="Device selection screen" width="1024" height="768" data-path="images/day1-setup/02-select-device.png" />

    A list of Raspberry Pi models appears. Scroll down and select **Raspberry Pi Zero 2 W**.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/03-select-zero2w.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=1ca8fb291cf38730525f36252c270e3d" alt="Raspberry Pi Zero 2 W selected" width="1024" height="768" data-path="images/day1-setup/03-select-zero2w.png" />
  </Step>

  <Step title="Choose the operating system">
    Click the **Choose OS** button. Select **Raspberry Pi OS (32-bit)** — this is the version based on Debian Trixie with Desktop. It should be the first recommended option in the list.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/04-select-os.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=5dfda0d81b2ad3e4b8958ea7d066828f" alt="Raspberry Pi OS 32-bit highlighted" width="1024" height="768" data-path="images/day1-setup/04-select-os.png" />

    <Warning>
      Do **not** select the 64-bit version or Raspberry Pi OS Lite. The PiCar-X requires the 32-bit Desktop version.
    </Warning>
  </Step>

  <Step title="Choose the storage device">
    Insert your **microSD card** into the **SD card reader**, then plug the reader into a USB port on your laptop.

    Back in the Imager, click **Choose Storage** and select the SD card that appears. It is usually labeled with its storage size (for example, "32 GB").

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/05-select-storage.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=c84c5413ed301ed7a5061a7ab0cdef08" alt="Storage device selected" width="1024" height="768" data-path="images/day1-setup/05-select-storage.png" />

    <Warning>
      Make sure you select the SD card — not your laptop's hard drive. If you are unsure which device is the SD card, ask a TA before continuing.
    </Warning>
  </Step>

  <Step title="Open OS customization">
    Click **Next**. The Imager asks if you want to customize the OS settings. Click **Edit Settings** to open the customization panel.

    This is where you configure your hostname, login credentials, WiFi, and more. The next several steps walk through each setting.
  </Step>
</Steps>

### General settings

<Steps>
  <Step title="Set the hostname">
    Check the **Set hostname** box and type:

    ```
    picar
    ```

    This is the name your robot will use on the network. You will use it later to connect via SSH.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/06-hostname.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=300ee6dfb046d310dc7a615f3115c261" alt="Hostname set to picar" width="1024" height="768" data-path="images/day1-setup/06-hostname.png" />
  </Step>

  <Step title="Set locale and timezone">
    Scroll down to the locale section. Set the **Time zone** to **America/New\_York** and the **Keyboard layout** to **us**.

    To find the timezone, scroll down to **Washington, D.C.** or type it into the search field if one is available.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/07-locale-select.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=0fa1b6d6f48b0c50109dcb9a19283cef" alt="Scrolling to Washington DC locale" width="1024" height="768" data-path="images/day1-setup/07-locale-select.png" />

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/08-locale-done.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=60015fa0bb252dd5de5d3513463474ec" alt="Locale configured" width="1024" height="768" data-path="images/day1-setup/08-locale-done.png" />
  </Step>

  <Step title="Set the username and password">
    Check the **Set username and password** box. Enter the following:

    | Field    | Value |
    | -------- | ----- |
    | Username | `car` |
    | Password | `car` |

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/09-user-pass.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=5447a97cade8aee1f33443be0c351281" alt="Username and password set to car / car" width="1024" height="768" data-path="images/day1-setup/09-user-pass.png" />

    <Note>
      Everyone in the camp uses the same username and password so facilitators can help troubleshoot. This keeps things consistent across all robots.
    </Note>
  </Step>

  <Step title="Configure WiFi">
    Check the **Configure wireless LAN** box. Your facilitator will provide the WiFi network name and password. Enter them here:

    | Field                | Value                            |
    | -------------------- | -------------------------------- |
    | SSID                 | *(provided by your facilitator)* |
    | Password             | *(provided by your facilitator)* |
    | Wireless LAN country | `US`                             |

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/10-wifi.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=65ac12afe1fe8659f5c8236dd003b5a4" alt="WiFi SSID and password entered" width="1024" height="768" data-path="images/day1-setup/10-wifi.png" />

    <Warning>
      Double-check the WiFi name and password character by character. A single typo means the robot will not connect to the network, and you will need to re-flash the SD card.
    </Warning>
  </Step>
</Steps>

### Services settings

Click the **Services** tab at the top of the customization panel.

<Steps>
  <Step title="Enable SSH">
    Find the **Enable SSH** toggle. It starts in the off position.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/11-ssh-off.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=0b3ffa8232f8285216dec02f74f5a819" alt="SSH toggle in off state" width="1024" height="768" data-path="images/day1-setup/11-ssh-off.png" />

    Click the toggle to turn it **on**, then select **Use password authentication**.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/12-ssh-on.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=0b7a40e5c9e8da1e637a18f9955197e7" alt="SSH enabled with password authentication" width="1024" height="768" data-path="images/day1-setup/12-ssh-on.png" />

    <Info>
      SSH (Secure Shell) lets you type commands on your robot from your laptop's terminal. Without it enabled, you would have no way to control the Pi remotely.
    </Info>
  </Step>
</Steps>

### Raspberry Pi Connect

Still on the Services tab, you will now enable Raspberry Pi Connect. This gives you a backup way to reach your robot through a web browser — even if SSH has issues.

<Steps>
  <Step title="Turn on Raspberry Pi Connect">
    Find the **Raspberry Pi Connect** toggle and switch it on. The Imager opens a sign-in page in your browser.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/13-pi-connect.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=06ceaca8668ecc009665a254916fb486" alt="Raspberry Pi Connect toggle" width="1024" height="768" data-path="images/day1-setup/13-pi-connect.png" />
  </Step>

  <Step title="Create a Raspberry Pi account">
    On the sign-in page, click **create one for free** to make a new account.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/14-connect-signin.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=25af8d38f9e0cf039c5cde6770fa1d56" alt="Connect sign-in page" width="1024" height="552" data-path="images/day1-setup/14-connect-signin.png" />

    Fill in your email address, choose a password, and enter your name. Then click **Continue**.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/15-connect-signup.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=cf6891a26b18498f227e3e488dd46da7" alt="Creating a Raspberry Pi account" width="1024" height="552" data-path="images/day1-setup/15-connect-signup.png" />

    <Tip>
      Use an email you can check right now — you need to verify it in the next step.
    </Tip>
  </Step>

  <Step title="Verify your email">
    The Raspberry Pi website asks you to confirm your email address.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/16-confirm-email.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=2fe25b42441804dbfccb700c506d17f8" alt="Confirm your email page" width="1024" height="552" data-path="images/day1-setup/16-confirm-email.png" />

    Open your email inbox (Gmail, Outlook, etc.), find the message from **Raspberry Pi ID**, and click the **Confirm email** button inside it.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/17-email-confirmed.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=8c70ecaa5130f60671cc7ee114c61b9b" alt="Gmail showing the Raspberry Pi confirmation email" width="1024" height="552" data-path="images/day1-setup/17-email-confirmed.png" />
  </Step>

  <Step title="Confirm email success">
    After clicking the link, you see a confirmation page that says **"Your email is now confirmed."** You can close this tab.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/18-profile.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=733afb716c5167edede4cccc95a0d2bc" alt="Email confirmed — close this window" width="1024" height="552" data-path="images/day1-setup/18-profile.png" />
  </Step>

  <Step title="View your profile">
    You are now signed in to your Raspberry Pi account. You should see your profile page with a green **"Email successfully confirmed"** banner.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/19-connect-paste-token.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=0ceeb5a67343451d766b5757564d92c3" alt="Raspberry Pi profile page — Hi Ishan" width="1024" height="552" data-path="images/day1-setup/19-connect-paste-token.png" />
  </Step>

  <Step title="Sign in to Raspberry Pi Connect">
    Go back to the Raspberry Pi Imager and click the **Open Raspberry Pi Connect** button again. This opens a new browser tab showing the sign-in page. Since you just created your account, it now shows a blue **Sign in as \[your name]** pill. Click it to sign in.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/20-auth-key.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=4afc05ceacde8c1ed0ef3585121b8fcd" alt="Sign in as your name on Pi Connect" width="1024" height="768" data-path="images/day1-setup/20-auth-key.png" />

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/21-open-imager.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=27b6e06026e97153c8fd9de55f8ab928" alt="Click the blue sign-in pill" width="1024" height="552" data-path="images/day1-setup/21-open-imager.png" />
  </Step>

  <Step title="Create an auth key">
    After signing in, the page shows **"New auth key"**. Click the **Create auth key and launch Raspberry Pi Imager** button.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/22-token-received.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=b59fb8d571e887123861dd4f2c56f176" alt="New auth key — create and launch Imager" width="1024" height="552" data-path="images/day1-setup/22-token-received.png" />
  </Step>

  <Step title="Open the Imager and confirm the token">
    Your browser asks if you want to open Raspberry Pi Imager. Click **Open Raspberry Pi Imager**.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/23-write-summary.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=8fa4b17ea0ea5704207fd8bd38e6cf36" alt="Open Raspberry Pi Imager dialog" width="1024" height="552" data-path="images/day1-setup/23-write-summary.png" />

    The Imager now shows **"Token received from browser"** with the authentication token filled in. Click **Next** to continue.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/24-erase-confirm.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=ee3bc53256421ae640f64fa303cddd50" alt="Token received in Imager" width="1024" height="768" data-path="images/day1-setup/24-erase-confirm.png" />
  </Step>
</Steps>

<Check>
  At this point, you have configured the hostname, locale, username, password, WiFi, SSH, and Raspberry Pi Connect. You are ready to write the image.
</Check>

### Write the image to the SD card

<Steps>
  <Step title="Review your settings">
    The Imager shows a summary of everything you configured. Review it carefully:

    * **Device**: Raspberry Pi Zero 2 W
    * **OS**: Raspberry Pi OS (32-bit)
    * **Hostname**: picar
    * **Username**: car
    * **WiFi**: your network name
    * **SSH**: enabled
    * **Raspberry Pi Connect**: enabled

          <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/25-mac-password.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=3b712e32cf70422f532beba2927e25b6" alt="Write summary showing all customizations" width="1024" height="768" data-path="images/day1-setup/25-mac-password.png" />

    <Warning>
      If anything looks wrong, click **Back** and fix it now. Once writing starts, you cannot change these settings without re-flashing from scratch.
    </Warning>
  </Step>

  <Step title="Confirm the erase">
    Click **Write**. The Imager warns you that **all data on the SD card will be erased**. This is expected — click **I UNDERSTAND, ERASE AND WRITE** to confirm.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/26-writing.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=7110bf5258f08658d6e0caebb4b002e5" alt="Erase confirmation dialog" width="1024" height="768" data-path="images/day1-setup/26-writing.png" />
  </Step>

  <Step title="Enter your Mac password">
    macOS asks for your computer password to allow disk access. Type your **Mac login password** (not the `car` password you set earlier) and click **OK**.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/27-write-complete.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=9ad04cb8090256845a033baa09986de0" alt="Mac password prompt for disk access" width="744" height="880" data-path="images/day1-setup/27-write-complete.png" />

    <Note>
      This is your laptop's password — the one you use to unlock your Mac. It is not the same as the `car` password you just configured for the robot.
    </Note>
  </Step>

  <Step title="Wait for the write to finish">
    The Imager writes the operating system to the SD card and then verifies the data. This takes **5 to 10 minutes** depending on the speed of your SD card. When it finishes, you see a **"Write complete!"** success message.

    <img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/28-connect-online.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=39cb28fec7424f705b1fecb7f665ca23" alt="Write complete" width="1024" height="768" data-path="images/day1-setup/28-connect-online.png" />

    Click **Finish**, then remove the SD card reader from your laptop.

    <Tip>
      Do not unplug the SD card reader or close the Imager while it is writing. Let it finish completely.
    </Tip>
  </Step>
</Steps>

### Insert the SD card and boot the robot

<Steps>
  <Step title="Remove the SD card from the reader">
    Pull the microSD card out of the SD card reader.
  </Step>

  <Step title="Insert the SD card into the Pi">
    Look at the back of the robot. The Raspberry Pi sits below the Robot HAT board, and the SD card slot is visible from the rear — you do not need to flip the robot over. Slide the microSD card into the slot with the gold contacts facing up (toward the board). Push gently until you feel it click into place.
  </Step>

  <Step title="Power on the robot">
    Find the toggle switch on the back of the Robot HAT (the top board). Flip it on. The green LED on the Pi should start blinking — this means the Pi is reading from the SD card and booting up.
  </Step>
</Steps>

### What happens during first boot

The first time the Raspberry Pi boots with a fresh SD card, it needs extra time to:

* Expand the file system to fill the entire SD card
* Apply the hostname, username, password, and WiFi settings you configured
* Connect to your WiFi network
* Register with Raspberry Pi Connect

<Info>
  **First boot takes 2 to 3 minutes.** The green LED blinks rapidly while the Pi is working. Wait until the blinking slows down before trying to connect.
</Info>

Once the Pi connects to WiFi, you can confirm it is online by checking your Raspberry Pi Connect dashboard at [connect.raspberrypi.com](https://connect.raspberrypi.com). Your robot should appear as **picar** with a green **Online** status.

<img src="https://mintcdn.com/intellectualpoint/xLJwHPVqdzG8quCt/images/day1-setup/30-ssh-fingerprint.png?fit=max&auto=format&n=xLJwHPVqdzG8quCt&q=85&s=3a6944fc5d6767bf5badfc790b64f7ba" alt="Robot showing as online in Raspberry Pi Connect" width="1024" height="552" data-path="images/day1-setup/30-ssh-fingerprint.png" />

<Check>
  Your SD card is flashed, your robot is booting, and you are ready to move on to the next section: connecting via SSH.
</Check>
