• 2nd Prototype Board

    Uri Shaked10/02/2017 at 08:22 0 comments

      I received the 2nd prototype version boards from the fab:

      They have several improvements over the first version:

      1. 5V charge pump for driving the LEDs (TPS60150)
      2. Power for LEDs and hall effect sensors controlled by the CPU
      3. Ground copper pour under the board
      4. Board is now truly symmetric - first version was slightly asymmetric
      5. Tighter grip of the bearing

      These improvements give consistent light output from the LEDs, and enable saving power while the beacon in stand-by mode. The first prototype used about 15mA in standby (4mA by each hall-effect sensor, and another 7 mA by the LEDs), causing the CR2032 batteries to last only for a few hours. 

      Soldering the PCB and trying to run it revealed some issues with the new version. The most prominent one was switching the Enable and Flying Capacitor pins of the 5V Charge pump (TPS60150), which basically rendered it useless, as it was feeding the LEDs around 2.5V instead of 5V. Also, pouring copper below the antenna of the BLE module was not a good idea, as it reduces its performance. I also used the wrong footprint for the Logic Level converter (MC74VHC1GT125), so I had a hard time soldering it.

      I designed a third prototype version of the board to address these issues, and sent it to the fab. meanwhile, I decided to try hacking around the issues by hacking the board:

      You can see how I soldered the capacitor directly to the relevant pin of the TPS60150 (green arrow), and also cut the original trace leading to that pin (the one that goes below the capacitor). I also added a pull-down resistor to the Enable pin (red arrow). This was done in order to ensure the charge pump will start in sleep mode. Otherwise, with the pin floating, it would randomly start before the CPU had a change to pull the line low, causing the LEDs to randomly flicker, sometimes drawing so much power that the CPU could not even start correctly.

      Finally, after fixing the above issues, the board was running smoothly. I tested it with the following code, that would simply alternate between red and blue colors, depending on the magnetic sensor reading:

      // Setup Hall-Effect sensor
      pinMode(D5, 'input_pullup');
      digitalWrite(D4, 1);
      // Setup LEDs
      digitalWrite(D8, 1);
      // Indicate magnetic field by color
      const RED = 0x010000;
      const BLUE = 0x000001;
      setWatch(e => {
         for (let i = 0; i < 10; i++)
           spinner.setPixel(i, e.state ? BLUE : RED, 1);
      }, D5, true);

      This resulted in a very nice pattern:

      I am very happy I managed to produce a functional spinner despite the issues with the board, and already looking forward to getting the next revision of the PCB, which should fix the issues.

      The PCB design files are available on github: https://github.com/urish/spinduino-js/tree/master/PCB

      as well as the Firmware, which is based on Espruino: https://github.com/urish/Espruino/tree/spinduino