Tweets
Replying to @josecastillo
okay! So now we have two different (but similar) startup procedures: on the L21/22 we compare the analog voltage to the reference, and on the D11/21 we compare half the analog voltage to half the reference. In theory, they should work the same way. (and no more red squiggles!)
(original)
Replying to @theavalkyrie
It’s funny because coming from that direction to the D21 my reaction was just “this is weird.”
(original)
Replying to @josecastillo
it’s hard to count the number of times Thea’s blog posts have perfectly explained exactly the thing I needed explained. https://blog.thea.codes/reading-analog-values-with-the-samd-adc/
(original)
Replying to @josecastillo
ok wow THIS is fun! Subtle differences: the SAM L22 on the watch supports an analog reference voltage up to VDDANA, but the D21 only supports an analog reference voltage up to half that. It’s around this time in my firmware development process that I google @theavalkyrie’s blog.
(original)
Replying to @josecastillo
for gossamer, I’m keeping it simple, simple, simple. No matter which chip you’re using, the main clock is 8 MHz, clocked from an internal oscillator. It’s the fastest the D21’s OSC8M can go, or middle of the road for the L22’s OSC16M, but it’s common to all 4 chips I’m targeting.
(original)
Replying to @josecastillo
oh, this is a fun bit of code I get to delete! So Sensor Watch runs at 4 MHz (normal) or 8 MHz (if plugged into a computer). I wanted a slower clock to save power on-wrist, but needed a faster clock to keep up with USB comms. this necessitated a check when clocking the ADC. (1/2)
(original)
Replying to @josecastillo
advantage tho: while they are different, the differences are subtle. deep down they are very similar; you just have to use different words to say the same thing. It’s simple enough to be ifdef’able; this is one of the reasons I’m limiting my scope to SAM D and L microcontrollers.
(original)
Replying to @josecastillo
full disclosure: I have an advantage in that I already did this for Sensor Watch (left) and it works quite well. But, disadvantage: Sensor Watch used the SAM L22, which is different from the SAM D21, so it’s not like I can just copy/ paste the code. I can’t cheat off past-Joey.
(original)
Replying to @josecastillo
I’m going to dedicate one beer’s worth of time to getting the ADC working tonight, and add a display of the battery voltage. reasoning: the AC is a nice-to-have (I could just use the ADC at intervals), and the TC is going to be more fun to implement once I have LEDs to light up.
(original)
Replying to @josecastillo
specifically:
• analog to digital converter, to measure system voltage
• analog comparator, to watch light levels and detect nightfall
• timer/counter, to PWM some LEDs…actually now that I write it all out, it’s not “a lot” more, but still: it’s work, and we have to do it.
(original)
Replying to @josecastillo
ICYMI, gossamer is my lightweight C framework for building SAMD and SAML firmware. Where we left off, we had I²C working, plus the RTC and external interrupts. This got us to a low power clock using the LCD FeatherWing. But for this I’m gonna need more peripherals. A lot more.
(original)
ok wow this is escalating quickly. with solar stuff here, and a super sekret FeatherWing slated to arrive tomorrow, I may well have everything I need for solar project on hand in the next 24 hours. which means I need firmware. which means tonight is #latenighthacking on gossamer.
(original)
Replying to @Gabe_Ochoa
It’s from @voltaicsystems, distributed by Adafruit (but also available through Digikey). Adafruit stocks several of them in varying sizes, all with a similar peak voltage: https://www.adafruit.com/product/2747
(original)
Replying to @TreasureDev
It’s this one! I really wanted to use the 5V 10W one at the bottom of the product options list, but alas it’s been out of stock so I’m running with this one for now. https://www.adafruit.com/product/2747
(original)
Replying to @josecastillo
- bigger battery. 12 amp hours. I _really_ hope I’m close enough to knowing what I’m doing.
(original)
Replying to @bradanlane and @rohansingh
“A time vortex has delayed delivery. We’re adjusting plans to ensure you didn’t order it in the first place.”
(original)
For solar project I said we were gonna need a bigger panel? Here is the bigger panel. At almost a square foot it promises 9 watts of output in sunlight, but even at night it’s big enough to power a Feather + LCD FeatherWing with the ambient light in our kitchen — no battery here! https://twitter.com/josecastillo/status/1563374133437952000
(original)
Replying to @josecastillo
coda: the box arrived. The literal derailment of a freight train only delayed my package by one day, and the fact that the human cost of all that is baked into the system unsettles me. also unsettling: i’m glad to have the box, and I’m going to continue to make use of the system.
(original)
Replying to @kfury
Dunno why but your comment made me think of this: https://xkcd.com/209/
(original)
Replying to @matterpoetry
People still have this sense of incredulity about the whole thing that worries me. My dad saw this and his reaction was, “What were they thinking?!” when obviously the answer is “They were thinking it was going to work.” And it still might.
(original)
Replying to @guidoism, @bigattichouse, @Bfreecomputers and @adafruit
If someone with a better grasp of the math wants to play with it, I found a data sheet for what I think is the module in that teardown. The promise is between 120 and 210 microjoules at 2 volts, when you press it with between 2.7 and 3.9 newtons of force. https://www.enocean.com/wp-content/uploads/downloads-produkte/en/products/enocean_modules/eco-200/data-sheet-pdf/ECO_200_Data_Sheet_June2021.pdf
(original)
Replying to @guidoism, @bigattichouse and @Bfreecomputers
ooh I know this one! @Adafruit did a teardown of a Philips Hue Tap, a battery-free Zigbee light switch that uses energy harvesting from a button press. And the answer is… likely not. Anything you could do in a millisecond or less though: maybe! https://www.youtube.com/watch?v=4T4nhuobjZM&t=1800s
(original)
Replying to @steubens7 and @tahnok
Okay wow I was about to ask you what magical incantations are required to do this, but then you just gave me the whole cheat sheet. Thank you! I am hella working on this over the weekend.
(original)
In which mom discovers the planet earth picture frame. Truly our family embodies the 🤓 emoji.
(original)
Replying to @bigattichouse and @Bfreecomputers
https://twitter.com/josecastillo/status/1503070019630030849
(original)
Replying to @bigattichouse and @Bfreecomputers
Fact is, epaper screen updates use something in the range of dozens of milliamperes. And the Pi Pico draws a couple hundred microamperes. The only display tech that I think could swing something like this is the Sharp Memory Display, and even then only with a super low power MCU.
(original)
Replying to @cogliano
These look great!! For my thing I used Python and the Python Imaging Library, and I’m being generous calling it a “web service”; at best it’s a python script hooked up to a cron job. but it works!
(original)
Replying to @Bfreecomputers
that would just be a book! Which to be fair is a really impressive piece of technology. Portable, durable and battery-free, with numbered pages that allow for random access (as opposed to scrolls that you had to scroll through)
(original)
go home, autocorrect, your drunk.
(original)
Replying to @josecastillo
Epilogue: woke up to the gadget showing sunrise on the east coast. The system works!
(original)
Replying to @josecastillo
Outtakes from the photo shoot. Also, shout out to @PCBWayOfficial for sponsoring these boards! This was black silk on white soldermask, and I’m hoping to convince them to sponsor the 20 boards for Supercon to show off some of their more advanced capabilities. I have a ✨vision✨.
(original)
thanks so much to @FairywrenTech and @hackaday for writing about the new Open Book with @Raspberry_Pi Pico! This is probably as good a time as any to mention that I’m going to be at Supercon this November — and I’m planning to bring 20 Pi Pico book kits… https://hackaday.com/2022/09/29/open-book-abridged-oshw-e-reader-now-simplified-pico-driven/
(original)
Replying to @jasoncoon_ and @gvy_dvpont
This was a wonderful exchange to wake up to! 🥰
(original)
Replying to @gabrielcsapo
For things I want to trust I buy from Adafruit, but this is one from Aliexpress. this is one of the things that scares me about anything I do that needs an odd-sized lipo: I don’t know how to source the way they do, and the stakes seem higher for a battery than some random part…
(original)
Replying to @josecastillo
by changing one bit in our display setup code we turn the border from gray to black, and give our blue marble a bit of extra space on all sides. It has to be the same color all around, but in this case we’re aiming for the ink-black desolation of outer space… so it works out.
(original)
Replying to @josecastillo
one last trick then I’m calling it a night (early _dayjob meeting tomorrow). little known fact about these e-paper displays, they have one extra pixel: the border. There’s an electrode connected all the way around the screen, and deep in the datasheet there’s a way to control it.
(original)
Replying to @josecastillo
I had bought this slim battery to evaluate for a future open book board, but I looked at it and evaluated that it would work and now it’s collecting dust. So I’m putting it in the service of the planet earth.
(original)
Replying to @josecastillo
POWER TRACES! The screen update phase takes ~30 seconds. All @ 3.7V: clearing the screen, 67 mA for 28s. Fetching data over wifi: 124 mA for 9s. Displaying the blue marble: 93 mA for 30 seconds. Back in sleep mode: 0.018 mA for THE REST OF THE HOUR. This gadget will last a while.
(original)
Replying to @josecastillo
haha never mind, it ran; I just had to wait. Don’t bookmark this just yet — I may decide to change the URL or the image format — but in theory this should keep updating every hour for a bit. https://earthframe.nfshost.com/goes-east-fulldisk.bmp
(original)
Replying to @davidskeck
Grab you one of these Inkplate gadgets! With any luck, by the end of the week I’ll have a website serving up real-time GOES imagery in dithered 7-color e-paper glory. https://www.crowdsupply.com/soldered/inkplate-6color
(original)
Replying to @josecastillo
lol the cron job did not run. (I don’t technically have crontab access; I’m just setting it up in a web hosting admin page). There’s prolly a better way to go about this, like fetching the image when requested, caching and fetching again when stale. IDK, I’m not a full stack guy.
(original)
Replying to @josecastillo
I’ve set the cron job to start in eleven minutes; why not test in prod when you edited the script in nano in prod. we’ll find out if it works when it works. Until then, the python script: https://gist.github.com/joeycastillo/317816ad36491a2a79389d97b53f5b3e
(original)
Replying to @josecastillo
So what’s left here? A cron job to automate the running of this script. And a sketch that enters deep sleep and wakes the Inkplate once an hour to fetch new imagery. Stretch goal would be to add GOES-West or some of the close-ups, and use the three buttons to switch between them.
(original)
Replying to @josecastillo
NAILED IT!
(original)
Replying to @josecastillo
Moment of truth. I’ve decided to rewind to a little earlier in the day to get some more daylight; this is the image as converted by my python script. (IIRC the e-paper inks are darker than you’d expect, especially the green, hence some of the over-the-top-ness of the saturation)
(original)
Replying to @josecastillo
Well oh wow! And props to the @eradionica folks — their Inkplate library handles displaying regular old images downloaded from the web! Meaning I don’t even have to convert hackily to a bytearray; I can just have Pillow dump a bitmap in a public folder and call it a day :)
(original)
Replying to @josecastillo
OKAY! We can build. Next step, did my hacky python script actually output the right bytes?
(original)
Replying to @josecastillo
(as a side note, the mode for me finding this was guessing the format of the board def’s name from other boards in boards.txt, searching all the org’s repos for that string, and getting lucky. good documentation is important!) https://github.com/search?q=Inkplate6color.name&type=code
(original)
Replying to @josecastillo
phew. ok. I think it was just an outdated documentation issue. looks like there are two board support URLs and the new one hasn’t made it to the getting started guide. Take two:
(original)
Replying to @josecastillo
Not promising at all. (ARDUINO_INKPLATECOLOR doesn’t appear anywhere in the board defs)
(original)