Skip to content

NANO GENETICS / PRACTICAL KNOWLEDGE

From a sensor to understanding.

A signal becomes useful when we understand what it means. Follow the whole path here: choose a sensor, connect it, read it and assess how much you can trust the result.

01 / WHAT IS A SENSOR?

What is a sensor?

A sensor responds to a measurable property and turns a change into a readable signal. The property we actually want to measure is called the measurand.

Start with the question.

“How warm is it on the desk?” requires a temperature measurement. “Is someone close to the robot arm?” requires a different measurement. A camera, an accelerometer and a temperature sensor provide different kinds of information. None of them automatically knows what a person intends.

The sensor is part of a system. A power supply operates it, a circuit reads its signal and software puts that signal into context. A biosensor also has a biological recognition element, such as a molecule that binds a particular substance, coupled to a readout. A sensor used near a person is therefore not necessarily a biosensor.

Measurement and conclusion are two steps.

An accelerometer records acceleration. Software may try to interpret a pattern as a step, but vibration can create similar patterns. A light sensor records light at its location. It does not by itself say how a person experiences a room. Describe both the direct measurement and the assumption behind each interpretation.

Our example asks a narrow question: can we record a slow temperature change and preserve the raw reading so that the calculation can be checked? This simple question makes every step visible. The same discipline is needed when more sensors or a model are added.

Choose by what you need to measure
Sensor typeDirect signalWhat you need to check
TemperatureA temperature-dependent electrical propertyPlacement, heat transfer and time to equilibrium.
OpticalLight reaching a detectorAmbient light, geometry and sensitivity to different wavelengths.
Inertial / IMUAcceleration and, with a gyroscope, angular velocityAxis directions, mounting, motion artefacts and drift.
Force / pressureChange under mechanical loadContact area, preload, hysteresis and calibration load.
Chemical / biologicalA signal associated with a chemical reaction or recognition eventSelectivity, sample conditions, interference and a reference method.

02 / BUILD A CLEAR FIRST MEASUREMENT.

Build a clear first measurement.

We use an Arduino UNO R3 and a TMP36 in the three-lead TO-92 package. This is a room-temperature learning example with code that needs no additional sensor library.

The parts you need

  • Arduino UNO R3 (ATmega328P), USB data cable and a computer with Arduino IDE.
  • TMP36 in the TO-92 package, a breadboard and short jumper wires.
  • One ceramic 100 nF (0.1 µF) capacitor close to the sensor supply lead.
  • A separate room thermometer for comparison. A multimeter helps check the supply voltage.

Check the TMP36 marking. A similar-looking transistor or TMP35 is not the same component. UNO R4, 3.3 V boards and assembled sensor modules may have different connections, references and resolutions. The wiring here applies only to the combination above.

How to orient the sensor

Face the flat side towards you, with all three leads pointing down. For this TO-92 version, the left lead is +VS, the middle VOUT and the right GND. The manufacturer numbers them 1, 2 and 3. The datasheet drawing uses a bottom view; do not turn the sensor to that view while following our front-view diagram.

1 · +VS5V
2 · VOUTA0
3 · GNDGND
Front view: flat side towards you, leads down.
  1. Disconnect power first

    Unplug the USB cable. Put the three sensor leads in three electrically separate breadboard rows. Two leads in the same connected row become shorted together. Check how your breadboard is connected before inserting wires.

  2. Make three connections

    Connect UNO 5V to TMP36 +VS (1), UNO A0 to VOUT (2) and UNO GND to GND (3). Place the 100 nF capacitor between +VS and GND close to the sensor. A0 reads the signal; 5V powers the sensor. Common GND gives the measurement a shared zero level.

  3. Check before powering up

    Trace each wire from connector to sensor. Check that 5V and GND do not share an electrical row. Use USB as the only power source in this example. Leave VIN and AREF unconnected. Then connect the USB cable.

  4. Read and allow the temperature to settle

    Keep the sensor away from warm computer exhaust and direct sunlight. Upload the code below. Allow the sensor and comparison thermometer to share the same stable surroundings before comparing them. A fast electronic response does not mean that the package immediately reaches air temperature.

If the component becomes hot, smells or gives implausible readings, unplug USB and check the marking and wiring. This is a dry tabletop circuit for the surroundings, not a body sensor or an instrument for medical decisions.

03 / FROM A CIRCUIT TO READABLE DATA.

From a circuit to readable data.

Open an empty sketch in Arduino IDE, select Arduino Uno as the board and select the port belonging to it. Paste the complete example and upload. Open Serial Monitor at 9600 baud.

Arduino / C++
// Nano Genetics learning example: UNO R3 + TMP36 TO-92.
// Environment only. No sensor is attached to a person.
const uint8_t SENSOR_PIN = A0;
const float VREF_V = 5.000f;  // Assumption; replace with measured reference.
const float OFFSET_C = 0.0f; // Optional documented one-point correction.

void setup() {
  Serial.begin(9600);
  analogReference(DEFAULT); // UNO R3: AVcc reference, nominally 5 V.
  pinMode(SENSOR_PIN, INPUT);
  delay(10);
  analogRead(SENSOR_PIN);   // Discard the first reading.
  Serial.println(F("time_ms,adc_count,vref_v,voltage_v,temp_c,offset_c,range_flag"));
}

void loop() {
  const unsigned long timeMs = millis();
  const int raw = analogRead(SENSOR_PIN);
  const float voltageV = raw * (VREF_V / 1024.0f);
  const float uncorrectedC = (voltageV - 0.500f) * 100.0f;
  const float temperatureC = uncorrectedC + OFFSET_C;
  const bool inRange = uncorrectedC >= -40.0f && uncorrectedC <= 125.0f;

  Serial.print(timeMs);
  Serial.print(','); Serial.print(raw);
  Serial.print(','); Serial.print(VREF_V, 3);
  Serial.print(','); Serial.print(voltageV, 4);
  Serial.print(','); Serial.print(temperatureC, 2);
  Serial.print(','); Serial.print(OFFSET_C, 2);
  Serial.print(',');
  Serial.println(inRange ? F("within_sensor_range") : F("out_of_range"));
  delay(1000); // Approximately one row per second, not precise timing.
}

What does the program do?

analogRead(A0) gets a raw value between 0 and 1023 from the UNO R3’s 10-bit analogue-to-digital converter, or ADC. The program estimates voltage, applies the sensor conversion to degrees Celsius and sends one row to the computer. Time is milliseconds since the program started, not a calendar timestamp.

The row is CSV: fields are separated by commas. Copy a few rows into a text file and import with commas as separators and a dot as the decimal mark. Keep the column header. Also record date, sensor, placement, code version and how the reference voltage was determined in your notes.

A flag is not a guarantee.

within_sensor_range means only that the uncorrected calculation lies within the sensor’s specified temperature range. It does not prove that the wiring or temperature is correct. A loose input can happen to produce a plausible number. out_of_range is a reason to investigate the circuit, not a diagnosis of the fault.

OFFSET_C starts at zero. Change it only after a documented comparison, not to obtain a number that looks right. The code’s decimal places make the calculation visible but do not give the sensor corresponding accuracy.

04 / WHAT DOES THE NUMBER 154 MEAN?

What does the number 154 mean?

A raw value has no unit until you know the measurement chain. The same integer can represent a different voltage on another board or with another reference.

STEP 1 / RAW READING TO VOLTSV ≈ N × Vref / 1024

154 × 5.000 / 1024 ≈ 0.752 V

STEP 2 / VOLTS TO TEMPERATURET ≈ (V − 0.500) × 100

(0.752 − 0.500) × 100 ≈ 25.2 °C

Supply and reference have different jobs.

The supply powers the sensor. The reference voltage sets the ADC scale. In this UNO R3 circuit we use the board’s nominal 5 V system for both, but USB power is not an exact 5.000 V standard. If needed, measure the board’s 5V against GND with a multimeter and use the measured value as an approximation in VREF_V. Do not change the AREF wiring.

TMP36 has a nominal slope of 10 mV per degree and 0.500 V at zero degrees. Sub-zero temperatures can therefore be represented by a positive voltage: 0.400 V nominally means −10 °C. The formula applies to TMP36, not to all temperature sensors.

Resolution is not accuracy.

Ten bits provide 1024 possible codes, numbered 0 to 1023. We use a simplified step of Vref/1024 volts. At 5 V this is about 4.88 mV, corresponding to 0.49 °C per step in this chain. The formula estimates voltage; it does not recover where the signal lay within a quantisation step.

Noise, sensor error, ADC error, placement and an incorrect reference affect the real result. Averaging can reduce independent random variation but does not remove systematic error. More digits on the screen do not replace a better measurement.

05 / SIGNAL STUDIO

Signal Studio

Change a raw reading and see how assumptions change the result. The studio is a mathematical simulation. It reads no connected sensor and collects no measurement data.

Explore the measurement chain
CALCULATED TEMPERATURE
25.2°C
Estimated voltage
0.752 V
Temperature per ADC step
0.488 °C
Before correction
25.2 °C

