Tweets
Today’s task: first pass at documentation. I would have loved to fix deep sleep, build out the temperature app or hack on new sensors. but I want to get the beta boards out into the world, and this is what people will need to get started on their own apps. https://joeycastillo.github.io/Sensor-Watch-Documentation/
(original)
Replying to @BenSommerf
I’ve done some more work on low power modes since this, but the initial battery life test ended at three months to the day. I sense that I will be able to improve that significantly. https://twitter.com/josecastillo/status/1422220344975364098
(original)
Replying to @falconsview
I definitely want to work on something like that for tomorrow! it’s an interesting story, and while this project dates to January, some of the ideas trace back to March of last year and nearly a dozen gadgets large and small that I built in the interim.
(original)
Replying to @songsteven2 and @watchmen
Oh I definitely saw the new Watchmen! Brilliant, relevant, loved it enough to watch it a second time with other folks.
(original)
Replying to @AllevatoreAnon
oh so many. Off top of head I have an accelerometer, magnetometer, light sensor, microphone and NFC controller on my bench right now.
(original)
Replying to @NiVZ, @orviwan, @dezign999 and @IShJR
The boards are open source (the latest rev, OSO-SWAT-A1-04, is on a plane even as we speak) and I definitely do want to make more hardware; the goal of this was to make a design with a low part count that I could get manufactured affordably. Working on it! https://github.com/joeycastillo/Sensor-Watch/tree/main/PCB/Main%20Boards
(original)
Replying to @songsteven2
I saw it years and years ago but I don’t remember it well, maybe worth a revisit?
(original)
Replying to @tomfleet and @MicrochipTech
Thanks for the shout out! It’ll be finished though when I figure out the manufacturing piece. I really want to get some of these in people’s hands and see what kind of programs they decide to write for it :)
(original)
Replying to @SianaGearz
I have a custom LCD design that I feel I’m inevitably going to have made, but other than that I don’t know if there are any screens out there (driven over like SPI?) that would fit. Part of the appeal though is being able to drive an LCD directly. https://twitter.com/josecastillo/status/1368584803314962434
(original)
Replying to @sneenyc
It’s usually warm here, but we’ve got a lot of fans going for us, which is nice.
(original)
Replying to @josecastillo
The code + more demo (cold ice / warm wrist). Again, the goal was to make it simple to write watch apps, and aside from a header file with some register definitions, the whole thing (plus humidity sensing!) clocks in at ~150 lines of code in a single file. https://github.com/joeycastillo/Sensor-Watch/blob/67e9d173ca0b504305a3fd3d8d1ad7b64e2d23dd/Sensor%20Watch%20BME280%20Project/app.c
(original)
I knew it would work. I designed it to work. But seeing it actually work? That’s a whole other thrill.
The Sensor Watch + environment sensing flex PCB, all assembled and installed in a classic F-91W watch case.(original)
Replying to @kfury
(original)
just throwing this out there. https://github.com/joeycastillo/Sensor-Watch/commit/15050f8ace8b514f21ea3bbb29a8585ea349917c
(original)
Replying to @tablatronix
I’m in Brooklyn! And this was a particularly pretty one. I’m glad I didn’t spend it staring at firmware bugs :)
(original)
Replying to @josecastillo
update: spicy sio ramen and this:
(original)
Replying to @josecastillo
…and I just had an idea for how to fix it, moments after biking home. boundaries, joey. leave the work at the shop. have some dinner. watch the sunset. the work will be there tomorrow.
(original)
Replying to @josecastillo
I may put a pin in this and get back to I²C stuff tomorrow; backup mode will be very nice to have, but technically it wasn’t one of my goals for the week.
(original)
Some progress on deep sleep. I’m able to to enter BACKUP mode by pressing a button, but waking with that same button doesn’t yet work. For now I’m just doing a hard reset to show that the application state is, in fact, being stored in the backup registers. https://github.com/joeycastillo/Sensor-Watch/commit/fc31739eb6fdf230a26930e8d42de7a26558aeae
(original)
Replying to @davedarko
also if you haven’t already, consider adding a 10µH inductor between VDDOUT and VDDCORE so you can use the SAML22’s switching regulator; it’s more efficient than the LDO regulator.
(original)
Replying to @davedarko
Right on! A couple of notes that weren’t obvious to me at first, you may already know tho: the COM pins need to be the first SLCD pins (i.e. SLCD/LP[2, 3, 4, 5]), and while any interrupt pin can wake from STANDBY, only RTC/IN pins can wake from the ultra low power BACKUP mode.
(original)
Replying to @ultramagnus_tcv
Ha, that’s just city noises; my workshop is in Bed Stuy and if motorcycles are the loudest thing out the window, it’s a good day (there are two construction sites directly outside 😬)
(original)
Replying to @MakeAugusta
Capacitive soil moisture spike! Meant to pitch this to you ages ago. You could do it with a big PCB pour and a 1M drain resistor; tie it all together with an ATTiny and a piezo for chirping, and power with a chunky coin cell like a CR2032.
(original)
also can I just throw out how proud I am of this one-layer flex PCB layout?
(original)
Replying to @Automatid
Can’t speak to the SAM R21 but the L21 has been a dream so far! I’ll share one lesson learned which is nothing becomes low power on its own; you have to be careful about choosing peripherals, going into low power modes and knowing which peripherals you want to run in those modes.
(original)
Replying to @peppertronics
Don’t have the part number on hand, but I found an LED with red and green colors that fit in the same footprint! Technically @adafruit sells a Neopixel that can fit there as well, but I haven’t tried it yet; think it needs slightly more “oomph” than a 3V coin cell can deliver.
(original)
Replying to @josecastillo
Next up, I really want to nail down deep sleep mode. So tomorrow I want to add the ability to turn off basically everything, even the RAM; store the application state in the RTC’s backup registers; and then wake from a button press and restore it. This will get me to nanoamperes.
(original)
Replying to @josecastillo
When I say this is the “first app” I mean to say it’s the first app using this new framework that I came up with yesterday. The gist is the whole app lives in app.c, where you implement six functions that get called for you. You never have to touch main.c. https://github.com/joeycastillo/Sensor-Watch/blob/d2e43d132c6e0e4ca7bc9a5835135d9a205829b7/watch-library/app.h
(original)
Replying to @josecastillo
I also spent some time today updating the README to try to explain what I’m doing. It lists the features, documents the 9-pin sensor board connector, and explains how to get code onto it (spoilers: make && make install). It also features a new hero shot :) https://github.com/joeycastillo/Sensor-Watch
(original)
It’s the first app! And the code that goes with it. Super simple: it says hello and lets you cycle through some LED colors. The number up top increments whenever the microcontroller wakes up in response to a button press; it spends most of its time asleep. https://github.com/joeycastillo/Sensor-Watch/blob/8b92a1b44a489ad08fc1749e105ac4565d726803/Sensor%20Watch%20Starter%20Project/app.c
(original)
Replying to @josecastillo
Also I was showing it off on Friday and may have left it in “Martian Time” mode, which in my naïve demo implementation involves a floating point calculation (in software) every second. That could have killed it too. Maybe it could have gone longer. Will test with a new app soon.
(original)
UPDATE: The battery on the watch that I started back in May died today. This was before some of the later power consumption optimizations, and before adding the ultra-low-power backup mode. Room for improvement, but 3 months with the screen on as a starting point feels… not bad! https://twitter.com/josecastillo/status/1389001215028178945
(original)
Replying to @josecastillo
(I have these beta boards, I could in theory put them on tindie or send them into the world at any time. but I want the software story to be more complete first. I’d hate for folks to get them and have them languish in a drawer because I didn’t make it easy to build the software)
(original)
Replying to @josecastillo
calling it a day. but I think tomorrow’s goal is a basic “hello world” (text on screen, some LED colors) just to show the theory of how the framework should work. then this week’s goal is a more full-featured app that can display time, temperature and humidity data on the LCD.
(original)
Replying to @josecastillo
(the code on the right is not “good” as such, but it gets the gist across of how one might implement a simple application. this one prints a dot once a second, when the app is woken by the RTC, and prints the temperature in response to a button press.)
(original)
Replying to @josecastillo
The thinking so far. It’s very minimalist, but the goal is for the user not to have to touch main.c; you implement your app within these four functions, and the main run loop spends the vast majority of the time in a low power sleep mode.
(original)
some Sunday afternoon progress on the watch. I’m now able to read the temperature from a sensor and echo to UART. But more importantly: making progress on a sort of “application framework” for building watch apps that should make it easier for folks to jump in and make their own.
(original)
Replying to @josecastillo
for the record I live in America, those old United States. My folks pay for Google Fiber in Texas and my roommates pay for wildly shitty Internet from what remains of Time Warner Cable. I’ve no idea how to watch people participate in sports. but it feels like it should be easier.
(original)
so the olympics look cool. but i don’t think I can see them here? so i’m not sure what the point is
(original)
Not exactly how I imagined I’d be using these tools, but you can’t argue with results! Sensor Watch 9-pin to Pycorder for power and on-screen serial output. Also lets me write code for any STEMMA-QT gadget; the I²C lines just pass through. This should all come together next week.
(original)
Replying to @insolace
i mean at some point voters are going to hear it and then they’re going to go to the polls. I’d like to ignore it because I know it’s disingenuous and full of shit, but unless the voters it’s designed to target can do the same, the disingenuous full-of-shit message will be heard.
(original)
ever since pence introduced this line a few weeks ago, it has me terrified. because it is a winning message. Barack Obama won in 2008 by lying that America was not racist. if these assholes frame 2024 around this, I don’t see how we counter it and win. https://www.politico.com/news/2021/07/28/gop-primary-america-racist-2024-500680
(original)
Replying to @theavalkyrie
side note: last week I was working on my watch & looking at your Gemini firmware for C&P. I learned SO MUCH about going from a datasheet to real code. Not only are you doing great work, you’re sharing it in a way that empowers and enlightens. Something the haters will never grok.
(original)
Replying to @Grahamballs
scary for a second, and for the rest of your life
(original)
Replying to @DLBiller, @leandrochaves and @tarahaelle
I sense you’d like this! an antidote for the all the bad photos that get picked for vaccine stories.
(original)
HUH. interesting. my iPad (which I use only rarely) has been dying super quickly of late. seemingly ever since I got AirTags.
to quote xkcd: “Correlation doesn’t imply causation, but it does waggle its eyebrows suggestively and gesture furtively while mouthing ‘look over there’.”(original)
Replying to @Alie_GG
i think this still is my favorite license of all time: https://github.com/scanlime/bandsocks/blob/master/LICENSE.md
(original)
Thursday waterfront sunset. New York is alright.
(original)
Replying to @atomicthumbs and @KitCatAgenda
if I ever become a billionaire asshole with a space program I’m just going to name it “Icarus” and let shit fall where it may
(original)
taking a break from intractable hardware problems to work on software. UART is now working on the watch! Which will be useful for debugging. It also uses the same 9-pin pinout as the Pycorder, just smaller; all I needed was a flexy @oshpark adapter board to bridge the two worlds.
(original)