-
-
I tried to replace this magnetic buzzer by piezo but it does not work, it makes no sound, found explanation here https://www.murata.com/en-eu/support/faqs/sound/sounder/char/sch0007 - "You cannot produce a sound from a piezoelectric sounder by simply replacing an electromagnetic buzzer with a piezoelectric sounder in this circuit."
I also found another buzzer from similar cheap tracker tag and that one is 15ohm and is much louder. sadly it is also quite a bit bigger so won't fit inside. It looks like this one https://www.aliexpress.com/i/1005005047243506.html
Anyway the one on the board posted by parasquid is still not that bad, the other boards have the 10 ohm resistor replaced by higher values and those are more quiet. Also I don't see diode there.
As for the SPI flash pinout on the cheap NFCBoxLink ones I got last time - it really matches USON-8 package - VCC,GND,/WP,/HOLD pins are all in correct place and VCC, GND are connected. It is same SPI flash package as used on Raspberry Pico board - found 2MB chips here https://www.aliexpress.com/item/1005004379141351.html - will try to kill at least one NFCBoxLink board by adding it via reflowing by hot air. It is not that much useful there, I know, but still :-)
-
So it is not piezo but something called magnetic buzzer, matches this picture and description https://www.aliexpress.com/item/1649570962.html
EDIT: or this https://www.quartz1.com/price/techdata/VS5030B.pdf
-
not sure what the wiring can be to work like that
it is GND -> some transistor/FET marked Y2, switched by pin D14 -> one side of piezo -> 12ohm piezo/speaker -> 10ohm resistor -> VCC
so 22 ohm in total between VCC and GND when D14 is low (more precisely 22 ohm between VCC and top of the FET)
That is a bit strange because I=U/R = 3/22 ~= 136mA but I guess that battery cannot give more so the rest is internal resistance of battery
EDIT: attached picture - red are both sides of the speaker, R is 10 ohm resistor, V is VCC, G is GND
-
So just to be clear, you actually bought https://www.aliexpress.com/item/1005005726070115.html and that's what is in the picture above?
Yes, exactly. Getting two with untracked shipping would be $9.75 total including VAT and shipping for me. I actually got three with tracked shipping so it was $5.6 a piece :-)
Yes 32mA looks like short, maybe the battery cannot give much more than that, not sure what the wiring can be to work like that.
-
Was checking power consumption to use the CR2032 battery sensibly. Used meter with mA scale with two fractional digits (have better one but couldn't find right cables :-).
- default advertising of 375 ms gives value between 0.02-0.04mA, when changing to 750 it drops to .01-0.00mA
- default connection interval (7.5ms) when connected gives about 0.6mA, when changing to 50 it drops below 0.1mA and is still good enough for interactive console
LED is over 1mA (1.7? forgot exactly), analogWrite drops it down and it is still visible
Piezo (tested with board that parasquid posted in post #5)
- when set to 0 (
D14.reset()
) it draws 32mA (!!) don't do that! - sound done via
analogWrite(0.5,{freq:440})
eats half of that - 16mA(!!) don't do that! analogWrite(0.97,{freq:440})
draws fraction of that (below 1mA?) and I don't hear any difference in loudness (analogWrite(0.03,{freq:440})
of course draws fraction below 32mA and sounds the same)
Did the measurements because I noticed E.getAnalogVref() gives voltage below 2.5V for the tag where I tested the piezo while other gave me 3.0V. So looks like I have basically killed the battery when trying to play sounds :-)
- default advertising of 375 ms gives value between 0.02-0.04mA, when changing to 750 it drops to .01-0.00mA
-
-
Good find, I think we did not have any source and the datasheet did not say much.
When searching github now https://github.com/search?q=hrs3603.c&type=code there is something added about 1 year ago.Often the glue source comes with some linkable library with the HR/BP/SPO2 algorithm, without that you only get raw PPG data.
Also the trick can be with tuning it on the fly so that the PPG data is good quality see this example for VC31 in bangle https://github.com/espruino/Espruino/blob/master/libs/misc/hrm_vc31.c#L268
-
Tried to play some simple tunes via piezo as per https://www.espruino.com/Making+Music and it is not very loud. So these are not like those you stick to lost baggage that make really loud sound. I wanted to pair it with Bangle as alarm clock beep or for some notification alerts but it is too quiet for that. It is louder than piezo in Bangle 1 but not by that much.
Maybe if I make a hole in the body where the piezo is, it will be better.
-
It was good timing. Never tried NFC before but now I am testing those 52832 based keychain NFC tags https://forum.espruino.com/conversations/388395/
They are simple - no sensors, just button, two leds, piezo and NFC, but they are small and cheap and even have 32kHz crystal and DC/DC enabled. Espruino on the keychain is cool and NFC and piezo speaker is a nice bonus, typical smart watch is missing both.
-
I don't have a precise idea yet of what I want to do with it, apart from restoring its time and fitness abilities.
Not sure about the fitness part, not even sure @jeffmer got the heartrate sensor working.
Any other projects on this watch I should know about ?
There is also eucWatch made by @enaon
https://github.com/enaon/eucWatch/tree/main
https://enaon.github.io/eucWatch/I tend to use a lot of closures in my code, and I'm wondering if the overhead of that coding style is going to be significant enough to be a problem.
closures are not an issue but low memory in general is
-
-
I have reported it here https://github.com/espruino/Espruino/issues/2406
Looks like bug as all the allocations and adding termination part uses full length.
Until that is fixed you could also use the code above in post #1 which emulates whole NFC tag including everything.
-
Oh, actually when checking nfcRaw method it has same limitation :-(
https://github.com/espruino/Espruino/blob/master/libs/bluetooth/jswrap_bluetooth.c#L2638
So it is not as raw as one would expect. -
Adding a longer URL just truncate it
you mean you need url over 246 characters?
Any clue on how to fix this ?
I think this line is the issue, it saves length as single byte
https://github.com/espruino/Espruino/blob/master/libs/bluetooth/jswrap_bluetooth.c#L2456
also mentioned here https://github.com/espruino/Espruino/blob/master/libs/bluetooth/bluetooth.h#L335
Most probably this limit is because the SR bit for short record is set in the header so the payload length is really using only 1 byte.Fortunately there is also the
NRF.nfcRaw
where you can build whole array as you wish including short bit cleared and payload length stored in 32 bits.
More info about the structure e.g. here https://w3c.github.io/web-nfc/#the-ndef-record-and-fields
Maybe easiest is to use NFC TagWriter to write such long url over NFC and see how the array looks and start from that and build it with NRF.nfcRaw yourself? -
Yes. When you buy it, it is yours, so you can do anything you want with it including flashing any other firmware you make yourself.
see also https://hackaday.io/project/175577-hackable-nrf52840-smart-watch
EDIT: and BTW since you are starting almost from the scratch just FYI - there are more hackable nrf52840/52832 watches so if you'd rather get different shape, display type, buttons there are some others (also some are quite cheap on aliexpress, one example the Magic3/C17 here ). However Bangle2 is maybe the best one - it has SWD on the back and everything is working including HR sensor which is an issue on other watches, also the screen is always on and sunlight readable which is quite unique.
-
There is a lot to do after doing
device.gatt.connect()
see everything below this https://github.com/espruino/EspruinoWebTools/blob/master/uart.js#L209 -
this https://www.espruino.com/Bangle.js2#resetting-without-loading-any-code does not work? See also next step "Deleting all code" when in this state.
-
-
BTW did you guys get some fake Amiibolink tags with something else inside? There are sellers with suspicious low prices like https://www.aliexpress.com/item/1005005726070115.html
-
variant from this photo https://i.imgur.com/ZUWZ4vp.jpeg - this one looks worse as the opposite side of BLE antenna is populated by components - probably not very good design
just noticed that on this PCB the D16 pin is brought to place with unpopulated something possibly third LED. So if one would sacrifice 2nd LED there would be 2 pins D17,D16 for I2C to possibly add something or use it as serial console.
BTW I flashed Espruino over SWD to this and had my first NFC experience with Espruino, it works quite well :-) I even tried WebNFC in Chrome on Android and it worked too. However for some reason the Samsung Internet browser (based on Chrome too) does not work. I see no error but it does not get any NFC data when I tap it and also it does not ask for NFC permission like Chrome does.
-
But what does seem to help (needs more testing) is for me to pause all BLE operations ie disconnect from the IDE and also pause the BLE scans I am doing in my code.
I came across this article https://jimmywongiot.com/2019/12/15/high-speed-uart-on-nordic-nrf52-series/ that describes similar issue - when using older uart mode which does not use DMA and trigger interrupt after each character sent/received it can happen that bluetooth interrupts with higher priority can cause lost characters.
They discuss much higher baudrates there, however at 115200 sending/receiving one byte should be about 87uS (10bits/115200 ?) which is still pretty short compared to latencies mentioned in that article so it can be the issue.
Current UART code in Espruino is old and shared with nrf51 so it is probably not used in UARTE mode (=with DMA). Here I see only one character is expected when receiving https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L1763
-
Just tried and the SPEAKER definition only defines the SPEAKER_PIN for C source to use.
If one wants to have global SPEAKER object there is extra work to doCheck
https://github.com/search?q=repo%3Aespruino%2FEspruino%20SPEAKER&type=code
how this is done for different boards.Here is MICRORBIT2 way.
-
Just to let you know that I ordered few of them from different sellers and yesterday I got them. Two are exactly the same as the one @parasquid posted and third one is the variant from this photo https://i.imgur.com/ZUWZ4vp.jpeg - this one looks worse as the opposite side of BLE antenna is populated by components - probably not very good design.
First two advertise as AmiLoop, the third one is AMIIBOLINK. My phone with NFC TagInfo sees all of them as NTAG215, the AMIIBOLINK even has some data prefiled out of box. All are nrf52832 so not bad for the price (~US$9 including VAT and shipping). Finally I have some nrf52 devices with NFC to play with :-)
Pixl.js is nrf52832, it has only 1 uart preconfigured to pins D0,D1 https://github.com/espruino/Espruino/blob/master/boards/PIXLJS.py#L23 and https://github.com/espruino/Espruino/blob/master/boards/PIXLJS.py#L113
When you disconnect from BLE the interactive console is switched to Serial and interferes with your usage. You can use
Bluetooth.setConsole(true)
to force interactive console to stay away from serial even when bluetooth is disconnected.