all | audio | badgelife | breakout | clocks | displays | experiments | feather | handhelds | home automation | howto | LED art | misc | props | robots | sewing | software | tools | no_category

New PCB For Calculator Watch

I like to call this my smart watch, as it can calculate numbers and show the time

I found this calculator watch on aliexpress for under 3 Euros and intend to replace the PCB featuring an ARM chip, mainly to learn stuff. The LCD stays and I want to find out how to connect it.

New PCB For Calculator Watch | rev1

2023-11-16 18:27:20

The first version was doomed from the beginning, since I had no diodes on the keys. I also swapped the USB micro socket with a JST-SH socket and made a small adapter board instead. Let's see how far I get this time. 

https://cdn.hackaday.io/images/6995871700155584044.png

New PCB For Calculator Watch | rev1

2023-11-16 18:27:20

The first version was doomed from the beginning, since I had no diodes on the keys. I also swapped the USB micro socket with a JST-SH socket and made a small adapter board instead. Let's see how far I get this time. 

https://cdn.hackaday.io/images/6995871700155584044.png

New PCB For Calculator Watch | ugh how did I do it again? LED's get to blink

2021-12-15 21:58:58

This seems to be the setup for my controller and the chip, as the SAML22 works with the at91samd target.

#!/bin/bash

openocd -f interface/cmsis-dap.cfg -f target/at91samdXX.cfg

# in new window

openocd -f bootloader-sensorwatch_m0-v3.7.0-12-gf92e7dc.bin

New PCB For Calculator Watch | ugh how did I do it again? LED's get to blink

2021-12-15 21:58:58

This seems to be the setup for my controller and the chip, as the SAML22 works with the at91samd target.

#!/bin/bash

openocd -f interface/cmsis-dap.cfg -f target/at91samdXX.cfg

# in new window

openocd -f bootloader-sensorwatch_m0-v3.7.0-12-gf92e7dc.bin

New PCB For Calculator Watch | First woopsie on the PCB

2021-10-29 14:59:30

By now I've realised that I forgot to add all the 20 diodes to make the charlie-plexed keyboard function. In the current arrangement there will be no way of telling if I have pressed the button connected to the 1-2 pins, or the 2-1 pins. 

This basically made me choose between upscaling the SAML22 to the version that Joey Castillo is using for his amazing casio F91W replacement boards. I could also try to place twenty diodes all over the board. Or ten and do some crazy "check if both combinations are working or just one" firmware. In the end I used an IO expander that is dedicated to read keyboard matrices, got some TCA8418RTWR on aliexpress, as they're out of stock everywhere else.

Soon I will try to get the UF2 bootloader running on the watch and then start programming it via the USB socket. First I need to cut out room for the plug though :)

https://github.com/joeycastillo/uf2-samdx1

Little side note: Joey will soon start a crowdfunding campaign with his awesome project, find it here:

https://www.crowdsupply.com/oddly-specific-objects/sensor-watch

More on the project on the blog:
https://hackaday.com/2021/08/08/wristwatch-pcb-swaps-must-be-in-the-air/

New PCB For Calculator Watch | First woopsie on the PCB

2021-10-29 14:59:30

By now I've realised that I forgot to add all the 20 diodes to make the charlie-plexed keyboard function. In the current arrangement there will be no way of telling if I have pressed the button connected to the 1-2 pins, or the 2-1 pins. 

This basically made me choose between upscaling the SAML22 to the version that Joey Castillo is using for his amazing casio F91W replacement boards. I could also try to place twenty diodes all over the board. Or ten and do some crazy "check if both combinations are working or just one" firmware. In the end I used an IO expander that is dedicated to read keyboard matrices, got some TCA8418RTWR on aliexpress, as they're out of stock everywhere else.

Soon I will try to get the UF2 bootloader running on the watch and then start programming it via the USB socket. First I need to cut out room for the plug though :)

https://github.com/joeycastillo/uf2-samdx1

Little side note: Joey will soon start a crowdfunding campaign with his awesome project, find it here:

https://www.crowdsupply.com/oddly-specific-objects/sensor-watch

More on the project on the blog:
https://hackaday.com/2021/08/08/wristwatch-pcb-swaps-must-be-in-the-air/

