Modern Experimental Techniques – Physics

Workshop 1 β€” AI for experimentalists Β· Fri 11 Sep 2026 Β· 14:20–16:20 Β· R311, IAMS

Workshop 1 β€” AI for experimentalists

Aim. By the end of today you know how to use AI to help you build the things our lab builds with it: websites, videos and tutorials, PCB design, data acquisition and fitting, laser locking, hardware control, software. You do it with an AI coding agent β€” Claude Code in VS Code, working on your files: it reads them, writes code, runs commands and reports back β€” and you learn the method that makes its output trustworthy.

Outline. Setup and preparation check β†’ introduction to AI and the tools we use β†’ our "AI method" in 5 steps β†’ Project 1: build a web app (a simulator or a game) β†’ Project 2: control a microcontroller over the net with your phone.

Think about what you want to make! Suggestions for Project 1: loading a freight train game Β· an inverted pendulum simulator Β· phase-locking coupled pendula Β· unfair golf Β· billiards Β· a calculator or simulator for something from your research.

Prerequisite: the preparation is done β€” VS Code with the Claude Code extension signed in, a course folder, the class repository downloaded, a free Cloudflare account connected to GitHub. Bring your laptop and a USB-C cable (the instructor has spares); the ESP32 board is provided.

1 Β· Setup and preparation check

Everyone has their laptop prepared, Claude access working, and the tutor repository downloaded: the class repository class-board-2026 (a repository is a project folder whose complete history is kept by git, the version-history tool; on GitHub it also lives online) is on your laptop and opens in VS Code. Open Claude Code in it and type /tutor L1: the tutor greets you in English or Mandarin and checks your setup with you. If anything is missing, fix it now with the tutor β€” the rest of the day builds on it. The check covers both deployment accounts: signed in to GitHub, and a Cloudflare account connected to GitHub β€” you may need both today.

The tutor does the mechanical work and you approve it β€” creating the project folder and repository, enabling GitHub Pages, the project-wall entry, the secrets check. You do the part that is the learning: write the vision, review the plan, name the test, report what you see, and press Commit / Sync Changes in Source Control. The instructor is not the help desk during class; the tutor is β€” only when the tutor cannot fix it do you go to the instructor.

2 Β· Introduction to AI and the tools we use

A short primer, in the slides (PDF). The topics, each with its rule of thumb:

3 Β· Our "AI method" in 5 steps

The most important slide in the talk.

  1. Vision. Describe what you want, with as much detail as possible.
  2. Specification / Plan. Get AI to produce a detailed specification β€” plan the project! Break the project into many small tasks with testable deliverables. Ask AI to ask you questions!
  3. Review. Review the plan, and have AI review the plan to identify improvements and flaws β€” in a fresh Claude session that has not seen the work, so the author does not grade its own plan.
  4. Code (using agent swarms). Tell AI to run swarms of agents in parallel to complete the build.
  5. Test / Debug / Verify. Ensure your plan and specification include methods to test the code. Fix problems one at a time.

Iterate: the first plan is never the last plan. Never trust AI without testing and verifying.

4 Β· Project 1 β€” Build a web app (a simulator or a game)

What do you want to make? Suggestions: loading a freight train game Β· an inverted pendulum simulator Β· phase-locking coupled pendula Β· unfair golf Β· billiards Β· a calculator or simulator for something from your research.

  1. Decide what to make. Give it its own folder and its own public GitHub repository under your personal account (a repository is a project folder whose complete history is kept by git; on GitHub it also lives online). The tutor checks it and prompts you to push at every milestone.
  2. Follow the "AI method" to produce a working local demo.
  3. Deploy it on the web (publish it so it is live at a public address). Which host depends on what you built, and you may need both: a static page β†’ GitHub Pages, straight from the repository; anything with a backend, a bot webhook or a secret β†’ Cloudflare Pages + Workers.
  4. Create a report that explains the concept or game in detail.
  5. Make the project website β€” the GitHub Pages site of the repository, at https://<user>.github.io/<repo>/: a title, what it is and why it is interesting, how it works, a picture, GIF or short video of it working, what was verified, and links to the live app (…/app/) and to the repository.
  6. Improve the presentation: Markdown β†’ slides β†’ website β†’ YouTube video (optional extension).
  7. Add it to the project wall β€” the tutor prepares your entry (one JSON file and one picture) and you push it.

Each project = its own folder and its own public repository, with a public project website β€” not just a README. GitHub Pages hosts the project website and any static app; anything with a backend, a bot webhook or a secret goes on Cloudflare Pages + Workers β€” you may need both, so have both accounts ready. Either redeploys on every push. The instructor's pendulum-example and csv-scope-example are examples of Project-1-style builds.

5 Β· Project 2 β€” Control a microcontroller over the net with your phone

Aim: create a phone app that lets you control and measure from hardware β€” the ESP32 (a small WiFi microcontroller board; ours is the Jinhua ESP32-S3, NT$400, provided) β€” over WiFi. Follow the "AI method".

  1. Step 1 β€” the hardware-validation baseline. Flash the class repository's reference firmware (the program that runs on the microcontroller) and phone app onto your own ESP32-S3 (flash = write it onto the board over USB; the first flash of a new board needs BOOT + RST once). The board becomes its own WiFi access point instrument-XXXX. Join it from your phone or laptop (password instrument), type http://192.168.4.1 into the browser, control the LED and read the live values. Three tips: stay connected when the phone warns there is no internet Β· on Android, switch mobile data off Β· type the http:// yourself. Starting from a known working hardware baseline is an essential part of any experimental physics workflow β€” it separates hardware problems from software problems.
  2. Step 2 β€” your own app, by the "AI method". Its own folder and its own public GitHub repository, like Project 1. For example: a phone app that controls the brightness and colour of the ESP32's LED; then measure something and show it live on the phone. The class firmware stays the fallback if your own build stalls β€” and it is the base for Project 3.
  3. Make the project website (GitHub Pages of the repository): title, what it is and why it is interesting, how it works, a picture, GIF or short video of it working, what was verified, a link to the repository β€” and, since an app that runs on the board has no public address, a short video of it working instead of a live link.
  4. Add it to the project wall β€” the tutor prepares the entry, you push it.

Camera. For anyone who wants to try a camera app, one unit of the ESP32-S3-N16R8-CAM 開發板 + OV3660 鏑頭 (Jinhua #41395) is available.

6 Β· Between workshops

Before the next workshop: complete the preparation, improve your apps, build and have fun. The apps are your Project 1 and Project 2 β€” push at every milestone, keep the project websites and the project wall current.

Preparation for Workshop 2:

Your part of the class board is assigned at the start of Workshop 2. If you are stuck, ask the tutor first, then e-mail the instructor.

7 Β· Beyond the baseline

The hardware is the shared baseline β€” fixed by budget and timeline. Everything else is open: the software, the firmware, the app, and everything around the instrument. Whenever you are ahead, ask: what problem in my lab could this solve? Talk to your instrument from LINE or Telegram β€” the extension we most encourage: push notifications when a value drifts or an alarm fires, and bot commands that read a value or switch a module output from your phone, from anywhere. Just build something great.

8 Β· Materials