Last week we looked at SoftI2C so we could use an I2C EEPROM on any of our AVR’s pins and now it’s time to apply that to the Standalone Temperature Logger as the internal EEPROM of 512 bytes is a bit limiting.
Identifying the pins to apply I2C to
The first step is to identify which 2 pins we can use, we rule out the USB pins PB1 and PB2. After some testing I found PB0 for the clock and PB4 for the data seem to work well. In SoftI2C the clock is only ever an output, we have a line like that already, the LED one PB0. The data line changes between an input with pull-up resistor and output, we also have a 100k pull-down to ground which you’d think should affect the pull up but we’ll see why it shouldn’t.
The reason it shouldn’t is because the internal pull-up resistor is between 20K and 50K per the datasheet page 167. Since it’s a low value resistor compared to our 100k resistor it makes a desirable voltage divider.
I’m thinking about updating the Standalone Temperature Logger to use an external EEPROM and since one of the ATtiny85 pins which correspond to hardware I2C/TWI is used by V-USB, a software implementation is the way to go. I found Soft I2C Master in Arduino code which allows any 2 pins to behave as an I2C interface.
The Non-Contact Blackout Detector has been updated to v1.1. The PCB got etched and you can see that the back of the board has a block of exposed copper which acts as our AC interference detector, it’s not as good as using wire. I’ve placed it into a small container.