• I couldn't find (maybe missed) any post that anyone tried to replace the vibration motor with a buzzer which I think it's more useful.
    Before opening my precious watch, I'd like to find out whether any buzzer can fit in the space. I couldn't find the dimension of the motor from the technical detail page, so can anyone let me know the size (diameter and thickness) of the motor in the Bangle.js 2?
    Then I would start looking for a buzzer with that size.
    Any comments will be appreciated.
    Thanks,

    J

  • The hole is around 8.4mm but I don't fancy your chances. Even if you found one it's in the middle of the watch so is unlikely to make much noise.

    All I could suggest is maybe you could epoxy a tiny one (10mm or so) to the rear of the watch and put the battery over it, but you might have to look at using a smaller/thinner battery to get the space for it.

  • Thank you, @Gordon for your reply. Well, I'm not sure how loud sound I would get with such a small buzzer (if I could find one) in the middle of the watch fully surrounded by other components in a sealed case. I guess you are suggesting to attach a thin piezo, but I'm not sure how loud it would be without any amplifier which will take up space as well. Maybe I can put some SMD amp where the motor used to be.
    Thanks again. If I make any progress, I will update this post.

    BTW, what's the thickness of the motor?

  • The motor is 2.1mm thick

    The motor itself has an FET driving it, so if you were to replace the motor and use those pins you would have some amplification anyway

  • @Gordon, thanks again for your reply.
    Yeah, that's what I thought about the FET driving the motor. So I was going to ask if there is any schematic I can see. Is there a schematic? Maybe I missed it, but couldn't find one.
    I have used Bangle.js 2 for about 6 months now and really love it. For everyday use with watch and notification, the battery lasts more than 2 weeks. I haven't actually tested, but maybe longer. During the weekend, with my golfing app, I enjoy every feature the Bangle.js 2 has. If I could successfully replace the motor with a buzzer, that will be perfect.
    Thanks!!

  • I guess you are suggesting to attach a thin piezo

    I think piezo may not work "as is" but magnetic buzzer will as it is very similar in principle to motor.
    Similar discussion is in the Amiibo topic https://forum.espruino.com/conversations/388395/?offset=25#17378471
    Some are quite small so I guess this is doable.

  • There's no schematic, no. But there is https://www.espruino.com/Bangle.js2+Technical which does contain a lot of information about it.

    I think piezo may not work "as is"

    Yes, you'd probably have to put a resistor across it at minimum if driving from a FET.

  • Thanks, Gordon.
    I will figure it out.

  • I (finally) opened the watch and attached a 27mm diameter piezo disc (with cutting sides to fit in the case) directly to the pin D43 (UATX) and GND. Even without a MOSFET, it sounded loud enough before reassembling the watch. But after assembling the watch and glued the screen, the sound level decreased significantly as expected. It was kind of an experiment. The piezo disc was not glued to any hard surface (such as inside of the watch back) which is needed for the disc vibrate properly.
    My eventual goal is listed as below.

    1. Modify (redesign and 3D print) the case for bigger battery and serviceability (screws instead of glue) and hard (aluminum maybe) back cover for the piezo disc.
    2. Add a MOSFET driver for the piezo disc using one of the pins, D42 or D43.
    3. Move the buzz motor to side of the watch and glue to the case for better buzz feel.
    4. Add a button switch to one of the extra pins (D42 or D43)
    5. Unfortunately the HRM sensor will be removed due to the back cover with the piezo disc. I don't really need the HRM anyway.

    I wish I had another extra pin for digital input, but I guess there is no more extra pin, is there? If there is one, I could add one more switch. Actually, if I could use 2 DI pins, I could add 3 switches using binary input.

    The reason why I want a bigger battery is for my golfing (golf-gps). Because it needs the GPS on all the time, the battery lasts about 5 hours which is normally fine even if there is some delay on the course. But if there is a longer delay, the watch can't work until the end of the game.
    Just an FYI, the battery usually lasts longer than 3 weeks with normal usage (clock, notifications from the phone, and occasional HRM).

    I'm also very much interested in Gordon's GPS low level communication that he improved the fix time a lot. I'd like to find a way to reduce battery consumption by the GPS, power saving mode or data retrieving frequency adjustment, etc.


    1 Attachment

    • IMG_1080.JPEG
  • How do you drive the piezo in software? Just triggering the output pin in a loop?

    Your wishes for a new case seem similar to mine, maybe you can find some useful information in my thread trying to design a custom case. https://forum.espruino.com/conversations/388860/

  • @halemmerich, yes, I saw your post for the custom case. That looks pretty good.

    Here is the function to drive the piezo.

    function piezoBuzz(pin, frequency, times, duration, pause) {
      let count = 0;
    
      function buzz() {
        if (count < times) {
          analogWrite(pin, 0.5, {
            freq: frequency
          });
          setTimeout(() => {
            analogWrite(pin, 0);
            setTimeout(() => {
              count++;
              buzz();
            }, pause);
          }, duration);
        }
      }
      buzz();
    }
    

    And here is an example to call the function.

    piezoBuzz(D43, 5600, 2, 200, 200); //UATX pin, 5.6kHz, twice, 200ms pulse, 200ms pause
    
  • Nice, I did not know that analogWrite could do PWM with custom frequency.

  • Nice, I did not know that analogWrite could do PWM with custom frequency.

    Yes, analogWrite does the job. You can also change the duty cycle. In my code above, 0.5 after the pin parameter is for 50% of duty cycle.

  • Great! If you had another spare pin (UARX?) you could put the piezo between the two which effectively doubles the voltage swing on it: https://www.espruino.com/NRF52LL#create-a-square-wave-on-pin-d0-with-the-inverse-of-the-square-wave-on-d1-

    Just a thought, but if you're getting rid of the HRM I'd maybe think about drilling out the HRM hole and then gluing the piezo to the back of the case. That way the case would be sealed but you'd have a way for the sound to escape.

    As for extra IO, if you're willing to dig around on the board you might be able to find something. For instance I don't know if GPS BOOT is actually the GPS power signal or some other pin that I haven't noticed so far.

    Or maybe if you're disconnecting the HRM then the pins for that might be on testpoints?

    https://www.espruino.com/Bangle.js2+Technical is a good start but I imagine you found that already!

  • That's interesting to be able to double the voltage. I will take a look. But I still want another extra pin(s) for additional switches, so I will see if I can find any other unused pins.
    @Gordon, I have asked this question before, but if there is a schematic available, it would be easy to trace/find an extra pin. If the schematic is not available for public, can you tell me at least how many layers in the PCB? If it's just 2 layers (top and bottom), I may be able to trace those test points.

    Since I'm not going to use the HRM, I guess I can use some of those pins like HRM_INT, HRM_SDA or HRM_SCL from the connector. Can I get the pinouts of the HRM header?

    Thanks!

  • There's no schematic, no. I believe the PCB is 4 layers so it's not easy to trace out!

    Basically everything I know is in https://www.espruino.com/Bangle.js2+Tech­nical

    But if you find a testpoint, all the pins we know are marked in that doc so you can just try toggling/reading the other pins and see if anything happens?

  • Thank you, Gordon.
    I'll try. It's going to be fun! :)

  • I disconnected the HRM connector and checked each pins to find which is which. So I located 4 pins (D21: HRM_POWER, D22: HRM_INT, D24: HRM_SDA, D32: HRM_SCL). I was excited to see if I could use them as digital input for extra switches. Of course, the HRM power was off.
    But it seems only two pins are allowed to use. I got an error WARNING: No free GPIOTE for watch if I tried to set more than 2 pins as digital inputs as @halemmerich also mentioned HERE.

    I couldn't find any information on the GPIOTE and why I got the errors. Does anyone have any clue?
    Thanks.

    Update:
    It looks like I would need to use nRF52 low level interface library, but have no clue how to use it. Is this the one I need to look at or should I do something else?
    Thanks.

    Update 2:
    So, I guess the GPIOTE (GPIO task and event) has certain limited number. And the pins for the HRM seems to be already taken in the Bootloader or firmware. If this is correct, how can I remove pre-assigned GPIOTE for the HRM?

  • I do occasionally see WARNING: No free GPIOTE for watch on a totally normal Bangle, so I wouldn't worry about it.

    It's complaining about an issue setting a hardware watch with setWatch - but are you actually trying to do that, or are you just reading the pins with digitalRead?

    It's possible that there is an issue with HRM_INT because the firmware may be inserting its own watch on that for the HRM at a lower level? It should still work as a GPIO though, and other pins should be able to be watched

  • Well, I was trying to use the hardware watch, setWactch to monitor switches all the time. I will try with digitalRead and report back.
    Thanks.

  • From the HRM connector header, I could only identify HRM_SDA (D24) and HRM_SCL (D32). I guess the other pins (HRM_INT and HRM_POWER) are gated. It’s hard to trace without removing components which likely damage parts.
    Gordon already answered that the schematic is not available and no answers from anyone for my question about the HRM header pinout, so my guess is Bagle.js’ software is open, but not the hardware.
    I really want just one more pin. Can anyone just let me know whether any of those pins, HRM_INT and HRM_POWER or both, are exposed and accessible on the PCB and where they are if accessible?

    Thanks.

  • So you've got HRM_SDA/HRM_SCL/UARX/UATX - that's 4 pins?

    I don't know of others I'm afraid, but you could always look at using an I2C or OneWire IO expander? You could glue a chip to the PCB and then wire from that to the pins.

    OR if it's just for buttons, connect each button to one IO pin with a resistor to GND, then when you see the IO pin drop to GND in a setWatch, remove the watch, set the pin high and then lower it, and see how long it takes to hit 0 again, and the time taken will depend on the value of the resistor and hence the button.

    Something like:

    function buttonWatch() {
    setWatch(function(a) {
      PIN.set();
      setWatch(function(b) {
        print(b.time - a.time);
        buttonWatch();
      }, PIN, { edge:"falling"});
      PIN.read();
    }, PIN, { edge:"falling"});
    
    buttonWatch();
    

    If it works well enough then potentially you could even use 2^n resistor values so you can detect more than one button being held at a time

  • @Gordon, I was looking for easier and simple solution by using existing pins. I know, I'm lazy. :)
    Your suggested method with resistors looks very interesting. I will definitely try it. I was thinking to use a combination with diodes, but I will see which one works better.
    Thank you Gordon for sharing your brilliant ideas as always.
    I will try a few approaches and report back.

  • also, I think the UARX and UATX pins can be configured as analog IO so you could use buttons with resistors against those for a simple solution also?

  • I think UART are on 42/43 (P1.10,P1.11) which I'm pretty sure aren't analog? It's usually 2..5 + 28..31 and those don't seem on anything that's easily available: https://www.espruino.com/Bangle.js2+Technical

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

[Bangle.js 2] modification: add buzzer, bigger battery, more switches, minus HRM

Posted by Avatar for JeonLab @JeonLab

Actions