Skip to content

About

Firmware and generic board for low-power environment sensors

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

TinySensor

CI

TinySensor aims to provide a customisable firmware and a hardware design for low-power environment sensors using wireless communication.

In the complete system, data is processed by a Domoticz/RFlink couple. Data decoding is also tested using RTL_433 decoder. Large part of the code, especially wireless encoders, are unit-tested.

Supported MCUs

  • ATTiny84a
  • ATMega328p: started on branch feat/328p_hal, not merged

Supported sensors

Wireless technology

  • "one pin" emitters. Tested with low-cost 433 MHz emitters.

Wireless protocols

  • Environment frame (temperature, humidity, pressure): Oregon Scientific v3 or Lacrosse WS7000, at most one per build. A build without either sends no environment frame.
  • Luminosity: always a dedicated Lacrosse WS7000 frame (Oregon has no light frame), so LACROSSE_ID is required whenever the BH1750 is fitted.
  • Battery level and analog input: optional X10 RFXmeter frames, not sent when the battery is low.

Used libraries

Various libraries are used here, and some where tweaked to remove any Arduino dependencies, making the whole firmware more compact:

Useful documentation about low power AVR

Development

The firmware is built with PlatformIO and configured entirely at build time: each physical sensor is one PlatformIO environment (S_02…S_05, robot, devmodule, SOLAR_TEST) whose build_flags select protocol, sensors and calibration. See docs/environments.md to calibrate or add a board.

pio test -e native_debug        # encoder and library unit tests, on the host
pio test -e native_cycle_oregon # one measurement cycle (runCycle) per build variant;
                                # also native_cycle_oregon_vcc, _lacrosse, _x10
pio run -e S_02                 # firmware for one board
pio run -e S_02 -t upload       # flash it

CI runs the native tests, compile-fail checks for invalid flag combinations (test/compile_fail/), sensor-variant checks (test/build_variants/), clang-format and a build of every board.

Hardware and enclosure

Hardware options

TinySensor can use combination of sensors, the limit comes from amount of flash memory on the ATTiny.

DS18B20

OneWire sensor, cheap and efficient.

BMP/BME 280 environment sensor

The BMP280 and the BME280 share the same library, but the BME provide humidity sensing, and thus use more memory.

Analog sensor

Analog sensor can be used for LM35 temperature sensor, or LDR.

LM35 temperature sensor

On v2.2 and v3.0 boards running from 2×AA/AAA, the LM35 can be powered by an off-board 5 V boost module switched on PB2 only during measurements (USE_SWITCHED_5V), see VARIANTE_LM35.md. The instructions below are for v2.1.

Without negative temperature support

A 0v ground reference is needed. Solder pads 2 and 3 of J4, (rear side) as well JP3.

With negative temperature support

In the case of a -CAZ version, temperature below 0 can be measured. To allow this, two 1N914 diodes must be placed to put the sensor reference below 0v. This setup is documented in the LM35 datasheet. On TinySensor board v2.1 and up, this can be implemented by:

  • solding D2 and D3 diodes
  • solding R4 with a value of 18k
  • solding JP3 to bypass C3 capacitor
  • solding pads 1 and 2 of J4 (rear side) to set ground reference.

Notes about swing

You can add a filter capacitor C3 to avoid swing if the wire is long. In this case, do not solder JP3. See datasheet for details.

LDR

Use the right value for R4 (should match the used LDR) and solder JP3 and, on JP4, middle and 3 pads. This way, there will be no RC filter (no cap because of J3) and Vss analog reference thanks of JP4.

About

Firmware and generic board for low-power environment sensors

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages