Close

Second prototype

A project log for MI/O

Tiny microcontroller dev board, wristwatch and timer "It's not a smart watch, it's a watch for smart people"

m-bindhammerM. Bindhammer 05/02/2020 at 22:270 Comments

After testing the first prototype a couple of days I decided to start working on a second prototype with some improvements. Biggest one: The I2C pullup resistors can now be disabled to prevent "phantom powering" of the connected devices. Means also I have to desolder the two pullup resistors on the OLED breakout before assembling it on the main board. Should provide a significant improvement of the running time when powered by a coin cell. The watch should now be operated for at least one week with a freshly charged LIR2032H coin cell. I have already discarded the idea to power the watch by a conventional 3V coin cell. The voltage is too close to the brownout detection threshold of 2.7V.

Screenshot of the top. Two SOT-23 p-channel mosfets and a resistor added:

Screenshot of the bottom. Some symbols added to be able to sell the board in Europe:

As usual I used a stencil, low temperature melting soldering paste and a hot air gun to populate the board. Some soldering was done directly with a soldering iron. I am very satisfied with the result, looks like machine made:

I replaced the normal female pin headers on the backside by 2.54mm machine pin female headers - single row, 1 x 8, round pin, H3.0, L7.4 - horizontal, SMT, as they have less mounting height respectively length and are more precise.

Below you can see the discharge curve over time of a freshly charged LIR2032H coin cell. FEP (Functional End Point) is reached at 2.7V when BOD  (Brown-Out Detection) threshold is reached. Possibly further improvements can be achieved via software, for example putting the ATmega 328P into sleep mode (not done yet).

Other than mentioned in the data sheet, it still seems possible to set the brownout detection threshold to 1.8V. To do this, proceed as follows.

First we have to modify the boards.txt file. This file can be usually found in folder C:\Program Files (x86)\Arduino\hardware\arduino\avr. Open the boards.txt file, search for the section where the different Arduino Pro Mini boards/processors are defined and copy/paste the following block as a new definition of an Arduino Pro Mini into the section of the boards.txt file.

## Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328 BOD at 1.8V
## --------------------------------------------------
pro.menu.cpu.8MHzatmega328bod1v8=ATmega328 (3.3V, 8 MHz, 1V8 BOD)

pro.menu.cpu.8MHzatmega328bod1v8.upload.maximum_size=30720
pro.menu.cpu.8MHzatmega328bod1v8.upload.maximum_data_size=2048
pro.menu.cpu.8MHzatmega328bod1v8.upload.speed=57600

pro.menu.cpu.8MHzatmega328bod1v8.bootloader.low_fuses=0xFF
pro.menu.cpu.8MHzatmega328bod1v8.bootloader.high_fuses=0xDA
pro.menu.cpu.8MHzatmega328bod1v8.bootloader.extended_fuses=0x06
pro.menu.cpu.8MHzatmega328bod1v8.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex

pro.menu.cpu.8MHzatmega328bod1v8.build.mcu=atmega328p
pro.menu.cpu.8MHzatmega328bod1v8.build.f_cpu=8000000L

Save the boards.txt file at the same location and close it.

Re-start the Arduino IDE. Go to Tools. Choose Board: "Arduino Pro or Pro Mini", Processor: "ATmega328 (3.3V, 8 MHz, 1V8 BOD)" and  Programmer: "Arduino as ISP".

To burn the bootloader and thus set the extended fuses from default 2.7V down to 1.8V, an Arduino Pro Mini (or clone) is required as a programmer and a 3.3V FTDI in addition to the MI/O board. These are wired as shown below:

Once everything is connected (don't forget to set the switch on the MI/O board to external power supply) hit Burn Bootloader. This warning may appear:

avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xFE instead of 0x06 (double check with your datasheet first).

 In this case open boards.txt file again and replace 0x06 with 0xFE at the appropriate position, save, restart Arduino IDE and repeat Burn Boatloader with the already mentioned settings. 0x06 = 0000 0110 and 0xfe = 1111 1110 but unused fuse bits often read back as 1 and the extended fuses only use the lower 3 bits, so FE will be just fine in place of 06.

The MI/O board is now also able to be powered by a 3V CR2032. By the way, with bootloader MI/O can be programmed directly via FTDI:

After I bought a multimter with much better resolution, I was finally able to measure the exact power consumptions:

Power consumption standby:

Power consumption during time and date reading:

Discussions