Develop a simple smart watch with companion smart phone app that can be used by others to make their own
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
20240812_221504.jpgAdafruit Feather nrf52840, two buttons, SSD1327 displayJPEG Image - 1.07 MB - 08/13/2024 at 05:05 |
|
|
I've had a LOT of difficulty bridging the gap between React Native BLE PLX library and the NRF52840 board in terms of sending data from a phone app to the board.
After a bunch of looking around, it looks like I'll have more luck finding examples for an ESP32 based board, such as this awesome writeup: https://www.cjoshmartin.com/blog/bluetooth-low-energy-ble-with-react-native-and-arduino
I'm going to try to set up a "characteristic" that I can then "write" to so that I can send a packet of information to the device.
And while I'm not sure, it looks like the timer I had running on it previously with no issues stops after 2 seconds on the Adafruit ESP32-S3 board.
I will update when I have news!
I've made some progress on the companion app thanks to this nice tutorial from expo that I've linked before: https://expo.dev/blog/how-to-build-a-bluetooth-low-energy-powered-expo-app
It provides not only the finished code for the tutorial, but some started code to follow along as well.
Strictly speaking (not sure if that's the right phrase), this tutorial is very similar to what I'm trying to accomplish with this project: a way for people to start with an idea for a Bluetooth smart device that connects to a phone app.
I also added an objective for myself to receive data from the watch. In terms of an open source project someone can pick up and run with, this would be a good thing to have available as a starting point.
I am back to using Expo and React Native, for three reasons: 1) Expo is an easier way for me to generate apps for both Android and iOS, 2) I'm familiar with React and React Native, and 3) I actually got an app to work, and there may be hope yet.
I had success getting a sample project to work with this post: https://blog.theodo.com/2023/07/ble-integration-for-rn-apps/
Long story short, I did not use EAS to make a package then use on my phone, I used USB debugging. It didn't QUITE do what I wanted, but 1) it didn't crash and 2) once I manually turned on bluetooth on my phone, it popped up the bluetooth selection menu. I also had to use Node 16 due to this setup using an outdated SSL setup.
I also found this blog post on the Expo web site I'm going to try to get working: https://expo.dev/blog/how-to-build-a-bluetooth-low-energy-powered-expo-app
The main goal is to make an Android app (for now) that connects via bluetooth to my homemade smart watch.
I had trouble getting a Bluetooth app to work with Expo going to Android, so I'm going to try making a native Android app. I figure it doesn't matter if I submit the app, so I don't need Expo's system to do that.
The main point is to make an app people can download and use, even if they have to build it and install it themselves.
To give an idea of what I'm trying to accomplish with this project, here are the epics I have thus far, and their completion rates
watch responds to bluetooth | 100% |
create and publicize code respository (both arduino and react native app) | 100% |
make a simple bluetooth app in react native that watch responds to (all mock data) | 25% |
functioning physical watch buttons | 20% |
send time to watch via bluetooth | 0% |
send display to watch via bluetooth | 0% |
receive data coming from watch | 0% |
full test of watch functionality | 0% |
compartmentalize watch code for easy add/removal of functions | 0% |
code cleanup and possible unit tests | 0% |
PROJECT COMPLETE |
Short update, I successfully copied some older Arduino code to connect the Feather board to the Adafruit bluetooth app, and the buttons on the controller (1 through 4) come through just fine, so it has basic bluetooth connectivity working.
I wanted to post a picture of it, but since the display wipes after the button is released AND I am holding the phone taking pictures, not doable.
The next challenge has two main parts
- Make a basic phone app with the ability to connect to the board
- Have that app send data that can be read by the board and acted on. For initial proof of concept, I will try to have it send the same data that the Adafruit app is sending, with a stream of "B4949" for "button 1 pressed", "B4948" for "button 1 released" and so on.
Note the use of ascii numbers for both the number of the button and the status of the button, with 48 being zero and 49 being one.
To some people reading this, this is very basic stuff, but it's a learning experience for me, and possibly for other people reading this very post.
forgive the lack of formality e.g. lack of proper sentence grammar or capitalization. im writing this more or less free thought so i can get it down and post the update while i have to do my regular job
current progress:
to be honest, other things have been keeping my attention (this is a side project/hobby after all), so not much progress in the last couple of weeks. however, i have made a mock kanban in google sheets with the following epics.
watch responds to bluetooth:
the smart watch response to the adafruit bluetooth app
make a simple bluetooth app that watch responds to:
making a very pared-down version of the adafruit bluetooth app that the smart watch responds to. my initial plan is to use react native so it can port to both android and ios, but failing that, i will make it in android, which is simply my preference for now
get watch buttons working (mock data):
1) mode select button: change between time, timer, and display
2) action button: executes simple action for each mode
send time via bluetooth:
simply have the watch set its time via the bluetooth app
send display via bluetooth:
whatever text is set in the app, it is synced to the device. see note below
compartmentalize watch functions:
toward the goal of making this easy for people to pick up and use, modify the smart watch code so that people can add or remove their own functions easily and cleanly
note on the "display" mode: this function may seem odd or out of place. i admit this open smart watch project is a stepping stone for a different project, but this way not only can i make what i need, but others can possibly benefit by my documentation here.
things i need to do for this project
- provide images / code / screenshots of current progress
Noting that I shifted the overall aim of this project to include a smart phone app to connect to a simple Arduino smart watch, so people can take that and run with it.
I am open to other technologies (e.g. ESP32 for the board and Gadgetbridge for the app)
Some links to places I've looked that had more information and resourcres:
ElectroNoobs - SmartWatch Firmware v2.0 - Some Arduino code I may utilize
My initial work uses the following hardware
- Adafruit Feather nRF52840 Express (https://www.adafruit.com/product/4062)
-- is discoverable by BlueTooth
-- has a Stemma connector, which I eventually abandoned
-- can connect with a battery
-- can recharge that battery
- Adafruit Grayscale 1.5" 128x128 OLED Graphic Display (https://www.adafruit.com/product/4741)
-- good screen size
-- Stemma connector
- Lithium Ion Polymer Battery - 3.7v 500mAh (https://www.adafruit.com/product/1578)
-- about the size of a US quarter, about 4mm thick, which is a decent small size
-- pretty good capacity
-- connects easily to the Feather board
I plan to try to either use a single board for bluetooth and magnetometer functionality, or get two smaller boards if the combined board has too many extras.
This board has both, but might end up having too much extra stuff (and it's $15 more than the other Feather): Adafruit Feather nRF52840 Sense (https://www.adafruit.com/product/4516)
Here is my current list of desirables
- bluetooth discoverability: so any phone can connect to it and send it data (two way communication NOT required)
- bluetooth communication including
-- phone sends message to display watch, not necessarily SMS
- magnetometer to track movement like gestures like left/right and show compass direction
- utilization of a battery with display of battery remaining
- ability to recharge battery via typical USB
- display that turns on with a button press (for the first version)
- watch functionality including
-- timer
-- stopwatch
-- set time and date
-- show current month calendar
-- change display between digital and analog
- display
-- I've played with the basic types of displays like ST7789
-- I would prefer a screen that's about 1 1/2 inches (38 mm) in diagonal
-- I would love high pixel density, but I don't know what I could use or the downsides
Create an account to leave a comment. Already have an account? Log In.
Looks like there's a similar project here: https://hackaday.io/project/170205-rubble-watch
There are some Open Source projects that are kind of similar-ish. Healthy Pi Move comes to mind. Not the same, but similar. Could you take a look?
Become a member to follow this project and never miss any updates
There is also the ongoing Open Source ReflectionsOS project but that uses ESP32.