Tweets
it has been a journey, but AT LAST, power consumption on the watch is where I want it to be. With display on, updates each second and all buttons enabled? Under 35µA. With only the ALARM button enabled? SEVENTEEN MICROAMPERES! That’s four to eight months on one CR2016 coin cell!
(original)
Replying to @keesplattel
They arrived, so cool, thank you! Gonna put one on one of the test watches, save another to go over the flexy NFC antenna I ordered :)
(original)
this should do the trick.
(original)
Replying to @josecastillo
The cool thing about the TCC is that with four waveform outputs, I actually have one to spare! I could have designed this device with an RGB LED, and driven 3 channels of light and one channel of sound off a single peripheral. That’s pretty neat! </thread> https://github.com/joeycastillo/Sensor-Watch/commit/6353d25d46979efed36c50ec186c8006f266d78a
(original)
Replying to @josecastillo
The LEDs, on the other hand, make use of whatever period the buzzer is set at: we just set their compare value to whatever fraction of that period corresponds to the desired duty cycle. I had to remove a few low-frequency notes to make this work, but it’s a worthwhile tradeoff.
(original)
Replying to @josecastillo
The new and improved setup: we have a list of periods for the notes we want to play. We can use those to set the TCC’s PER value, which sets the frequency of the wave. Then when the buzzer wants to buzz, it sets its compare value to half of the period, giving it a 50% duty cycle.
(original)
Replying to @josecastillo
The crucial bit is that the buzzer depends on a frequency to work, and the LEDs depend on a duty cycle. As long as the buzzer’s frequency is faster than our eyes can see, we can let the buzzer pick any frequency it wants, and calculate the LEDs’ duty cycle as a fraction of that.
(original)
Replying to @josecastillo
The LEDs, on the other hand, turn current into light. To blend the light into colors, we need to turn the LEDs off and on quickly (“pulse-width modulation”). The idea is that if red is on 90% of the time, and green is on 10% of the time (“duty cycle”), we’ll end up seeing orange!
(original)
Replying to @josecastillo
The piezo buzzer has a tiny crystal inside that deforms when subjected to a voltage. This is called the Piezoelectric Effect. If we annoy the crystal repeatedly at an audible frequency, this repeated deformation will create vibration — vibration that we can hear as a sound wave!
(original)
Replying to @josecastillo
So we know we *can* use them. But how exactly *do* we make use of them for what we need to do? (to recap: make beepy sounds, and blend red and green into a veritable cornucopia of fall colors.)
To get there, we need to talk about how the buzzer and the LEDs actually work.(original)
Replying to @josecastillo
The bi-color LED has two pins: one for red, and one for green. They’re connected to pins PA20 and PA21. This pin mux table shows that you can use these as TC3/WO[0-1] (Timer/Counter 3, Waveform Output 0/1). But you can also use them as TCC/WO[6-7]. (the buzzer is PA27, TCC/WO[5])
(original)
Replying to @josecastillo
Here’s the thing: that technically broke a promise I was making in the documentation. I said that you could use the two pins of TC3 for a device on the 9-pin connector — and you can’t very well do that if TC3 is already claimed for LED duty. Luckily, though, I planned for this.
(original)
Replying to @josecastillo
So: the SAM L22 at the heart of the watch has four TC peripherals and one TCC (Timer/Counter for Control). They’re useful for lots of things: dimming LEDs, counting pulses or even calling functions periodically. Up til now I was using the TCC for the buzzer, and TC3 for the LEDs.
(original)
Solid sunday progress on the watch sprint: refactored the LED and buzzer code to run both off of the same peripheral, freeing up a timer/counter for use on the 9-pin sensor board connector. The code’s a bit dense, but everyone loves blinks and bleeps; thus, an expository <thread>
(original)
Replying to @TheArduinoGuy
It’s just printing “hello world” repeatedly to serial; the goal is to create a debug console that folks can print to when developing their watch apps.
(original)
Replying to @josecastillo
Working USB signals are so satisfying to visualize. still, here’s hoping i won’t have to use this cursed USB cable again for a while.
(original)
Replying to @timonsku
haha I watched it again when I saw your tweet
(original)
Spent my whole day yesterday failing to implement a USB CDC for the watch. Biked home in defeat — but had an idea on that ride. Got to the workshop this morning and that was it; it’s done.
maybe the lesson is, sometimes you have to step away? or that you need to get back to it.(original)
Replying to @nopunos
We’re both piloting uncharted waters in our projects right now :)
(original)
my roommate, to me, after I explained my full day of trying and failing to solve a problem: “if everything’s smooth sailing, you’re doing something wrong.”
(original)
Replying to @keesplattel
It occurred to me as I was writing that tweet that I could maybe use a flex PCB for the antenna as well, which would take me from 0.6 mm FR4 to 0.15 mm polyimide. thin!
(original)
Replying to @josecastillo
(this is the open hardware NFC antenna design from N‑O‑D‑E’s Data Runner, https://n-o-d-e.net/datarunner.html. it would in theory work with the NFC sensor board that’s off at the fab right now. alas, that’s just a hole for the screen, tho it would be cool if transparent PCBs were a thing…)
(original)
hypothetically.
(original)
me booking a redeye: “fuck yeah! an extra day of adventure! and I can sleep on the plane! yes!”
me landing after a redeye: “well this fucking sucks. what the fuck.”(original)
every layer of this project adds so much complexity. I learned to make hardware. then I needed a library to interact with the hardware. now a few people are using that library, and I have to update it without breaking their projects. I keep pushing myself further out of my depth.
(original)
the last time I was at Rocky Mountain, our last day was waning, and a friend had a flight to catch in Denver. so I asked a ranger for last-minute recommendations, but my question came out as “What can we do with the time we have left?”
anyway i think about that a lot these days.
(original)
had to kill some time before entering Rocky Mountain NP, so I found a temporary office and refactored my external interrupt code. Good coffee, great views and a duck pond; when you can work from anywhere, who wants to go back to half of a windowless room?
(original)
As a…
Starbucks WiFi user
I would like to…
Be forced to enter a valid email address
so that…
Someone on the internet will get spammed.(sorry, john)
(original)
Replying to @stephen1986 and @oshpark
I believe it would be — in fact the BME280 board I was testing last week has a pressure sensor! I am less certain how well it would work inside the watch case; there is a rubber gasket that makes the device water resistant, but probably not airtight? Worth exploring!
(original)
Four new flexy sensor boards sent to @oshpark! Hiking Log is accelerometer + tiny 0402 thermistor for temperature sensing. Also have a thermistor board with chonky 1206 parts, suitable for DIY’ing. Light sensor and NFC tag are more experimental, but at $1 each, why not try stuff?
(original)
Replying to @crulge
“Intrepid hackers invent gadget to save orphans from orphan-crushing machine.”
(original)
Replying to @peppertronics and @oshpark
On the wrist it was 100% related to body temp. But within a half hour off-wrist it equalized to ambient, and it worked when I threw it outside my tent and had it log overnight low temperatures.
(original)
lessons learned from the first sensor board: humidity sensing? Not useful. Temperature sensing? Very useful — and I have five analog inputs and a 12-bit ADC on the SAM L22. Could a 50¢ thermistor be the killer app for this thing? I foresee some @oshpark flex boards in my future.
(original)
THIS IS SO COOL! @gameduino has made an emulator for the Sensor Watch and it’s able to run the starter app, with lights! Definitely want to play with this some more soon. https://twitter.com/gameduino/status/1429812251658096640
(original)
Replying to @davedarko
It is a downer, but hey, I’ve learned not to make that mistake again (unless maybe I do)
(original)
Replying to @sselvidge
I finally made it there back in 2019! Spent three days of the trip just camped out on a beach, taking pictures and writing in my journal. Love that spot, definitely want to get back!
(original)
Replying to @songsteven2
I was two time zones away, not sure where it hit in New York. I didn’t even know there was a storm until texts started coming in from friends. Thankfully everyone seems okay.
(original)
Replying to @josecastillo
Anyway. To Colorado for three days now to catch up with some friends; then back to New York for a seven day sprint of watch and book stuff.
(original)
Replying to @josecastillo
Nevertheless: I came here to take a break from the work, and I feel like that was a success. Up before sunrise, we filled each day and made the most of the time we had.
(original)
Replying to @josecastillo
I can build a new one of course, but still. I had the idea in January; built it in July; coded it on a plane ride on Wednesday; saw it succeed beyond my wildest expectations on Thursday; then lost it an hour later because I’m an idiot. That part stings.
(original)
Replying to @josecastillo
As for the watch: it performed brilliantly on night one (overnight low: 46° F)! Then heading out at 5:00 the next morning I left it on the hood of my car; thus was the priceless first prototype lost forever, somewhere on Grand Loop Road. I’m actually quite bummed about it.
(original)
back from the camping blackout and holy wow, I see why Yellowstone is a crown jewel. I don’t even have words to describe some of these landscapes; they feel like something I’d expect to see on an exoplanet or a Jovian moon. Here’s a boiling geyser on the shore of a volcanic lake.
(original)
Replying to @cabe_bedlam
Are screwdrivers verboten? I feel like I always have a small one in my laptop bag…
(original)
Replying to @mr_rythom
maybe I’ll like this tweet after I deplane 😬
(original)
Replying to @josecastillo
side note: it feels like there was a time not too long ago when this would have freaked people out.
(original)
Replying to @av1d508
It warms to skin temperature while worn, but once you take it off it stabilizes to ambient in about 20 minutes. Curious whether temperature while worn could be useful to relate to body temp; my understanding is skin temp also relates to ambient temp, and it’s tough to untangle.
(original)
Replying to @audreydodgen
Yellowstone with my sis! Our first time there :D
(original)
Replying to @josecastillo
I’m not going to say the code is great, but it’s not bad for a couple hours’ work. It shows how I imagine one might use the framework to write a simple app with several modes, and make the most of the three buttons by using them differently in each mode. https://github.com/joeycastillo/Sensor-Watch/blob/8f0aeb0217c6fe5f4778aef95cf719cfb5ebd399/Sensor%20Watch%20BME280%20Project/app.c
(original)
Replying to @josecastillo
It’s not the most useful thing on your wrist — all it can really log is your body heat — but the intended use case is, you toss the watch outside your tent the night before. Then in the morning you can play back the data, see the overnight low and maybe write it in your journal.
(original)
just pushed code from 34,000 feet over western south dakota. I wanted to have this app done so I could test it on the camping trip: the Sensor Watch as Hiking Log. Clock mode, live temperature display, and a logging mode that stores up to 36 hours of data points for later review.
(original)