New PCB For Calculator Watch | Dipping my toes in ARM programming

2021-10-09 14:45:53

So many things to learn are ahead! Thankfully there's a project out there, that is using the SAML22 for a watchproject for use with LCDs, the Sensor Watch by Joey Castillo. https://github.com/joeycastillo/Sensor-Watch

On that github page Joey talks about installing the gnu arm toolchain from here[https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/] and run make in that one folder. On my mac (and probably every other computer) I had to add the toolchains path to my $PATH variable, like this:

export PATH="$PATH:/Applications/ARM/bin/"

Apparently openOCD is a thing people use to slap those sweet binary files onto plenty other ARM processors and you can get that over here https://openocd.org/

To familiarise with openocd, I tried to work with some commands and get to know what's going on. I tried to list all possible adapters and see what's out there and if my programmer is on that list. The space between "adapter" and "list" is confusing openOCD, so be sure to use one of these working ways to write it: 

openocd -c "adapter list"
openocd -c adapter\ list

 I'm rocking this neat little CMSIS-DAP debug probe [https://www.tindie.com/products/zelin/pitaya-link-cmsis-dap-debug-probe/] that you can get over at tindie for a fair price. Arturo182 gave me the tip to buy this, when I was trying to update the firmware of the #Keyboard FeatherWing 

One little thing that took me off-guard: the openocd works like a server that you connect to, but you first have to start it with the settings set to your target micro controller. Then you send the bin / hex files to the controller via a tcp or telnet connection. 

https://cdn.hackaday.io/images/3193711633782300031.jpeg

New PCB For Calculator Watch | Dipping my toes in ARM programming

2021-10-09 14:45:53

So many things to learn are ahead! Thankfully there's a project out there, that is using the SAML22 for a watchproject for use with LCDs, the Sensor Watch by Joey Castillo. https://github.com/joeycastillo/Sensor-Watch

On that github page Joey talks about installing the gnu arm toolchain from here[https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/] and run make in that one folder. On my mac (and probably every other computer) I had to add the toolchains path to my $PATH variable, like this:

export PATH="$PATH:/Applications/ARM/bin/"

Apparently openOCD is a thing people use to slap those sweet binary files onto plenty other ARM processors and you can get that over here https://openocd.org/

To familiarise with openocd, I tried to work with some commands and get to know what's going on. I tried to list all possible adapters and see what's out there and if my programmer is on that list. The space between "adapter" and "list" is confusing openOCD, so be sure to use one of these working ways to write it: 

openocd -c "adapter list"
openocd -c adapter\ list

 I'm rocking this neat little CMSIS-DAP debug probe [https://www.tindie.com/products/zelin/pitaya-link-cmsis-dap-debug-probe/] that you can get over at tindie for a fair price. Arturo182 gave me the tip to buy this, when I was trying to update the firmware of the #Keyboard FeatherWing 

One little thing that took me off-guard: the openocd works like a server that you connect to, but you first have to start it with the settings set to your target micro controller. Then you send the bin / hex files to the controller via a tcp or telnet connection. 

https://cdn.hackaday.io/images/3193711633782300031.jpeg

New PCB For Calculator Watch | First boards ordered

2021-09-13 14:06:13

After a longer break I managed to draw the symbols and footprints of the SAML22G and the IR transceiver module, so I would not have to rely on licenses of external sources. With that I was able to finalise a first prototype board and send it to JLCPCB for production. With the recent pink PCBs that boardhouses now produce I was very tempted, but I opted for a set of 5 green PCBs instead. I decided to run the board on 2.5V, which makes it easy for the AP2112K to work with the battery voltages of a LiPo battery, without running into dropout voltages first. There is some room and I'm tempted to add a footprint for a compass chip in the future, but I can always just connect to the QWIIC connector, as long as they are okay with 2.5V. Should have thought about that.

https://cdn.hackaday.io/images/6746051631534447214.jpeg
https://cdn.hackaday.io/images/8363891631534447352.jpeg

New PCB For Calculator Watch | First boards ordered

2021-09-13 14:06:13

