AGENTING · Engineering Projects
By Ravindra Dastikop · 29 November 2026
Your team proposes a tank-level indicator for an engineering project. Before ordering a sensor, your project guide asks a question: “What exactly should happen when the reading reaches the threshold?” You can answer that with a small prototype and three tests.
Use Codex to turn the rule into an Arduino sketch and a test plan. Run the sketch in Wokwi, where a virtual potentiometer stands in for a varying sensor signal. Your first milestone is evidence that the software responds correctly at the threshold.
Define one testable rule
Use the Arduino Uno’s built-in LED as the indicator. The rule for this exercise is simple. The LED is off below 600 and on at 600 or above. The number 600 is a raw test reading. A real sensor would need calibration before this reading could represent any particular water level.
Give the coding agent a bounded task
Open Codex in an empty project folder. Give it the brief below. You’ll use the generated sketch and wiring notes to set up the circuit in Wokwi.
Create an Arduino Uno sketch named sketch.ino for a Wokwi simulation. Read a potentiometer on A0 and use LED_BUILTIN as the indicator. Turn the LED on when the reading is 600 or greater and off otherwise. Print the effective reading and the commanded LED state on the Serial Monitor. Add a clearly labelled test-mode switch and a fixed test reading I can set to 599, 600, or 601. Both modes must use the same threshold logic. In README.md, give the wiring, expected results for all three tests, and one limitation of the simulation. Check that the implementation includes equality at 600. Report any checks you actually ran.
Run the three tests
- Open a new Arduino Uno project in Wokwi and paste in the sketch.
- Add a potentiometer. Connect its SIG pin to A0, VCC to 5V, and GND to GND.
- Enable test mode. Set the fixed reading in turn to 599, 600, and 601, restarting the simulation after each edit. Record the Serial Monitor output and observe the built-in LED. You should see off, on, on.
- Disable test mode and turn the virtual knob. Check whether the LED state follows the readings shown in the Serial Monitor.
The test at exactly 600 catches a common mistake. If the agent writes reading > 600, the checks at 599 and 601 can pass while the threshold itself fails. Give the agent that observed result, review the change it proposes, and rerun all three cases.
Show your guide what you verified
Bring the sketch, the three expected and observed results, and one screenshot showing the reading of 600 with the LED on. Be ready to explain why both test and live input should pass through the same decision logic. The next hardware milestone is to measure how the real sensor reading changes at known water levels before selecting a threshold.
Availability checked on 29 November 2026. Wokwi documents free personal use and the potentiometer used in this lab. OpenAI lists Codex access across ChatGPT plans, including Free and Go. Codex Cloud has separate plan requirements.

No comments:
Post a Comment