Built-in project · Arduino Uno R3

Steam sensor on A0, on an Arduino Uno

A steam sensor’s output on A0, printed twice a second: the reading rises as steam or a breath fogs its comb of bare traces. The whole build, an Arduino Uno and 1 more part, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.

Teaching? Assign it to your class in one click.

Beginner About 10 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $28. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • Reading an analog sensor with analogRead
  • How wet traces change the voltage
  • Printing readings to the Serial Monitor
  • Powering a sensor from 5V and GND
  • Difficulty: Beginner
  • Time: About 10 minutes
  • Board: Arduino Uno R3
  • Parts: 2

How it works

The steam sensor is a comb of bare metal traces. Steam or a breath condenses on them and joins them together. The more of the comb is wet, the higher the voltage on the S pin. S goes to A0 on the Uno.

The sketch reads A0 with analogRead, a number from 0 to 1023, and prints it twice a second. Drag the steam up in the simulator and the number climbs.

Parts list

2 parts, plus the jumper wires. They retail for about $28; on Mokxi they're free.

Wiring table

Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.

Part and pinConnects to
Steam sensor pin VCCArduino Uno R3 pin 5V
Steam sensor pin GNDArduino Uno R3 pin GND
Steam sensor pin SArduino Uno R3 pin A0

The code

The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.

sketch.ino · Arduino Uno R3
// Steam sensor on A0.
//
//   sensor S -> A0   + -> 5V   - -> GND
//
// Bare comb traces: steam or a breath condenses on them and joins them,
// and the more of the comb is wet, the higher the voltage on S.
//
// Drag the steam up.

void setup() {
  Serial.begin(9600);
  Serial.println("Mokxi Uno: Steam sensor on A0");
}

void loop() {
  int reading = analogRead(A0);
  Serial.println(reading);
  delay(500);
}

Code walkthrough

The key functions of the sketch, and what each one does.

setup sketch.ino

Runs once. Serial.begin(9600) starts serial output at 9600 baud and prints a title line so you know the sketch started.

void setup() {
  Serial.begin(9600);
  Serial.println("Mokxi Uno: Steam sensor on A0");
}

loop sketch.ino

Reads A0 with analogRead, prints the result with Serial.println, and waits 500 milliseconds with delay. That gives two readings per second.

void loop() {
  int reading = analogRead(A0);
  Serial.println(reading);
  delay(500);
}

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The number does not change This project
    Check that S goes to A0, the sensor's power pin to 5V and its ground to GND. Then raise the steam level.
  • The reading is always low or does not change. Steam sensor
    Check the S pin goes to an analog input, with power and ground connected. The sensor reads higher with more water on the traces, so test with a breath or damp finger.
  • The sensor stops working or corrodes. Steam sensor
    Do not leave the traces in water or powered all the time. Keep the board dry, and read it only when needed. Use the numbers as a relative level, not a precise measurement.
  • Upload fails or nothing runs after wiring pins 0 and 1 to a module. Arduino Uno R3
    Pins 0 and 1 are the USB serial port. Move the module to other pins, or unplug it while uploading. Also check the right board is selected.
  • Pins misbehave or the board resets when you power motors or servos from it. Arduino Uno R3
    Each I/O pin gives about 20 mA, 40 mA max. Power motors and servos from their own supply and join its ground to the Uno's GND.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.