After a longer break I managed to draw the symbols and footprints of the SAML22G and the IR transceiver module, so I would not have to rely on licenses of external sources. With that I was able to finalise a first prototype board and send it to JLCPCB for production. With the recent pink PCBs that boardhouses now produce I was very tempted, but I opted for a set of 5 green PCBs instead. I decided to run the board on 2.5V, which makes it easy for the AP2112K to work with the battery voltages of a LiPo battery, without running into dropout voltages first. There is some room and I'm tempted to add a footprint for a compass chip in the future, but I can always just connect to the QWIIC connector, as long as they are okay with 2.5V. Should have thought about that.

https://cdn.hackaday.io/images/6746051631534447214.jpeg
https://cdn.hackaday.io/images/8363891631534447352.jpeg

New PCB For Calculator Watch | working in KiCad

2021-07-25 14:31:13

The original footprint of the keyboard buttons comes in these interlocking C-shapes. New to KiCad I wondered if it would be even possible to generate something like this. Turns out you can create custom shaped footprints like this in the footprint editor. One catch, you have to work around a standard pad and add to it. At first I was drawing the complete shape and had a 2mm x 2mm right in the center.

I still need to design and replace footprints here and there, but I wanted to see some renders, so I gave everything a fitting part. The USB micro-B is a storage driven choice. Since all this is open source you're free to change it to whatever plug is to your liking! There are copper bits in the drill holes, I need to fix that.

https://cdn.hackaday.io/images/564331627215509516.png
https://cdn.hackaday.io/images/8928161627215838146.png

New PCB For Calculator Watch | working in KiCad

2021-07-25 14:31:13

The original footprint of the keyboard buttons comes in these interlocking C-shapes. New to KiCad I wondered if it would be even possible to generate something like this. Turns out you can create custom shaped footprints like this in the footprint editor. One catch, you have to work around a standard pad and add to it. At first I was drawing the complete shape and had a 2mm x 2mm right in the center.

I still need to design and replace footprints here and there, but I wanted to see some renders, so I gave everything a fitting part. The USB micro-B is a storage driven choice. Since all this is open source you're free to change it to whatever plug is to your liking! There are copper bits in the drill holes, I need to fix that.

https://cdn.hackaday.io/images/564331627215509516.png
https://cdn.hackaday.io/images/8928161627215838146.png

New PCB For Calculator Watch | progress on the schematic

2021-07-25 14:17:01

To see what's possible to add to the project, I needed a pinout list. Sadly the datasheet has a single table with all (G) 48pin, (J) 64pin and (N) 100pins in it, so that the L22G pins are all over the place. I printed out the 3 datasheet pages and cut them down and glued them together to a single page. I then marked all the LCD pins, USB and SWD pins and took a look at what was left: 10 pins. With a keyboard matrix of 4x5 pins I would normally have to use 9 pins, but instead I will use charlie-plexing to scan the keyboard. I was told that I can also use the SWD pins for other shenanigans, so I used them for the keyboard matrix and was now left with 7 more pins!

For communication I thought it would be nice to have an Infrared setup. I might be able to run tv-b-gone on it or even switch channels, ha! The TFBS4711 seems like a good tiny candidate for IR communication, so I chose that to connect to the SERCOM1 pins plus an extra pin for the shutdown pin. It might take a while until I have that functional, as there are other things that I would like to get running first.

There were two more pins of an USART interface free, so I chose SERCOM5 to be the I2C pins and connected them to a QWIIC connector. Might come in handy for controlling wearables in the future. All these addons including the USB connector mean the case needs to be modified.

That leaves us with two more pins that will be used for the piezo buzzer and the LCD backlight LED. There's a steep learning curve ahead of me when it comes to the firmware and integrating everything into the Arduino environment.

https://cdn.hackaday.io/images/3942481627214881058.png
https://cdn.hackaday.io/images/2274951627215079556.png

New PCB For Calculator Watch | progress on the schematic

2021-07-25 14:17:01

