| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| emonPi User Guide | ||
| ================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| Install Guide <install.md> | ||
| connect.md | ||
| pulse_counting.md | ||
| temperature_sensing.md | ||
| firmware.md | ||
| configuration.md | ||
| modifications.md | ||
| north-america.md | ||
| Technical <technical.md> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # EmonPi Install Guide | ||
|
|
||
| The following guide provides an quick overview of how to setup the hardware part of an emonPi energy monitoring system for monitoring up to two AC circuits. | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| ```{warning} | ||
| [Please read the CT installation guide before installing.](../electricity-monitoring/ct-sensors/installation) | ||
| Your safety is your responsibility. Clip-on current sensors are non-invasive and should not have direct contact with the AC mains. However, installing the sensors will require working in close proximity to cables carrying high voltage. As a precaution, we recommend ensuring the cables are fully isolated; i.e., switch off the power prior to installing your sensors and proceed slowly with care. If you have any doubts, seek professional assistance. | ||
| ``` | ||
|
|
||
| ## 1. CT sensor | ||
|
|
||
| - Clip the CT sensor around either the **Line** or **Neutral** cable | ||
| - Connect jack plug into either CT1 or CT2 socket on the emonPi | ||
| - If the power reading is negative, reverse the CT sensor orientation | ||
| - CT sensor cable should not be extended to avoid induced noise | ||
| - For Solar PV install see [Solar PV Application page](../applications/solar-pv.md) | ||
| - [Learn more about how CT sensors work...](https://learn.openenergymonitor.org/electricity-monitoring/voltage-sensing/measuring-voltage-with-an-acac-power-adapter) | ||
|
|
||
| ```{note} | ||
| The clip-on CT sensors must be clipped round either the Line or Neutral AC wire. **NOT BOTH** | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| ## 2. AC-AC Adapter | ||
|
|
||
| - Plug the AC-AC adapter into a power outlet | ||
| - This may require installation of a new outlet or extending an existing one | ||
| - AC-AC adapter cable can be extended if required | ||
| - Plug power connector into the AC socket on the emonPi | ||
| - Essential for [Solar PV monitoring](../applications/solar-pv.md) | ||
| - Provides AC waveform reference for accurate Real Power measurements. | ||
| - [Learn more about measuring voltage with AC-AC power adapator...](https://learn.openenergymonitor.org/electricity-monitoring/voltage-sensing/measuring-voltage-with-an-acac-power-adapter) | ||
|
|
||
| ## 3. DC 5V USB Adapter | ||
|
|
||
| - Plug the DC 5V USB adapter into a power outlet | ||
| - Plug the mini-B USB connector into the emonPi | ||
| - High quality minimum [1.2A power supply recommended](https://shop.openenergymonitor.com/power-supplies/) | ||
|
|
||
| ## 4. Optical Utility Meter LED Pulse Sensor (optional) | ||
|
|
||
| - See [Optical Pulse Sensor setup page](https://guide.openenergymonitor.org/setup/pulse-counting/) | ||
| - Connects to emonPi / emonTx via RJ45 connector | ||
| - Self-adhesive velcro attachment to utility meter | ||
| - One optical pulse sensor per emonPi/emonTx | ||
| - Can be used in conjunction with temperature sensors using [RJ45 Breakout](http://shop.openenergymonitor.com/rj45-expander-for-ds18b20-pulse-sensors/) | ||
|
|
||
| ## 5. Temperature Sensors (optional) | ||
|
|
||
| - Connect to emonPi / emonTx via RJ45 connector. | ||
| - Up to 6x [RJ45 sensors](https://shop.openenergymonitor.com/rj45-encapsulated-ds18b20-temperature-sensor/) can be connected using the [RJ45 expander](http://shop.openenergymonitor.com/rj45-expander-for-ds18b20-pulse-sensors/). | ||
| - Up to 6x [wired sensors](https://shop.openenergymonitor.com/encapsulated-ds18b20-temperature-sensor/) can be connected using the [terminal block breakout board](https://shop.openenergymonitor.com/rj45-to-terminal-block-breakout-for-ds18b20/). | ||
| - Sensor wire can be extended using RJ45 cable and the [RJ45 Extender](http://shop.openenergymonitor.com/rj45-extender/). | ||
|
|
||
| ## 6. Installation Examples | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| The included clips can be used to mount the emonPi / emonTx on a wall. | ||
|
|
||
| See [Solar PV Application Note](/applications/solar-pv/) for emonPi solar PV install guide & images. | ||
|
|
||
| ## 7. Power Up | ||
|
|
||
| ```{note} | ||
| Ensure all sensors are connected before powering up. | ||
| ``` | ||
|
|
||
| a.) **Switch on DC & AC power** | ||
|
|
||
| b.) **Check CT sensor(s) & AC Wave are detected:** | ||
|
|
||
|  | ||
|
|
||
| c.) **emonPi should remember WiFi network and re-connect** | ||
|
|
||
|  | ||
|
|
||
| ## 8. Shutdown | ||
|
|
||
| Optional: Shut down the emonPi, hold down the shutdown button for 5 seconds, then wait 30 seconds for unit to fully shut down. | ||
|
|
||
|  | ||
|
|
||
| ```{warning} | ||
| Unplugging power from the emonPi without following the correct shutdown procedure can result in a corrupted SD card. | ||
| ``` | ||
|
|
||
| ## 9. Video Guide | ||
| <div class='videoWrapper'> | ||
| <iframe width="560" height="315" src="https://www.youtube.com/embed/6SB4fRYQjno" frameborder="0" allowfullscreen></iframe> | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Modifications | ||
|
|
||
| ## Adding a Real Time Clock (RTC) | ||
|
|
||
| The emonPi updates its internal linux time via NTP when connected to the internet. However, if the emonPi is used in an offline network, or an accurate time stamp is essential, a hardware Real Time Clock (RTC) can easily be added to the Pi's GPIO. We have tested using a [DS3231 based RTC module](http://thepihut.com/products/mini-rtc-module-for-raspberry-pi). This RTC module communicates with the emonPi via I2C, it can be easily connected as follows by soldering a five-pin header onto the emonPi aux GPIO pins: | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| Once connected, check it's detected on the I2C bus by running: | ||
|
|
||
| sudo i2cdetect -y 1 | ||
|
|
||
| If the RTC is successfully detected it should return the following: | ||
|
|
||
|  | ||
|
|
||
| **0x27** is the emonPi's I2C LCD display and 0x68 is the RTC module. | ||
|
|
||
| To setup the DS3231 RTC: | ||
|
|
||
| git clone https://github.com/Seeed-Studio/pi-hat | ||
| cd pi-hats/tools | ||
| sudo ./install.sh -u rtc_ds3231 | ||
| sudo reboot | ||
|
|
||
| When the RTC has been successfully installed, the output of `sudo i2cdetect -y 1` should show "UU" insted of "68" that is showed previously before the RTC was installed. | ||
|
|
||
| Read hardware clock and print result | ||
|
|
||
| sudo hwclock -r | ||
|
|
||
| Set the system time from the hardware clock | ||
|
|
||
| sudo hwclock -s | ||
|
|
||
| Set the hardware clock from the current system time | ||
|
|
||
| sudo hwclock -w | ||
|
|
||
| Access help for more usage | ||
|
|
||
| hwclock --help | ||
|
|
||
| ## LightWaveRF OOK | ||
|
|
||
| *Guide below copied for posterity from old wiki, we havent tried this for some time and the steps below may need modification to work on more recent emonSD images.* | ||
|
|
||
| [OOK (On-Off-Keying)](http://en.wikipedia.org/wiki/On-off_keying) is a simple RF modulation commonly used by RF controled remote plugs. With the addition of a OOK module the emonPi can be used to control RF plugs. | ||
|
|
||
| This documentation is focused on controlling LightWaveRF plugs & dimmers however it would possible to control other OOK plugs with the correct protocol e.g FS20. The LightWaveRF OOK protocol has been reverse engineered and open-sourced. | ||
|
|
||
| There is a development comunity at [http://lightwaverfcommunity.org.uk](http://lightwaverfcommunity.org.uk). | ||
|
|
||
| Thanks to [Lawrie Griffiths](https://github.com/lawrie)/[Geek Grandad blog](https://geekgrandad.wordpress.com) for creating [LightWaveRF Arduino library](https://github.com/lawrie/LightwaveRF) and porting it to [Raspberry Pi with MQTT service](https://github.com/openenergymonitor/lightwaverf-pi). | ||
|
|
||
| The OOK transmitter footprint is (from left to right): ANT, 5V, D6 + (on emonPi V1.6 GPIO18 / Pin 12), GND. | ||
|
|
||
| The OOK transmitter data line is connected to Dig 6 of ATmega328 and on current rev of emonPi (V1.6 - sold since Nov 2015) the OOK is also be connected directly to to GPIO 18 (pin 12) and the antenna connection of the OOK module can be jumpered to share the main SMA emonPi antenna. | ||
|
|
||
| OOK Tx module footprint on emonPi V1.6: | ||
|
|
||
|  | ||
|
|
||
| OOK Tx module hacked onto the older emonPi V1.5 (sold pre Nov 2015), the white wire connects to OOK RF antenna to the SMA antenna. A separate antenna could be used. The red wire connects the OOK Data pin to GPIO 18 (labeled G18): | ||
|
|
||
|  | ||
|
|
||
| Installation (process needs review): | ||
|
|
||
| git clone https://github.com/lawrie/lightwaverf-pi.git | ||
| cd lightwaverf-pi | ||
| make | ||
| sudo make install | ||
| sudo service lwrfd start | ||
| sudo update-rc.d lwrfd defaults | ||
|
|
||
| LWRF plugs can be controlled by publishing to 'lwrf' MQTT topic. | ||
|
|
||
| The message format is `<channel> <command> [<level>]`, where channel is 1-16, command is 0-2 (2 means mood), and level is 0-31 (used for dimmers). | ||
|
|
||
| E.g publishing “1 1” to 'lwrf' topic turns channel 1 on and “1 0” turns it off. | ||
|
|
||
| Plugs can be paired with the emonPi in the usual LightwaveRF way: Either press and hold pairing button (if button exists) or turn on the plug from main power and send 'on' command. Most LightWaveRF plugs allow multiple (up to 6) control devices to be paired. | ||
|
|
||
| To reset the plug and delete all pairing, press and hold the pairing button to enter pairing mode, then press and hold again to erase memory. Then press (don't hold) once to confirm. For plugs without a pairing button, turn on the plug from the mains power, then in the first few seconds, press the 'all off' button on the RF remote. | ||
|
|
||
| **Emulate Remote** | ||
|
|
||
| The LightWaveRF Pi MQTT emulates a LightWaveRF remote with the following default ID: `byte id[] = {0x6f,0xed,0xbb,0xdb,0x7b,0xee};`. If you want to be able to control your plugs with either YOUR LightWaveRF remote or the emonPi you will need to capture the unique ID of your remote. To do this you will need an [OOK receiver module](http://uk.rs-online.com/web/p/lower-power-rf-modules/6172044) and an Arduino running the [lwrf receive sketch](https://github.com/lawrie/LightwaveRF/tree/master/examples/lwreceive). The ID is the last 6 bytes of the transmission. Once captured replace the ID in [mqrfmqtt.c](https://github.com/lawrie/LightwaveRF/tree/master/examples/lwreceive) with your remote's ID then recompile (make, sudo make install). | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Use in North America | ||
|
|
||
| The emonPi / emonTx hardware units are designed for use on single-phase systems. However, the they can be used on a North American Split-Phase system with the following considerations: | ||
|
|
||
| ## 1. Ensure clip-on CT sensor will fit your conductors | ||
|
|
||
| Typical residential Service Entrance Wires are AWG 2/0 Copper or AWG 4/0 Aluminium. The opening in the [standard clip-on CT sensor sold in the OpenEnergyMonitor shop](http://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/) is **13mm**, and hence can accommodate a maximum wire size of **AWG 1/0**. Therefore, we recommend you measure the diameter of your feeders before purchasing a CT sensor. | ||
|
|
||
| If the standard CT sensor does not fit your conductors there are two options: | ||
|
|
||
| 1. Use an [Optical Pulse Sensor](https://shop.openenergymonitor.com/optical-utility-meter-led-pulse-sensor/) instead of CT sensor to interface directly with a utility meter. This will give an accurate reading of energy consumed (kWh) but will not provide a real-time power reading (W). | ||
|
|
||
| 2. Use an alternative larger CT sensor: It's possible to obtain larger CT sensors. However, using an alternative CT will usually require re-calibration and possibly, hardware modification (burden resistor may need replacement). See [Learn > emonTx in North America](../electricity-monitoring/ac-power-theory/use-in-north-america.md) for more info. Please search / post on the [community forums](https://community.openenergymonitor.org) for further assistance. | ||
|
|
||
| ```{warning} | ||
| Installing clip-on CT sensors on USA electrical systems should only by undertaken by a professional electrician. In a typical residential installation, even if the main breaker is switched off, the load center Service Entrance Wires and bus bars are always live. | ||
| ``` | ||
|
|
||
| ## 2. Use USA AC-AC Adapter | ||
|
|
||
| Use the [USA AC-AC voltage sensor adapter sold via the OpenEnergyMonitor Shop](http://shop.openenergymonitor.com/ac-ac-power-supply-adapter-ac-voltage-sensor-us-plug). The system has been calibrated to work with this adapter. Using any other adapter will usually require re-calibration. | ||
|
|
||
| ## 3. Software Calibration | ||
|
|
||
| a) emonPi: Set EmonHub USA Calibration in the `[[RFM2Pi]]` interfacer section of `emonhub.conf` set: `calibration=110v`. | ||
|
|
||
| `emonhub.conf` can be edited directly in local Emoncms as described in [EmonHub > Overview](../emonhub/overview.md). See [[[RFM2Pi]] section of emonHub configuration guide](../emonhub/configuration.md) for advanced emonhub config info. | ||
|
|
||
| b) emonTx: Enable USA calibration using [on-board DIP switch](../emontx3/configuration.md) | ||
|
|
||
| ## 4. Sum power values | ||
|
|
||
| If monitoring a split-phase system the power values from each leg can be summed in Emoncms to calculate the total power. | ||
|
|
||
| The emonPi by default reports `power1_plus_power2`, this input will need to be logged to a feed. See [Setup > Logging Locally](../emoncms/intro-rpi.md). | ||
|
|
||
| If using emonTx then the power values from multiple CT inputs can be summed in Emoncms using `+ feed` Input Processor. | ||
|
|
||
| See [Learn > emonTx in North America](../electricity-monitoring/ac-power-theory/use-in-north-america.md) for further technical info about the USA system. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Pulse counting | ||
|
|
||
|  | ||
|
|
||
| Many meters, including single phase, 3-phase, import and export electricity meters, gas meters, water meters and heat meters, have pulse outputs. The pulse output may be a flashing LED or a relay (typically solid state) or both. | ||
|
|
||
| Using an Optical Pulse Sensor it is possible to detect the LED / IR 'pulse' output from a utility meters. Meters with wired pulse outputs can be connected directly with two wires and usually switch a voltage provided by the monitoring hardware. | ||
|
|
||
| In the case of an electricity meter, a pulse output corresponds to a certain amount of energy passing through the meter (kWh/Wh). For single-phase domestic electricity meters e.g. Elster A100c, each pulse typically corresponds to 1 Wh (1000 pulses per kWh). Water and gas meters will usually be marked to show the quantity of water (litres/gallons) or gas (cubic meters/cubic feet) that each pulse represents. | ||
|
|
||
| - The emonPi has one spare interrupt pulse input as standard (IRQ 1, Dig3) which can be used for pulse counting. | ||
| - This pulse input is accessible via the RJ45 socket. | ||
|
|
||
| Unlike clip-on CT based monitoring, pulse counting is measuring exactly what the utility meter is measuring i.e. what you get billed for. Pulse counting cannot provide an instantaneous power reading like clip on CT sensors can. It is often worthwhile using pulse counting in conjunction with clip on CT sensors to get the best of both techniques. | ||
|
|
||
| The emonPi can simultaneously perform pulse counting and CT based monitoring. | ||
|
|
||
| ```{note} | ||
| Some meters are configured to pulse on both import and export. If your meter is, and you use it for both (e.g. an import meter on a property with grid-connected Solar PV) then you will have difficulty making good use of an optical pulse sensor, as it will not agree with either the meter reading or any CT sensor measurement. | ||
| One possibility is to use the sign (positive or negative) of the output of a CT sensor attached to the meter's input (or output) to distinguish between positive and negative pulses. You can then either reject negative pulses, or count them separately if you wish. | ||
| <a href="https://community.openenergymonitor.org/t/large-discrepancy-between-pulse-counter-and-ct/10561">This community forum discussion</a> contains more information on how to do this. | ||
| ``` | ||
|
|
||
| ## Option 1: Using an Optical pulse sensor | ||
|
|
||
|  | ||
|
|
||
| ```{warning} | ||
| It is advisable to shield the sensor and the meter from bright light as this can adversely affect readings. | ||
| ``` | ||
|
|
||
| 1. Identify your utility meter's pulse output, usually a red flashing LED marked 'kWh'. Stick the sensor over the LED, carefully aligning the hole so the flashing LED shines through clearly. Be sure to clean any dust from the meter face before attaching the sensor. | ||
|
|
||
| 2. Plug sensors RJ45 connector into emonPi / emonTx RJ45 socket. | ||
|
|
||
| ```{warning} | ||
| Ensure the sensor is plugged into the RJ45 socket on the emonPi on the same side as the CT connection jack-plug sockets NOT the Etherent socket. | ||
| ``` | ||
|
|
||
| If installed correctly when the emonPi / emonTx is powered up the pulse sensor LED should flash in sync with the utility meter LED. See video clip: | ||
|
|
||
| *You may need to switch on a large electrical load e.g. kettle to generate some pulses* | ||
|
|
||
| <div class='videoWrapper'> | ||
| <iframe width="560" height="315" src="https://www.youtube.com/embed/vq5EmMRrOY0" frameborder="0" allowfullscreen></iframe> | ||
| </div> | ||
|
|
||
| *Note: If the pulsecount value in emoncms does not increase in line with LED flashes, it maybe that there is light from another source interfering with the pulse detection. Some meters have a plastic cover that makes it quite hard to keep external light away from the pulse sensor. See forum thread [here](https://community.openenergymonitor.org/t/first-try-with-emonpi-pulsecount-stuck-at-1/7375) for more details.* | ||
|
|
||
| ## Option 2: Wired pulse counting | ||
|
|
||
| To connect to a meter with a wired pulse output it's possible to either wire the pulse output cable directly to a RJ45 passthrough connector or to a RJ45 to terminal block adapter. The screenshot below shows an example with a simple RJ45 passthrough connector. | ||
|
|
||
| **RJ45 Pinout**<br> | ||
| The RJ45 implements a standard pinout used by other manufacturers of DS18B20 temperate sensing hardware such as Sheepwalk Electronics. | ||
|
|
||
|  | ||
|
|
||
|  |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # emonPi Technical Overview | ||
|
|
||
| The emonPi is an all-in-one Raspberry Pi based energy monitoring unit making for a simple installation where Ethernet or WiFi is available at the meter location. | ||
|
|
||
| The emonPi can monitor two single-phase AC circuits using clip-on CT sensors. The emonPi can also monitor temperature, and interface directly with a utility meter via an optical pulse sensor. | ||
|
|
||
|  | ||
|
|
||
| **Features:** | ||
|
|
||
| - 2x CT Sensor inputs for single-phase AC electricity monitoring designed for use with the [100A SCT-013-000 CT sensor](https://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/) | ||
| - 1x AC voltage measurement using plug-in AC-AC adapter for real power calculation alongside current measurement from CT sensors. Designed for use with a [9V AC output voltage adapter](https://shop.openenergymonitor.com/ac-ac-power-supply-adapter-ac-voltage-sensor-uk-plug/) | ||
| - Support for multiple wired one-wire DS18B20 temperature sensors via RJ45 socket | ||
| - Support for pulse counting either wired or via Optical Pulse Sensor | ||
| - 433 MHz RFM69 radio transceiver for receiving data from additional energy monitoring or temperature and humidity nodes. | ||
| - The emonPi measurement board is based on Arduino (Atmega328). This talks to an integrated Raspberry Pi running our emonSD software stack on it's SD card. | ||
| - Full local data logging and visualisation capability using the emonSD Emoncms software stack. Data can also be sent to a remote emoncms server such as emoncms.org. | ||
| - Network connectivity via either Ethernet or WiFi. | ||
| - **LCD Display:** for easier setup, displays network IP address and sensor status. | ||
| - **Push button:** for shutdown and enabling/disabling SSH access. | ||
|
|
||
| ## emonPi Internals | ||
|
|
||
| The emonPi is based on a RaspberryPi + emonPi measurement board. The emonPi measurement board is based on an ATmega328p 8-bit microcontroller running Arduino based firmware. The following video gives a good overview of what is inside an emonPi. Note that we currently ship RaspberryPi version 3b+ which has WiFi onboard rather than the older version featured in this video. | ||
|
|
||
| <div class='videoWrapper'> | ||
| <iframe width="560" height="315" src="https://www.youtube.com/embed/lc2LzCZnySo" frameborder="0" allowfullscreen></iframe> | ||
| </div> | ||
|
|
||
| ## System Overview | ||
|
|
||
| The following system diagram shows the main hardware and software components that make up the emonPi. On the left we have the emonPi measurement board based on the ATmega328 microcontroller with inputs from the different sensors, RFM69 433 MHz transceiver, button and I2C connection to the LCD. | ||
|
|
||
| The Atmega328 microprocessor communicates with the Raspberry Pi via the internal UART serial port (/dev/ttyAMA0). | ||
|
|
||
|  | ||
|
|
||
| ### RF | ||
|
|
||
| The emonPi uses the HopeRF RFM69CW RF module to receive data from other wireless nodes (emonTx, emonTH etc) using 433 MHz. We use the [JeeLib packet format](http://jeelabs.org/2011/06/09/rf12-packet-format-and-design/). Each RF node has a unique node ID but common network group (default 210). The ATmega328 runs a modified version of [JeeLabs RFM12Demo Sketch](https://github.com/jeelabs/jeelib/blob/master/examples/RF12/RF12demo/RF12demo.ino) to receive the data from radio nodes. Received radio packets are forwarded over serial and decoded on the RaspberryPi using EmonHub. | ||
|
|
||
| ### Energy Monitoring | ||
|
|
||
| The emonPi measurement board includes input circuitry that converts the outputs from the ACAC adapter and CT sensors into signals that are compatible with the Analog to Digital converter (ADC). The ATmega328's 10-bit ADC samples the voltage and current channels sequentially. The Firmware running on the ATmega328 calculates real power, apparent power, power factor, Vrms and Irms of each channel. The real power reading is then pushed every 5s to the RaspberryPi for logging and visualisation. | ||
|
|
||
| To learn more about how the electricity monitoring works, see our Learn site here: | ||
|
|
||
| - [Learn: AC Power Theory](https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction) | ||
| - [Learn: CT Sensors, interfacing with an Arduino](https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/interface-with-arduino) | ||
| - [Learn: Measuring AC Voltage with an AC to AC power adapter](https://learn.openenergymonitor.org/electricity-monitoring/voltage-sensing/measuring-voltage-with-an-acac-power-adapter) | ||
|
|
||
| The full emonPi measurement board firmware can be accessed and downloaded here: | ||
|
|
||
| - [emonPi Discrete Sampling Firmware](https://github.com/openenergymonitor/emonpi/tree/master/firmware) | ||
| - The firmware uses the [EmonLib Discrete Sampling Library](https://github.com/openenergymonitor/EmonLib/) | ||
|
|
||
| The CT input's are designed for use with the [100A SCT-013-000 CT sensor](https://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/). This sensor has 2000 turns, which means that the current in the secondary is 2000 less than the current in the mains wire primary. The emonPi has a fixed sized burden resistor specified to match this sensor at 22 Ohms. It is possible to change this burden resistor if you wish to use a CT with a different current range or number of turns. | ||
|
|
||
| ### Pulse Counting | ||
|
|
||
| Pulse counting on the emonPi uses the hardware interrupt IRQ1 on the ATmega328. The first hardware interrupt IRQ0 is used by the RFM69CW. Only one pulse counter input is possible per emonTx/emonPi. See guide [+ Add Optical Pulse Sensor](pulse_counting.md) for more information on the optical pulse sensor. | ||
|
|
||
| The emonPi firmware implements a check for a minimum pulse width, this can be shortened on systems with more frequent pulses, see line: [https://github.com/openenergymonitor/emonpi/blob/master/firmware/emonPi_DS_jeelib_classic/main.ino#L96](https://github.com/openenergymonitor/emonpi/blob/master/firmware/emonPi_DS_jeelib_classic/main.ino#L96). | ||
|
|
||
| ## RaspberryPi and emonSD | ||
|
|
||
| The emonPi Raspberry Pi runs our emonSD software stack which is based on [Raspbian Buster Lite](https://www.raspberrypi.org/downloads/raspbian/). The pre-built emonSD image is available to [purchase](https://shop.openenergymonitor.com/emonsd-pre-loaded-raspberry-pi-sd-card/) or [download](../emonsd/download.md) or it is possible to built the image yourself using our automated build script, see [EmonScripts](https://github.com/openenergymonitor/EmonScripts). | ||
|
|
||
| EmonSD includes [emonHub](https://github.com/openenergymonitor/emonhub) which reads in the serial data from the emonPi measurement board and acts as a broker forwarding this data on to the local installation of emoncms via MQTT or to a remote server such as emoncms.org via HTTP. | ||
|
|
||
| [Emoncms](https://github.com/emoncms/emoncms) is our open source web application for processing, logging and visualising energy, temperature and other environmental data. It is installed as part of the emonSD software stack and provides full local data logging and visualisation capabilities. | ||
|
|
||
| ## Open Source | ||
|
|
||
| **emonPi Firmware** (see [Firmware Modification](../electricity-monitoring/platformio/index.md)<br> | ||
| [emonPi Discrete Sampling Firmware](https://github.com/openenergymonitor/emonpi/tree/master/firmware) | ||
|
|
||
| **emonPi Schematic and Board files:**<br> [https://github.com/openenergymonitor/emonpi/tree/master/hardware/emonpi/emonpi_V1_6](https://github.com/openenergymonitor/emonpi/tree/master/hardware/emonpi/emonpi_V1_6) | ||
|
|
||
| --- | ||
|
|
||
| ## emonPi Specification | ||
|
|
||
| | Attribute | Parameter | Link | | ||
| |---|---|---| | ||
| | Error due to component and sensor tolerances | <11% | [Further info](https://openenergymonitor.org/emon/buildingblocks/emontx-error-sources) | ||
| | Measuring Current (CT) |50mA-96A | [Further info](https://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface) | ||
| | Measuring Voltage (AC-AC) | 1st: 110VAC-254VAC / 2nd: 9VAC-12VAC| [Further info](https://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter) | ||
| | Sample period | 5s | [Discrete sampling](https://github.com/openenergymonitor/emonpi/blob/master/firmware/firmware/firmware.ino) | ||
| | Frequency | 433Mhz | [Identify RF module](https://openenergymonitor.org/emon/buildingblocks/which-radio-module) | ||
| | RF range | 40m-100m | [Antenna testing](https://blog.openenergymonitor.org/2014/03/emontx-v3-antenna-testing/) | ||
| | Power Consumption | 1.5W-2.5W RasPi2 / 2W-4W RasPi3 | | ||
| | Operating temperature | -25 to +80 DegC | [Further info](https://www.raspberrypi.org/help/faqs/#performanceOperatingTemperature) | ||
| | Physical Dimensions | 10cm x 8.5cm x 10cm | | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Temperature sensing | ||
|
|
||
| The emonPi supports temperature sensing using DS18B20 one-wire digital temperature sensors. The standard firmware on the emonPi supports up to 6x temperature sensors. | ||
|
|
||
| The emonPi has a special RJ45 socket to which either a single RJ45 DS18B20 temperature sensor can be connected directly or multiple sensors can be connected via either a RJ45 breakout board or terminal block breakout board. | ||
|
|
||
| ## Example: 4x temperature sensors and a RJ45 breakout | ||
|
|
||
|  | ||
|
|
||
| - [Shop: RJ45 Encapsulated DS18B20 temperature sensor](http://shop.openenergymonitor.com/rj45-encapsulated-ds18b20-temperature-sensor/) | ||
| - [Shop: emonPi / emonTx RJ45 Expander for DS18B20 & Pulse Sensors](https://shop.openenergymonitor.com/rj45-expander-for-ds18b20-pulse-sensors/) | ||
| - [An RJ45 coupler can be used to extend RJ45 sensor cables.](http://www.sheepwalkelectronics.co.uk/product_info.php?cPath=26&products_id=36) | ||
|
|
||
| ## RJ45 Pinout | ||
|
|
||
| The RJ45 implements a standard pinout used by other manufacturers of DS18B20 temperate sensing hardware such as Sheepwalk Electronics. | ||
|
|
||
|  | ||
|
|
||
| *Note: The RJ45 socket does not support power supply switching via Dig19 (ADC5) as described above.* | ||
|
|
||
| ## Further reading | ||
|
|
||
| If you are using temperature sensors with heating systems such as heat pumps the following blog post by John Cantor provides a number of useful mounting suggestions: [John Cantor's Blog: Temperature sensors for monitoring heat pumps](https://heatpumps.co.uk/2015/06/08/temperature-sensing-with-openenergymonitor) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?php | ||
|
|
||
| // Update Emoncms database | ||
|
|
||
| $applychanges = true; | ||
|
|
||
| define('EMONCMS_EXEC', 1); | ||
| chdir("/var/www/emoncms"); | ||
| require "process_settings.php"; | ||
| require "core.php"; | ||
| $mysqli = @new mysqli($server,$username,$password,$database); | ||
|
|
||
| require_once "Lib/dbschemasetup.php"; | ||
| print json_encode(db_schema_setup($mysqli,load_db_schema(),$applychanges))."\n"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [platformio] | ||
| default_envs = default | ||
| src_dir = . | ||
| #lib_dir = ../libraries | ||
|
|
||
| [env:default] | ||
| platform = atmelavr | ||
| framework = arduino | ||
| board = uno | ||
| monitor_speed = 115200 | ||
| lib_deps = | ||
| OneWire | ||
| DallasTemperature | ||
| https://github.com/openenergymonitor/EmonLibCM | ||
| https://github.com/openenergymonitor/RFM69_LPL | ||
| https://github.com/openenergymonitor/RFM69_JeeLib#atmega | ||
| https://github.com/openenergymonitor/emonEProm | ||
| https://github.com/openenergymonitor/LiquidCrystal_I2C |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # emonPi_CM | ||
|
|
||
| **New 16th Feb 2023:** This firmware provides higher accuracy continuous monitoring. Continuous monitoring means that the power readings are representative of the full 10s period that they represent rather than a short snapshot. Support for radio formats: JeeLib Native and **LowPowerLabs (recommended)**. | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,6 @@ | |
|
|
||
| **Raspberry Pi Energy Monitoring Shield** | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,3 @@ | |
| # Disable SSH | ||
| sudo update-rc.d ssh disable | ||
| sudo invoke-rc.d ssh stop | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,25 @@ | ||
| # Systemd unit file for emonPiLCD script | ||
| # installation is done via the install.sh script in the same folder | ||
| # VIEW STATUS | ||
| # systemctl status emonPiLCD | ||
| # VIEW LOG | ||
| # journalctl -f -u emonPiLCD | ||
|
|
||
| [Unit] | ||
| Description=emonPi LCD driver | ||
| After=mosquitto.service | ||
|
|
||
| [Service] | ||
| User=pi | ||
| PIDFile=/var/run/emonpilcd.pid | ||
| Environment='LOG_PATH=/var/log/emonpilcd' | ||
| ExecStart=/usr/bin/python3 /opt/openenergymonitor/emonpi/lcd/emonPiLCD.py --logfile=${LOG_PATH}/emonpilcd.log | ||
| PermissionsStartOnly=true | ||
| ExecStartPre=/bin/mkdir -p ${LOG_PATH}/ | ||
| ExecStartPre=/bin/chgrp -R pi ${LOG_PATH}/ | ||
| ExecStartPre=/bin/chmod 775 ${LOG_PATH}/ | ||
| Type=simple | ||
| Restart=always | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |