diff --git a/firmware/src/src.ino b/firmware/src/src.ino index 86bb722..b8e9d03 100644 --- a/firmware/src/src.ino +++ b/firmware/src/src.ino @@ -101,6 +101,8 @@ const byte DIP_switch2= 8; const byte pulse_countINT= 1; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4 const byte pulse_count_pin=3; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4 #define ONE_WIRE_BUS 17 // D19 emonTH V1.5 +const byte DHT22_PWR= 6; // Not used in emonTH V2.0, 10K resistor R1 connects DHT22 pins +const byte DHT22_DATA= 16; // Not used in emonTH V2.0, 10K resistor R1 connects DHT22 pins. OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); @@ -135,6 +137,16 @@ void setup() { pinMode(LED,OUTPUT); digitalWrite(LED,HIGH); // Status LED on + // Unused pins configure as input pull up for low power + // http://electronics.stackexchange.com/questions/43460/how-should-unused-i-o-pins-be-configured-on-atmega328p-for-lowest-power-consumpt + // port map: https://github.com/openenergymonitor/emonth2/blob/master/hardware/readme.md + pinMode(DHT22_PWR, INPUT_PULLUP); //DHT22 not used on emonTH V2. + pinMode(DHT22_DATA, INPUT_PULLUP); //DHT22 not used on emonTH V2 + pinMode(14, INPUT_PULLUP); + pinMode(20, INPUT_PULLUP); + pinMode(21, INPUT_PULLUP); + pinMode(4, INPUT_PULLUP); + //READ DIP SWITCH POSITIONS - LOW when switched on (default off - pulled up high) pinMode(DIP_switch1, INPUT_PULLUP); pinMode(DIP_switch2, INPUT_PULLUP); diff --git a/hardware/emonTH V2.0.2.brd b/hardware/emonTH V2.0.2.brd index 7c30865..036757b 100644 --- a/hardware/emonTH V2.0.2.brd +++ b/hardware/emonTH V2.0.2.brd @@ -15,34 +15,34 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + diff --git a/hardware/emonTH V2.0.2.sch b/hardware/emonTH V2.0.2.sch index 3805e85..d5f70e2 100644 --- a/hardware/emonTH V2.0.2.sch +++ b/hardware/emonTH V2.0.2.sch @@ -18191,7 +18191,7 @@ You are welcome to use this library for commercial purposes. For attribution, we ATMEGA328 RFM12B RFM1269CW -D17 +D16 DHT22 data Si7020 / HTU21D Temperature & Humidity DHT22 PWR diff --git a/hardware/emonth_V2.0.2_brd.png b/hardware/emonth_V2.0.2_brd.png index 545dc11..5c7aad8 100644 Binary files a/hardware/emonth_V2.0.2_brd.png and b/hardware/emonth_V2.0.2_brd.png differ diff --git a/hardware/emonth_V2.0.2_sch.png b/hardware/emonth_V2.0.2_sch.png index 7c3c0d4..8bde18a 100644 Binary files a/hardware/emonth_V2.0.2_sch.png and b/hardware/emonth_V2.0.2_sch.png differ diff --git a/hardware/readme.md b/hardware/readme.md index c5b500a..ac09e73 100644 --- a/hardware/readme.md +++ b/hardware/readme.md @@ -19,31 +19,31 @@ # Port Map -| | | | | | -|----------------|-----------|------------|-----------------------|-----------------------| -| Arduino | ATmega328 | Function | emonTH V1.5 | emonTH V2 | -| Analog 0 (D14) | PC0 | | | | -| Analog 1 (D15) | PC1 | | 2x AA Battery Voltage | 2x AA Battery Voltage | -| Analog 2 (D16) | PC2 | | | DHT22 Data | -| Analog 3 (D17) | PC3 | | | DS18B20 One-wire Data | -| Analog 4 (D18) | PC4 | (SDA) | DHT22 Data | SI7021 SDA (Data) | -| Analog 5 (D19) | PC5 | (SCL) | DS18B20 One-wire Data | SI7021 SCL (SCK) | -| Analog 6 (D20) | | | | | -| Analog 7 (D21) | | | | | -| Digital 0 | PD0 | (RXD) | FTDI Tx | FTDI Tx | -| Digital 1 | PD1 | (TXD) | FTDI Rx | FTDI Rx | -| Digital 2 | PD2 | (int0) PWM | RFM12B IRQ | RFM69CW IRQ | -| Digital 3 | PD3 | (int1) PWM | Terminal block | Terminal block | -| Digital 4 | PD4 | | | | -| Digital 5 | PD5 | PWM | DS18B20 PWR | DS18B20 PWR | -| Digital 6 | PD6 | PWM | DHT22 PWR | DHT22 PWR | -| Digital 7 | PD7 | | DIP 1 | DIP 1 | -| Digital 8 | PB0 | | DIP 2 | DIP 2 | -| Digital 9 | PB1 | PWM | LED | LED | -| Digital 10 | PB2 | (SS) PWM | RFM12B SEL | RFM69CW SEL | -| Digital 11 | PB3 | (MOSI) PWM | RFM12 SDI | RFM69CW SDI | -| Digital 12 | PB4 | (MISO) | RFM12 SDO | RFM69CW SDO | -| Digital 13 | PB5 | (SCK) | RFM12 SCK | RFM69CW SCK | +| | | | | +|----------------|-----------|------------|-----------------------| +| Arduino | ATmega328 | Function | emonTH V2 | +| Analog 0 (D14) | PC0 | | | +| Analog 1 (D15) | PC1 | | 2x AA Battery Voltage | +| Analog 2 (D16) | PC2 | | DHT22 Data | +| Analog 3 (D17) | PC3 | | DS18B20 One-wire Data | +| Analog 4 (D18) | PC4 | (SDA) | SI7021 SDA (Data) | +| Analog 5 (D19) | PC5 | (SCL) | SI7021 SCL (SCK) | +| Analog 6 (D20) | | | | +| Analog 7 (D21) | | | | +| Digital 0 | PD0 | (RXD) | FTDI Tx | +| Digital 1 | PD1 | (TXD) | FTDI Rx | +| Digital 2 | PD2 | (int0) PWM | RFM69CW IRQ | +| Digital 3 | PD3 | (int1) PWM | Terminal block | +| Digital 4 | PD4 | | | +| Digital 5 | PD5 | PWM | DS18B20 PWR | +| Digital 6 | PD6 | PWM | DHT22 PWR | +| Digital 7 | PD7 | | DIP 1 | +| Digital 8 | PB0 | | DIP 2 | +| Digital 9 | PB1 | PWM | LED | +| Digital 10 | PB2 | (SS) PWM | RFM69CW SEL | +| Digital 11 | PB3 | (MOSI) PWM | RFM69CW SDI | +| Digital 12 | PB4 | (MISO) | RFM69CW SDO | +| Digital 13 | PB5 | (SCK) | RFM69CW SCK | # BOM