To see what's possible to add to the project, I needed a pinout list. Sadly the datasheet has a single table with all (G) 48pin, (J) 64pin and (N) 100pins in it, so that the L22G pins are all over the place. I printed out the 3 datasheet pages and cut them down and glued them together to a single page. I then marked all the LCD pins, USB and SWD pins and took a look at what was left: 10 pins. With a keyboard matrix of 4x5 pins I would normally have to use 9 pins, but instead I will use charlie-plexing to scan the keyboard. I was told that I can also use the SWD pins for other shenanigans, so I used them for the keyboard matrix and was now left with 7 more pins!

For communication I thought it would be nice to have an Infrared setup. I might be able to run tv-b-gone on it or even switch channels, ha! The TFBS4711 seems like a good tiny candidate for IR communication, so I chose that to connect to the SERCOM1 pins plus an extra pin for the shutdown pin. It might take a while until I have that functional, as there are other things that I would like to get running first.

There were two more pins of an USART interface free, so I chose SERCOM5 to be the I2C pins and connected them to a QWIIC connector. Might come in handy for controlling wearables in the future. All these addons including the USB connector mean the case needs to be modified.

That leaves us with two more pins that will be used for the piezo buzzer and the LCD backlight LED. There's a steep learning curve ahead of me when it comes to the firmware and integrating everything into the Arduino environment.

https://cdn.hackaday.io/images/3942481627214881058.png
https://cdn.hackaday.io/images/2274951627215079556.png

New PCB For Calculator Watch | ATSAML22 | hardware choices

2021-07-18 10:51:03

There are different versions of the ATSAML22, for this purpose I have set my eyes on the ATSAML22G18A, it has the lowest pin count, meaning it's the smallest, while also having 256kB SRAM for programs. The amount of SRAM is probably not necessary in the end, but for developing it is good to know that you have enough space and can downgrade to reduce BOM cost. The chip has an integrated LCD controller with lots of options and 23 dedicated pins that are highly configurable - perfect amount for the 22pins of the watch LCD.

Another way of controlling the LCD could have been using the very well supported Holtek HT1621 and a controller of your choice, like maybe an ESP32 or a nordic chip. An Integrated LCD controller can also be found in the Atmega169, but it's an EoL product and the datasheet from 2006 says "Not recommended in new designs".

New PCB For Calculator Watch | ATSAML22 | hardware choices

2021-07-18 10:51:03

There are different versions of the ATSAML22, for this purpose I have set my eyes on the ATSAML22G18A, it has the lowest pin count, meaning it's the smallest, while also having 256kB SRAM for programs. The amount of SRAM is probably not necessary in the end, but for developing it is good to know that you have enough space and can downgrade to reduce BOM cost. The chip has an integrated LCD controller with lots of options and 23 dedicated pins that are highly configurable - perfect amount for the 22pins of the watch LCD.

Another way of controlling the LCD could have been using the very well supported Holtek HT1621 and a controller of your choice, like maybe an ESP32 or a nordic chip. An Integrated LCD controller can also be found in the Atmega169, but it's an EoL product and the datasheet from 2006 says "Not recommended in new designs".

New PCB For Calculator Watch | PCB dimensions

2021-07-17 20:57:46

To make a replacement PCB you first have to know everything you can about the old PCB. Looking for my scanner I found a different one and used that instead. It was surprisingly easy to just plug it into my computer and scan without installing any ubuntu drivers, nice. After some tweaks in GIMP I was looking at this, the important side of the PCB with SMD pads that connect the LCD and the button matrix.

The next step for me then was to import the PNG into inkscape, mainly to draw the new shape of the PCB and get all drillholes and button positions, as well as the LCD pads. The pads are spaced 0.9mm from each other. I learned that by measuring 18.9mm from first pin to last pin and dividing that by 21. Nice.

There are 1.1mm, 1.2mm and something around 1.4mm drill size holes on the PCB, either for screws or mounting poles of the plastic case. After pushing things around and trying to find a center I ended up with this colorful layered image.

I continued with importing a photo of the case internals, so I can draw a new PCB shape with more real estate, using what I can get. We definitely want to add a side glowing LED and there are some free screw-holes that we can use. To test the PCB dimensions and mounting hole positions, I printed only the contours of all the elements onto a clear overhead projector foil. It helps to have small drill bits around, to probe the hole sizes.

Looks like the fit checks out :) Now I need to find out how to get that SVG into something that I can convert and work with in KiCad. Did you notice how many open source projects I've listed?

