Check out the menu item “DIY Domotica & Energy” for several pages about DIY projects with source code!

Download Energy Meter Package
Download Domotica Gateway Package

You receive the complete package, including the Energy Meter, Domotica Gateway, SensorBox, and Wireless LCD Display, ensuring all versions work together. The libraries included are as they currently exist on my disk. While they may not be the latest versions, they should work with the source code. However, the sources are not entirely user-friendly, so you may need to modify the code to fit your specific needs.

Solar Panel Monitoring with Arduino

To monitor the power generated by my solar panels, I decided to use an Arduino microcontroller and develop software to track the energy output. After researching online, I found that others had already done similar projects, and I discovered an excellent Arduino-based solution. It worked almost “out of the box,” but I made some adjustments to suit my setup.

I installed a kWh meter with an S0 pulse output, connected it to the Arduino, and uploaded the software. It functions perfectly, and my solar power output is now available on pvoutput.org.

Raspberry Pi Integration

I also started using a Raspberry Pi, a compact, low-power, and cost-effective Linux computer. While researching sensors and automation tools, I came up with more ideas, leading me to integrate multiple Arduinos and a Raspberry Pi. Currently, my Raspberry Pi handles the following tasks:

  • Switching garden lights on or off based on sunset and sunrise times
  • Providing an SSH tunnel
  • Running a MySQL database for storing solar panel output (in progress)
  • Hosting an Apache server with PHP & Python for simple web interfaces
  • Connecting to Arduinos via USB for remote programming

Arduino Energy Monitor

  • Arduino Mega 2560 with Ethernet Shield
  • Counts pulses from the kWh meter to generate energy statistics
  • Reads P1-port output from a smart energy meter
  • Uploads statistics to pvoutput.org
  • Monitors electricity import/export and total consumption
  • Monitors gas consumption
  • Sends statistics via Ethernet to the Arduino Domotica Gateway

Arduino Domotica Gateway

  • Arduino Mega 2560 with Ethernet Shield
  • Provides multiple digital input/output ports
  • Provides multiple analog input ports
  • Ethernet connection to Raspberry Pi & Arduino Energy Monitor
  • Controllable via iOS devices (iPhone/iPad) using Arduino Manager
  • Controllable via a web interface from the Raspberry Pi (planned feature)
  • 434 MHz transmitter for remote control of switches (e.g., Action, Blokker, KlikAan/KlikUit, Elro)
  • 434 MHz transmitter to send solar statistics and text to the Arduino LCD display
  • Switches garden lights based on signals from the Raspberry Pi

Arduino LCD Display

  • Arduino Nano connected to a 20x4 LCD display
  • 434 MHz receiver to receive data from the Domotica Gateway
  • Displays information such as solar power, temperature, energy consumption, and light switch status
  • Clock module using DS1307 RTC
  • Temperature & Humidity sensor (DHT11 or DHT22)
  • Carbon Monoxide detector (planned feature)

ATtiny-Based Wireless Sensors (Planned & Testing Phase)

  • Atmel ATtiny84 (or ATtiny85) microcontroller
  • 434 MHz transmitter to send sensor data to the Domotica Gateway
  • Temperature or other sensor capabilities
  • Battery-powered for long-term operation
  • Waterproof housing (possible future feature)

The ATtiny chips are small microcontrollers with limited pins but can handle multiple functions. When programmed efficiently, they can run for months on AA batteries, whereas a standard ATmega (used in Arduino boards) would only last a few hours on the same batteries.