Remote water level meter with DRF1276DM/DRF1278DM and Arduino lora modules

In this tutorial we will see how to create a system that allows us to measure the water level remotely, with modules lora DRF1278DM/DRF1276DM (sx1276) and arduino mini pro, in addition the printed circuit is included to create the water probe. We will see the circuits, also the source codes and the operation of the system.

About the Water Level Meter Circuit

The ULN2803 integrated circuit is used as a power interface for circuits with CMOS and TTL technology. This integrated has inside 8 NPN transistors in Darlington configuration with protective diodes, to be able to control motors, inductive loads, relays, and more. Each output can control up to 500 mA so you can control different types of loads. Outputs can be connected in parallel when higher loads need to be handled, however it is advisable not to exceed the total power of the circuit.

You may be interested in projects in Arduino, pic, robotics, telecommunications, videos with full source code and diagrams



    • 8 NPN Darlington transistors in common emitter
    • 8 reverse voltage suppression diodes to handle inductive loads, with common cathode connections
    • Outputs of 0.5A (500mA) max.
    • Transistors can be connected in parallel for greater current capacity
    • Output support voltage: -0.5V to 50V
    • Max power: 1.47 W
    • Input resistance to the base: 2.7k
    • Input voltage: -0.5V to 30V
    • 5V TTL and CMOS compatible inputs
    • Encapsulated: DIP 18-pin


  • Command of relays, lamps, or displays (LED or gas discharge), etc.
  • Logical buffers
  • Line drivers
  • Among other applications


To activate each output of this integrated circuit, the water must not be pure, in its contents it must have some salts, which help to conduct electricity, that when reaching each of the levels in the container, closes the electrical circuit of the ulN2803 inputs, which detect the high voltage level and turns on the LED corresponding to each output. At each output we can connect for example a relay, a buzzer and even the pump of an engine to refill a water tank, if necessary, up to a certain level and disconnect the water pump when reaching the desired limit.

The following figure shows the ULN2803 pinout. Comes with 8 input pins and 8 output pins.

The following figure shows the logical diagram of ULN2803. It is a visual representation and arrangement of how diodes are connected in the component.

The following figure shows the schematic diagram for each pair of Darlington.


8 resistores de un 1K


8 10K resistors

Male pins

An integrated circuit uln2803apg

An 18-pin socket

A printed circuit

Download gerber file Gerber_circuito water level meter


About Lora Modules

The LoRa radio module is a type of low-speed long-range data radio modem based on Semtech’s Sx1276. It is a low cost transceiver module of less than 1 GHz designed for operations in the ISM (Industrial Scientific Medical) and LPRD bands without license. Frequency spectrum modulation/demodulation, multichannel operation, high bandwidth efficiency and anti-lock performance make LoRa modules easy to perform thanks to robust and reliable wireless linking.

The module can operate in two different modes: standard mode and Star network mode. In standard mode, it acts as a transparent data radio modem that communicates with the host in the preset data format without the need for encoding/decoding. In startup network mode, a module will be configured for the central node and other modules will be configured as node modules. Communication between the central module and the node module is bidirectional, but node modules cannot communicate with each other. Note that the module does not contain the lorawan protocol. Therefore, the star network function of this module is used with the protocol itself, so it is not compatible with lorawan.


  • LoRa Frequency Spectrum
  • Frequency band 433 / 490Mhz ISM
  • -137 dBm receive sensitivity
  • 20 dBm max. output power
  • Serial activation port
  • Wireless alarm clock
  • Star network capacity
  • Supply voltage 3.4 x 5.5V


  • Operating Voltage: 2.1 x 3.6V (Battery Powered) or 4.5×5.5V
  • Working frequency band: 433 MHz
  • Modulation: LoRa extended spectrum
  • Output power: ≤ 20dBm
  • Reception sensitivity: -148dBm
  • Emission current: ≤120mA
  • Receiving current: ≤15.2mA
  • Sleep current: ≤ 3.9uA
  • Sleep time: optional 2S, 4S, 6S, 8S, 10S
  • Breathing time: optional 2ms, 4ms, 8ms, 16ms, 32ms, 64ms
  • Time to wake up: wake up immediately
  • Communication interface: TTL serial communication
  • Serial transmission speed: 1200 x 57600,9600bps (default)
  • Serial port verification: 8E1.8O1.8N1 (optional)
  • Operating temperature: -40oC – + 80oC
  • Product size: 34.2 * 18.4mm / 1.35 * 0.72 inch

Data Sheets




Connection Module with Serial USB adapter


For some applications, default parameters may not be the best

option, so users may need to change the parameters There are two ways to adjust them: by MCU or by PC. In

configuration mode, the EN pin must be connected to

GND and then the configuration tool or commands can work effectively

By PC: DORJI offers a PC-based configuration tool

that can be used to change parameters through the graphical interface. Users can insert the DRF1278DM module into

serial usb adapter, and connect them to the computer and run the configuration tool.


This tool allows us to configure the LoRa MODULES DRF1278DM and DRF1276DM


Program description

UART -> Values are set to 9.6k bps and no parity check

RF frequency–> Indicates the central frequency of the RF carrier

RF Mode–> Standard Mode, Center Mode and Node Mode

RF_Factor–> Lora Scatter Factor. A higher value means

higher sensitivity but longer air transmission time. Only users can change it in standard mode

RF_BW–> Lora bandwidth. Higher value means less sensitivity. Recommended value: 125K. Only users can change it in standard mode.

Node ID–> Used only for node-mode modules: 0x65535

Net ID–> Only modules with the same network ID (0 x

255) can communicate with each other. You can avoid module interference

Power–> Used to configure the output power of the DRF1278D. There are 7 power levels. The 7 means the maximum. output power: 20dBm and 0 means the lowest output power

Breath–> The activation period for the module in node mode. Only available for firmware 2.0 or higher

Wake timer–> Time to detect wireless signal during break period, is only available for

firmware 2.7 or higher

Serial transmission rate–> Sets the data rate between DRF1278DM and the host (pc or microcontroller)

Serial Parity–> Defines the parity check between DRF1278DM and the host (pc or microcontroller)


mode is also called transparent mode in

which the module receives or sends data to the host over the serial port (UART) in the preset data format and users do not need to worry about the data processing within the module. The DRF1278DM AUX

pin will give indication about the IN/OUT data of the serial port 2 ms in advance, which can be used to wake up the host. In this mode, the EN pin must be set to

low logic in case the module enters deep sleep.

In STANDARD or transparent mode, nodes can work with a point-to-point (P2P) connection the main feature in this way is that no intermediary device is required to manage communication, devices can send information directly between them, this is perfect for simple communications such as turning on a light.

The other way is with a star network type where we find a central node that manages the network, its disadvantage is that it is limited to 255 255-node networks* and that the coordinator node can only listen to one node at a time.


this mode, a DRF1278DM module needs to establish a module as a central module

and other modules must be node modules for star networks. For the central module, it works

at full performance so its power consumption is

the same as in standard mode and the EN pin must be connected to the low logic. The logical level of the

SET pin for the central module must be the same as the node module.

Transmitter circuit

Transmitter source code

Receiver circuit

Receiver source code


[wysija_form id=”1″]


Deja una respuesta