Within the specified sensor range. This checks the calculation, not the measurement quality.

Try a deliberate error.

Keep the raw reading at 154 and change the reference from 5.00 to 4.80 V. The temperature moves from about 25.2 to 22.2 °C even though no new raw reading has arrived. This numerical example shows why assumptions must travel with the data.

06 / WHEN CAN YOU TRUST THE MEASUREMENT?

When can you trust the measurement?

A useful measurement should be repeatable and comparable. Start with a record that someone else can follow with the same parts and question.

01 / Placement

Place the sensor and reference thermometer near each other without direct contact with a heat source. Record distance from the computer and any changing airflow. Wait until both show a stable trend; different response times can otherwise look like measurement error.

02 / Repetition

Record, for example, 60 rows in stable conditions. Note the minimum, maximum and mean. Restart and repeat. Compare variation within each series with the difference between series. Keep raw readings so that rounding does not hide behaviour.

03 / Reference

Compare against a thermometer with known accuracy. A simple correction is the reference temperature minus the sensor mean. If the reference reads 23.0 °C and the sensor 24.0 °C, the correction is −1.0 °C. Record when and where the comparison was made.

04 / Limitation

A single comparison point only corrects an assumed constant offset near that point. It does not verify the whole temperature range, response time or error under other conditions. Professional calibration needs better references and a documented uncertainty assessment.

Troubleshoot in a useful order
What you seeCheck this first
No text in Serial MonitorBoard selection, correct port, upload result, USB data cable and 9600 baud.
Raw reading near 0 or 1023Disconnect power and trace 5V, A0 and GND again. Check sensor type and breadboard rows. An extreme reading alone does not identify the fault.
Readings jump widelyLoose connections, common GND, short wires, capacitor placement and nearby interference. Change one thing at a time.
Stable but different temperatureReference voltage in the code, time to settle and whether the reference measures the same conditions. Do not begin by hiding the difference in software.

07 / HOW SEPARATE PARTS BECOME A SYSTEM.

How separate parts become a system.

Once the first measurement is understood, you can add more parts. The connection between sensors, models and human decisions becomes stronger when every interface is explicit.

Electrical connection

An analogue sensor can output a voltage that must fit the input’s allowed range. I²C sends digital data using a clock line and a data line; SPI uses separate clock, data and device selection. A shared connector does not mean compatible voltage levels, addresses or messages. Check the exact module documentation before wiring it.

Time and data model

Store unit, timestamp, sensor ID, raw reading, converted value and a quality flag. Record the reference and calibration used. Otherwise, two sensors measuring at different times may appear to describe the same event. Missing packets should appear as gaps, not invented zeros.

Choose sampling speed for the process you need to observe. For fast signals, the measurement chain’s bandwidth and filtering must be planned before digitisation. This slow temperature example is not a template for audio, muscle activity or rapid robot motion.

Model and human choice

Start with an explainable rule: “show an indicator when temperature exceeds a chosen threshold”. Also show the last measurement time and whether data is missing. When a more advanced model is added, you should be able to compare it against this simple baseline and detect poorer performance in a new setting.

In a system used near people, the person needs to understand what was measured, how uncertain the result is and what action is proposed. An interface can ask for confirmation. A physical robot also needs separate engineering and verification of safe behaviour; a working sensor or browser model does not prove that a robot is safe.

Our development direction is to keep this chain understandable as biological signals, soft materials and digital models meet. This guide explains established measurement principles and a learning example. It does not report a finished Nano Genetics instrument.

Further reading and traceability

Show technical sources and review information

The explanation, numerical examples and code above were assembled for this guide. The primary sources supporting component facts are listed below. The manufacturers are not presented as Nano Genetics partners.

  1. Analog Devices: TMP35/TMP36/TMP37, datasheet Rev. H ↗

    Pinout and package: Figure 4. TMP36 characteristics: page 1 and specifications. Decoupling with 0.1 µF: Figure 24.

  2. Arduino: UNO R3, official datasheet ↗

    Board identity, USB and the 5V, GND and A0 connections.

  3. Arduino: official TMP36 example ↗

    Reference for analogue reading and the temperature formula. Our sketch has its own CSV output and range flag.

  4. NIBIB: sensors and biosensors ↗

    Background on sensors, biological recognition and signal transduction.

Reviewed 3 October 2026. Content responsibility: Nano Genetics Sweden AB. We checked component facts and calculation logic against the sources; this publication does not report physical verification of the circuit. Corrections: info@nanogenetics.se.