Science Sensor


The science sensor is a multi-in-one sensor developed independently by Makeblock. Integrating the gas, magnetic field, flame, air pressure, temperature & humidity, PIR, touch, and soil moisture sensing components, the science sensor can be used in various data collecting, science exploring, and Internet of Things (IoT) projects.

Functions and parameters

Whole  Science sensor Dimensions: 78.2 × 24 × 1.6 (mm)

Operating voltage: 5.0 V

Operating current: 250 mA

Components Name Function Parameter
MQ2 gas sensor Sensitively detects smoke,  liquefied natural gas (LNG), butane, propane, methane, alcohol, and hydrogen in the air.
  • Gas concentration detection range: 300–10000 ppm (flammable gas)
  • Impedance when heated: 33Ω
  • Preheating energy consumption:< 950 mW
Note: The deviation may be large at the moment when the sensor is powered on. Heat it for five minutes before you use it.
Magnetic field sensor Measures the angle between the x-aix of the magnetic field sensor and North Pole (90°N) after being calibrated.
  • Degree detection range: –180° to +180°(The angle 0° refers to 90°N.)
  • Magnetic flux range: ±30G (unit: gauss)

  • Place the sensor on a horizontal plane before you use it. Tilting it may cause a large detection deviation.
  • Ensure that no powerful magnetic material, such as a magnet,  is placed nearby. Otherwise, detection errors may be caused.
Flame sensor Detects a flame and its strength through IR light detection.
  • Detection wavelength range: 600–1000nm
  • Flame strength range: 1–100

Don’t use the sensor under the direct sunlight. The sunlight may cause severe interference.

Air pressure sensor Estimates the altitude based on the detected air pressure.
  • Air pressure detection range:      300–1100 hPa (unit: hundred pascals)
  • Altitude value range:                 –500 m to +6000 m

Ensure that there are no particles, such as dust, on the surface of the sensor. Otherwise, the sensor may be damaged.

Humiture sensor Detects the humidity and temperature of the air.
  • Temperature value range:          –40°C to +125°C
  • Temperature error:
    • ±0.5°C (in the environment of 0°C to 50°C)
    • ±1°C (in the environment of –20°C to +85°C)
  • Humidity value range:               0–100%
  • Humidity error:
    • ±3% (in the environment of 50% RH)
    • ±5% (in the environment of 20% to 80% RH)

Ensure that there are no particles, such as dust, on the surface of the sensor. Otherwise, the detection deviation may be large or the sensor may not work properly.

PIR sensor Detects whether a human being or homeothermic animal passes by.
  • Detection range: < 2 m
  • Detection angle at the x-axis: 80°

  • Detection angle at the y-axis: 55°

  • Detection duration after being triggered: 2 seconds

Don’t remove the white Fresnel filter. Otherwise, a large detection deviation may be caused.

Touch sensor Detects whether a hand touches the sensor.
  • Touch area: area with the fingerprint pattern
  • Resistance value range: 0–102300000kΩ

Keep the area of the fingerprint pattern clear without any dust or waterdrop to prevent detection errors.

Soil moisture sensor Detects soil moisture.
  • Detection range: probes

  • Moisture value range: 0–100% (RH)
  • Resistance value range:             0–102200kΩ

Ensure that the nameplate of the science sensor is kept above the soil when you insert the sensor into the soil. Otherwise, the other sensing components may be damaged.

Example programs

Example programs for the science sensor

Example 1: PIR-sensitive lamp (using the PIR sensor)

You can control the LEDs on CyberPi based on the PIR sensor and view the detection result of the PIR sensor on the screen. For the working principle of the PIR sensor, see “Working principle” on the PIR Sensor page.

Example 2: Environment detector (using the humiture sensor and air pressure sensor)

The humiture sensor on the science sensor can be used to detect the ambient temperature and humidity, and the air pressure sensor can be used to detect the air pressure and estimate the altitude. You can program the screen of CyberPi to display all the output data of the sensors.

Example 3: Fire alarm (using the MQ2 gas sensor and flame sensor)

The science sensor integrates an MQ2 gas sensor and flame sensor, which can be used to detect gas leaks and fires in families.

With these two sensors, you can make a simple alarm that is to be triggered by a flammable gas or flame. When the alarm is triggered, CyberPi makes a warning sound.

For the working principle of the flame sensor, see Flame Sensor. The flame sensor is triggered by infrared radiation, and the infrared radiated by a human body may also trigger it. Therefore, in pratice, you can set a threshold (strength of the flame detected) for triggering the flame sensor.

Example 4: Compass (using the magnetic field sensor)

The magnetic field sensor on the science sensor can be used to function as a compass. The magnetic declination varies according to region, and therefore you need to calibrate the magnetic field sensor before using it.

Note: You need to calibrate the magnetic field sensor in a non-magnetic environment. An outdoor open space is recommended.

Use the following block to enable or disable the calibration.

Output value range: –180° to +180°(where 0° indicates that the science sensor points at 90°N, the North Pole)

Program the science sensor to function as a compass.

Example 5: Soil moisture detector (using the soil moisture sensor)

The soil moisture sensor on the science sensor is of the resistive type. When the soil moisture increases, the water can dissolve the ions contained in part of the soil, so that the resistance of the soil decreases, and therefore the output value of the soil moisture sensor becomes greater. When the water content in the soil further increases (in the case of extremes, imagine that you throw some soil into water), the ion concentration in the soil is diluted by excess water, resulting in a decrease in electrical conductivity and an increase in resistance. That’s why you may find that the soil moisture sensor outputs a smaller value in pure water than in moist soil (although the former has a significantly higher water content) because the ion concentration in the moist soil is higher and the resistance is smaller.

With the following program, you can view the change in soil moisture and resistance detected by the soil moisture sensor.

Example 6: Touch control lamp (using the touch sensor)

The touch sensor on the science sensor can detect whether the touch point is touched and thus can implement touch-based control.

With the following program, you can control the LEDs on CyberPi by touching the touch sensor.