Skip to content
Free IDE

← Components

Generic analog sensor

One component for several sensors with an analog output: choose the profile (MQ-type gas, capacitive or resistive soil moisture, ACS712 current or custom) and move the slider. AO gives a fraction of the VCC voltage (ratiometric output); DO is the module comparator, with threshold and hysteresis. A 5 V module with AO straight on the GPIO can go above 3.6 V: the simulator warns you before the board burns out.

Pinout

VCCGNDDOAO100 ppmVCCGNDDOAO
PinConnect toNote
VCC3V3 or VIN (5 V), depending on the modulethe AO output follows this voltage
GNDGND
DOinput GPIO (e.g. 13)only in the profiles with a digital output
AOGPIO with ADC (e.g. 34)with a 5 V VCC, use a voltage divider
FastTeacherFor teachers

From the syllabus to a planned semester

  • Teaching plan and calendar built automatically
  • Class diary ready to paste into SIGA
  • Slides and exercise lists with answer keys
Meet FastTeacher

Free Community edition · Windows

MicroPython example

from machine import ADC, Pin
import time

sensor = ADC(Pin(34))  # sensor AO
sensor.atten(ADC.ATTN_11DB)

while True:
    print(sensor.read_uv() / 1000000, "V")
    time.sleep(0.5)

Specifications

ItemValueSource
ACS712: sensitivity185 mV/A (5 A), 100 mV/A (20 A), 66 mV/A (30 A), with a 5 V VCCACS712 datasheet (Allegro MicroSystems), tables "Common Operating Characteristics" and "x05B/x20A/x30A Performance Characteristics"
ACS712: output at zero currentVCC × 0.5 (2.5 V at 5 V)ACS712 datasheet (Allegro MicroSystems), tables "Common Operating Characteristics" and "x05B/x20A/x30A Performance Characteristics"
ACS712: supply4.5 to 5.5 VACS712 datasheet (Allegro MicroSystems), tables "Common Operating Characteristics" and "x05B/x20A/x30A Performance Characteristics"
MQ-type gas: curvelogarithmic (teaching approximation)Under review: Rs/R0 curve from the Hanwei datasheet and the module RL
Soil moisture: curveinverse: wetter, lower voltage (teaching approximation)Under review: measure the module dry and in water
Noise, drift and warm-upoff by default (0)Under review: measure on the board
Pin orderVCC, GND, DO, AOUnder review: it varies between modules; check the silkscreen on yours

Values marked "Under review" will still be checked against the parts in the lab.

FastMindLocal AI assistant

The AI that remembers your life and lives on your computer

  • Long-term memory with the source of every answer
  • Works offline: your data stays on your PC
  • Reads PDFs, slides, photos and meeting recordings
Download free for Windows

Essential plan free forever

FastTeacherFor teachers

From the syllabus to a planned semester

  • Teaching plan and calendar built automatically
  • Class diary ready to paste into SIGA
  • Slides and exercise lists with answer keys
Meet FastTeacher

Free Community edition · Windows

FastMindLocal AI assistant

The AI that remembers your life and lives on your computer

  • Long-term memory with the source of every answer
  • Works offline: your data stays on your PC
  • Reads PDFs, slides, photos and meeting recordings
Download free for Windows

Essential plan free forever