This is what the PCB now would kinda look like. I might remove the LCD holding tap and close that top opening as it does not really seem to do anything. 


https://cdn.hackaday.io/images/7367171626546582687.png
https://cdn.hackaday.io/images/2562131626547286121.jpeg
https://cdn.hackaday.io/images/1682241626548080530.png
https://cdn.hackaday.io/images/4265811626563441844.png

New PCB For Calculator Watch | PCB dimensions

2021-07-17 20:57:46

To make a replacement PCB you first have to know everything you can about the old PCB. Looking for my scanner I found a different one and used that instead. It was surprisingly easy to just plug it into my computer and scan without installing any ubuntu drivers, nice. After some tweaks in GIMP I was looking at this, the important side of the PCB with SMD pads that connect the LCD and the button matrix.

The next step for me then was to import the PNG into inkscape, mainly to draw the new shape of the PCB and get all drillholes and button positions, as well as the LCD pads. The pads are spaced 0.9mm from each other. I learned that by measuring 18.9mm from first pin to last pin and dividing that by 21. Nice.

There are 1.1mm, 1.2mm and something around 1.4mm drill size holes on the PCB, either for screws or mounting poles of the plastic case. After pushing things around and trying to find a center I ended up with this colorful layered image.

I continued with importing a photo of the case internals, so I can draw a new PCB shape with more real estate, using what I can get. We definitely want to add a side glowing LED and there are some free screw-holes that we can use. To test the PCB dimensions and mounting hole positions, I printed only the contours of all the elements onto a clear overhead projector foil. It helps to have small drill bits around, to probe the hole sizes.

Looks like the fit checks out :) Now I need to find out how to get that SVG into something that I can convert and work with in KiCad. Did you notice how many open source projects I've listed?

This is what the PCB now would kinda look like. I might remove the LCD holding tap and close that top opening as it does not really seem to do anything. 


https://cdn.hackaday.io/images/7367171626546582687.png
https://cdn.hackaday.io/images/2562131626547286121.jpeg
https://cdn.hackaday.io/images/1682241626548080530.png
https://cdn.hackaday.io/images/4265811626563441844.png

New PCB For Calculator Watch | Pinout Of The LCD

2021-07-17 20:21:53

The blob chip on the PCB is on the other side of the contacts for the LCD of the PCB, so there are 22 vias that I was able to sand and solder to. I've cut the connection of the chip, so I basically ended up with a breakout board for the LCD. Because of it's "capacitive" nature the display showed something just by connecting the positive pin of the power supply to a segment pin (voltage not important as there was no circuit completed). At least I think that's the reason. I guess everyone has taken apart an LCD calculator and was fascinated that it shows something just by you touching the pads or pins of the display. Anyways, thanks to this "trick" I was able to see that the 22 pins of the LCD are 18 pins for groups of four segments and then 4 of course for one of that activated segment. Thee pinout is super straight forward, as the 4 common pins are the last 4 on the right.

Here's a screenshot of the KiCad symbol I'm working on right now

https://cdn.hackaday.io/images/3953651626545569117.png
https://cdn.hackaday.io/images/9189951626546311166.png

New PCB For Calculator Watch | Pinout Of The LCD

2021-07-17 20:21:53

The blob chip on the PCB is on the other side of the contacts for the LCD of the PCB, so there are 22 vias that I was able to sand and solder to. I've cut the connection of the chip, so I basically ended up with a breakout board for the LCD. Because of it's "capacitive" nature the display showed something just by connecting the positive pin of the power supply to a segment pin (voltage not important as there was no circuit completed). At least I think that's the reason. I guess everyone has taken apart an LCD calculator and was fascinated that it shows something just by you touching the pads or pins of the display. Anyways, thanks to this "trick" I was able to see that the 22 pins of the LCD are 18 pins for groups of four segments and then 4 of course for one of that activated segment. Thee pinout is super straight forward, as the 4 common pins are the last 4 on the right.

Here's a screenshot of the KiCad symbol I'm working on right now

https://cdn.hackaday.io/images/3953651626545569117.png
https://cdn.hackaday.io/images/9189951626546311166.png