Difference between revisions of "EmonTx Arduino Shield"
Glyn.hudson (talk | contribs) |
Glyn.hudson (talk | contribs) |
||
Line 65: | Line 65: | ||
'''RFM12B Slave Select (SS)''' - The left hand solder jumper determines which Arduino digital I/O is used for the RFM12B SS pin. In order to use the [http://github.com/jcw/jeelib JeeLib library] out of the box this should be connected to 10 as shown in the [http://wiki.openenergymonitor.org/index.php?title=File:EmonTx_Shield_top2D.png image above]. However if Digital 10 is required by another shield (e.g Arduino Ethernet) Digital 5 can be used by connecting the solder jumper up the other way. | '''RFM12B Slave Select (SS)''' - The left hand solder jumper determines which Arduino digital I/O is used for the RFM12B SS pin. In order to use the [http://github.com/jcw/jeelib JeeLib library] out of the box this should be connected to 10 as shown in the [http://wiki.openenergymonitor.org/index.php?title=File:EmonTx_Shield_top2D.png image above]. However if Digital 10 is required by another shield (e.g Arduino Ethernet) Digital 5 can be used by connecting the solder jumper up the other way. For pin 5 to be used as the SS pin the line <code> rf12_set_cs(5) </code> must be added before rf12 initialise in void setup. The following lines must also be added to RF12.cpp in the JeeLib library in the <syntaxhighlight lang="cpp"> void rf12_set_cs(uint8_t pin) </syntaxhighlight> function: | ||
<syntaxhighlight lang="cpp"> | |||
if (pin==5) | |||
{ | |||
cs_pin = 5; //PD5 | |||
#define SS_DDR DDRD | |||
#define SS_PORT PORTD | |||
} | |||
</syntaxhighlight> | |||
Alternatively Digital 9 or Digital 8 can more easily be used as the SS pin without need to modify the JeeLib library. Just leave the solder jumper un-connected and run a wire from the pad next to the middle pad on the solder jumper to either digital 9 or 8 and add the line <code> rf12_set_cs(8) </code> or <code> rf12_set_cs(9) </code> before rf12 initialise in void setup. Modifying the JeeLib library is not needed since Digital 8,9 and 10 are all on Port B while Digital 5 is on port D. | |||
'''RFM12B Interrupt''' - The right hand solder jumper sets the RFM12B interrupt pin. The setting of this jumper depends on which Arduino board the shield is connected. The RFM12B interrupt line must be connected to INT0 this is Digital 2 for Arduino Uno/Duemilanove or Digital 3 for Arduino Leonardo. | '''RFM12B Interrupt''' - The right hand solder jumper sets the RFM12B interrupt pin. The setting of this jumper depends on which Arduino board the shield is connected. The RFM12B interrupt line must be connected to INT0 this is Digital 2 for Arduino Uno/Duemilanove or Digital 3 for Arduino Leonardo. |
Revision as of 15:44, 22 October 2012
emonTx Arduino Shield
An open-hardware wireless energy monitoring Arduino compatible (Duemilanove,Uno and Leonardo) shield.


See non-invasive section of building blocks for theory behind CT energy monitoring.
Overview
- Apparent Power, Real Power*, Power Factor* and AC RMS voltage readings*
- 4 x CT Current Sensor input
- AC 9V RMS voltage sensor input
- 433/868Mhz RFM12B (HopeRF) wireless transceiver to transmit/receive data to other OpenEnergyMonitor and JeeNode modules
- On-board DS18B20 digital temperature sensor (not included as standard)
- Status LED
- Compatible with Duemilanove,Uno and Leonardo
- Compatible with OpenEnergyMonitor modules (emonGLCD, emonBase - NannodeRF etc.)
* with 9V AC adapter
Design Files & Part List
- 10 x 470K (yellow, violet, yellow, gold)
- 5 x 10uF
- 4 x 33R 1% (orange, orange, black, gold, brown)
- 4 x 10K 1% (brown, black, black, red, brown)
- 4 x 4K7 (yellow, violet, red, yellow, gold)
- 4 x 3.5mm jack (Rapid: 20-0157)
- 1 x 0.1uF (100nF)
- 1 x 470R (yellow, violet, brown, gold)
- 1 x 100K 1% (brown, black, black yellow, brown)
- 1 x 2.1mm DC barrel
- 1 x RFM12B 868/433Mhz (HopeRf)
- 1 x 82mm/165mm Ant
- 1 x 3mm LED
- 1 x DS18B20 temperature sensor (optional - not included as standard)
- 1 x 6 pin ISP header (female)
- 2 x 6 pin header*
- 2 x 8 pin header*
* or 1 x 28 pin header
See OpenEnergyMonitor Shop for recommended CT and recommended plug-in AC-AC adapter
See building blocks for more information on CT's and AC-AC adapters.
The emonTx Shield schematic and board design in Eagle CAD format can be viewed and downloaded from the emonTx Shield SolderPad Git Repo
Build Guide
Follow the component labels on the PCB using the part list above to identify the components and the completed build photo below to double check the correct placement:
Hardware Setup Instructions
On the top of the board there are two solder jumpers which need to be connected before emonTx Shield can operate. To make connection the middle solder pad should be connected with a blob of solder to either the left of right solder pad, depending on the connection required. The solder can be re-melted and adjusted at a later date if required.
RFM12B Slave Select (SS) - The left hand solder jumper determines which Arduino digital I/O is used for the RFM12B SS pin. In order to use the JeeLib library out of the box this should be connected to 10 as shown in the image above. However if Digital 10 is required by another shield (e.g Arduino Ethernet) Digital 5 can be used by connecting the solder jumper up the other way. For pin 5 to be used as the SS pin the line rf12_set_cs(5)
must be added before rf12 initialise in void setup. The following lines must also be added to RF12.cpp in the JeeLib library in the <syntaxhighlight lang="cpp"> void rf12_set_cs(uint8_t pin) </syntaxhighlight> function:
<syntaxhighlight lang="cpp"> if (pin==5) { cs_pin = 5; //PD5 #define SS_DDR DDRD #define SS_PORT PORTD
}
</syntaxhighlight>
Alternatively Digital 9 or Digital 8 can more easily be used as the SS pin without need to modify the JeeLib library. Just leave the solder jumper un-connected and run a wire from the pad next to the middle pad on the solder jumper to either digital 9 or 8 and add the line rf12_set_cs(8)
or rf12_set_cs(9)
before rf12 initialise in void setup. Modifying the JeeLib library is not needed since Digital 8,9 and 10 are all on Port B while Digital 5 is on port D.
RFM12B Interrupt - The right hand solder jumper sets the RFM12B interrupt pin. The setting of this jumper depends on which Arduino board the shield is connected. The RFM12B interrupt line must be connected to INT0 this is Digital 2 for Arduino Uno/Duemilanove or Digital 3 for Arduino Leonardo.
For more information on RFM12B connection to Arduino see this this building block section
Port Map
Function | Arduino Port |
---|---|
9V AC sample | ADC0 |
CT 1-4 | ADC 1-4 |
DS18B20 Temperature | Dig4 |
LED | Dig9 |
RFM12B SS | Dig10 (recommended) / Dig5 |
RFM12B INT | Dig3 Leonardo / Dig2 Uno |
Example Arduino Sketches
See emonTx Shield Folder in emonTx Firmware examples GitHub Repo
Follow instructions on the GitHub readme for required Arduino libraries