MODBus Node with level sensor

This is a MODBUS-node with a capacitive water level sensor, a DS12S80 temperature sensor and a RS485 interface to the main controller.

This is my first project based on CADSOFT Eagle free-version. I still have to learn a lot for creating 2-layer PCBs :-/


The board features are:

  • Onboard power supply
  • ATMEGA328P processor running on 16MHz
  • RS485 serial line driver
  • 1-WIRE bus for connection to an remote DS12B80 sensor
  • A capacitive water-level-meter.

The boards is based on an ATMEGA328p processor - same is used on the current ARDUINO UNO SMD version. The idea is, that I once program the ARDUINO bootloader into the ATMEGA328p using the 6-pin header. Later I can update the code using the regular FTDI-6-pin header via the ARDUINO development environment.


The capacitive sensor is based on the work Nathan Hurst.


And this is my first PCB: MBFS LP B.

The board was produced by PCB-DEVBOARDS in Germany for a reasonable price.

I'm still waiting for some components, so I started testing the power-supply and the capacitive level-meter MBFS LP T and it works!


Today Reichelt delivered the missing components - first of all the ATMEGA328P. Most component on the board are now populated.MBN1

After full testing I will remove the solder flux and clean the board.

Next action was flashing the bootloader using my ATMEL AVRISP MKII. (The ISP connector is the left 6-pin header). Inside the ARDUINO IDE I've selected the ARDUINO DUEMILANOVE w/ ATMEGA328 board.

Flashing was an action of about 2 minutes using the ARDUINO IDE.

And the first version of SKETCH is also now loaded using the FTDI cable. (This cable is plugged onto the right 6-pin header)

And - yes it's working as expected :-)

Here some more pictures of the populated PCB MBN BOTMBN TOP

MODBus registers

The boards features the following MODBus registers:

   R0 + R1   double waterTemp;            // water temperature at the electrode
R2   unsigned int waterLevel; // compensated water level
R3   unsigned int waterLevelRaw; // the uncompensated raw water level just for debug purposes
R4   unsigned int chipVcc; // onboard voltage measured internally in the ATMEGA328p. Raw ADC value.
R5   unsigned int chipTemp; // onboard temperature measured internally in the ATMEGA328p. Raw ADC value.


Read on about my experiments regarding the capacitive level sensor.