Which Lens for the Pi HQ Camera?

I bought two of the Raspberry Pi HQ Cameras. One is out on the balcony with a 6mm lens taking my weather time lapse images. I am very happy with that lens, even though there’s a pronounced barrel distortion. I haven’t noticed too much chromatic aberration (think rainbows around bright spots), though, which is surprising in such an inexpensive lens.

The issue I have is the sensor crop (for non-photographers, sensor crop is the artificial “digital zoom” added because the sensor is smaller than the image coming out of the lens). There is significant sensor crop when shooting the Pi HQ Camera with a C-to-F adapter and Nikkor lenses. For example, a 50mm lens is pretty wide. I use my Nikkor f/1.4 50mm lens for things like “going hiking and don’t want to lug an extra 12 pounds of glass”, visiting sailboat shows, or doing architectural photography. It’s actually a little wide for portraits. I don’t like the slight distortion of facial features with shorter glass; I prefer my Nikkor f/2.8 70-200 ED VR lens, and I either shoot outside or from across a room. The bokeh is so sweet with that lens! But I digress.

If I put the 6mm lens on the Pi HQ Camera and set the tripod at the end of the bed, I get self-portraits that includes the entire headboard, half the shelves, and a bit of the side table. The image is quite wide. The quality of the camera, though, is high enough that you can crop the resulting image and still have a good quality picture.

For example, this was shot with the 6mm lens from 2 1/2 feet away, and then cropped in post.

Here’s twice the distance shot with the 50mm.

[Raspberry Pi 3B+, Raspberry Pi HQ Camera, Nikkor f/1.4 50mm lens, range five feet]

This is not going to be my go-to selfie lens. I suspect it will, though, make a good landscape and nature lens. When it stops raining I’ll pack up the tripod, camera, Raspberry Pi, keyboard, mouse, and power banks and wander over to campus to try it out.

As for the selfie lens, I need something between 6 and 50 mm. I have a beautiful lens (nicknamed “the volleyball lens” because it’s perfect for shooting volleyball from the floor) that might work, but it’s the Nikkor f/2.8 28-70 ED VR with a 77mm objective. It’s too heavy to just hang off the front of the Pi HQ Camera. I’ll need to design and 3D print some kind of bracket to hold the lens, and then just let the camera float off the back.

I also tried the Nikkor AF-S 18-55mm DX VR lens, but there’s a lot of glass in there, and it doesn’t have the objective size or aperture to let enough light in. It would be ok in bright daylight, but this is the Pacific NorthWest and we don’t get that until next Spring.

When I get enough data and establish the camera settings I’ll write a post with a table of suggestions.

November 7, 2020 at 5:32 pm Leave a comment

Sunrise Streaming Through The Fog

The Pi HQ Camera that I use as my weather cam caught a decent sunrise effect this morning (2020-11-02). I approve.

[Raspberry Pi 4 4GB, Raspberry Pi HQ Camera, 6mm lens]

November 2, 2020 at 11:14 pm Leave a comment

Astrophotography Failure

Well that experiment was an abject failure.

I built a portable picture-taking rig with a Raspberry Pi 3 B+, a Pimoroni HyperPixel4 display, and a Raspberry Pi HQ Camera with the 16mm lens. Then I sat on the sidewalk (and it’s chilly) for an hour trying to fiddle with the focus, and the exposure, and the very sketchy network connection to the iPad in order to attempt a full Moon picture. That attempt failed miserably. Way, WAY too little glass.

I’ve ordered the Nikon-F mount to C-mount adapter. This will let me use my big Nikkor lenses on the Pi HQ Camera. Then I can take Moon pictures with my 35-70 f/2.8 with the 77mm objective. If that doesn’t work, I’ve also ordered the C-Mount 1.25″ telescope eyepiece adapter, so I can just bolt the camera onto the back of my actual telescope. That’ll do the trick. When in doubt, brute force….

November 1, 2020 at 10:12 am Leave a comment

What’s With the Fountain Pens?

It’s simple. My brain remembers material better when I hand write notes rather than typing them. My hands get very sore when writing, though, so… fountain pens, since you don’t apply pressure. It’s essentially painting ink on the page.

Yes, they can appear snobby. Yes, they’re (relatively) expensive. Nonetheless, they’re works of art, they write beautifully, and they help me do better work, and that’s good enough for me.

My current favorite is the TWSBI (pronounced TWIZ-bee) Diamond 580 filled with Caran D’Ache Hypnotic Turquoise ink.

Yes, I do still need to work on my handwriting.

October 28, 2020 at 2:00 pm Leave a comment

Weather Camera Sunrise on Molly’s Birthday

The weather camera caught a nice sunrise on Molly’s birthday.

[Raspberry Pi 4, Raspberry Pi HQ Camera, 6mm lens]

October 27, 2020 at 12:21 am Leave a comment

Did I Get Punked by Advertising?

I always say advertising doesn’t work on me. Unfortunately, I’m wrong. There are specific instances where advertising seems to work on me:

  1. When I’m watching a sporting event, and a commercial plays for a restaurant I already like, it might work and I’ll order from that place.
  2. Fountain pens – I’ll get email from a purveyor of pens, ink, and paper, from whom I’ve already purchased and had good experiences, saying, “come look at these new products…” Yeah, I’ll sometimes spend money. Lookin’ at you jetpens.com, gouletpens.com, and levenger.com.
  3. Electronics-related email, YouTube vids, or Adafruit learning guides and I’ll drop coin for the shiniest new bits – my last indulgence was an I2C PM2.5 particulate matter sensor – oh, yeah.

In following YouTube fountain pen videos in autoplay mode while I do other things, like work on wiring a prototype satellite (I’ll write more about that later), I ran across a young woman (@studyquill) who is unnaturally organized. When she was in high school she wrote a successful book on study habits. As someone who is unnaturally disorganized, I started to pay attention, and eventually subscribed to her channel (in spite of some annoyances).

Hold that thought. They other key piece here is that I have a 2018 iPad Pro 12.9″ (I hear people mumbling, “of course you do”) and I’m exploring ways of using it effectively for taking notes and making drawings (those of you who know me well enough are laughing). I use ProCreate for fumbling artwork and an app called Concepts for note-taking. Concepts is supposed to be a drawing program like ProCreate, but it works for my style of note-taking, which means it supports fast color switching for color-coding my notes, endless canvas, and adjustable splines for drawing and writing. I also got an Apple Pencil, which I always thought was kind of a dumb gimmick until a graphic artist friend said he used the pencil every day and couldn’t work without it. Ok, so I tried it (spoiler: get one).

The one thing that bothers me is the pencil slides on glass like it’s on… well, glass. Very slippery with little tactile feedback. That’s annoying but I thought that’s just what it is.

Here’s the confluence of these random-seeming threads.

I was watching @sutdyquill and she had a sponsored video (here we go – the advertising tie-in) wherein she talked about the slippery-glass problem (which I have). The sponsor was a successful KickStarter project called “PaperLike.” It’s a tactile feedback screen protector for the iPad. Apparently, it provides just enough tip drag to feel like paper, or at least like not-glass. Phil immediately drops coin on paperlike.com for one.

I would say advertising worked.

Since then I’ve seen one negative review, but I have that gut reaction that it was designed to get people to buy a specific alternative product, so I take that with a huge salt-lick of salt.

Whether I got punked by advertising remains to be seen.

October 22, 2020 at 2:28 pm Leave a comment

It’s snowing a bit in Redmond.

We had six inches of snow over the weekend. Tonight we’re supposed to get an additional two to three inches. Last night was a 30-car pileup on the 520 bridge. Stevens Pass is “closed indefinitely.” All the slush from the weekend snow has turned into sheets of ice. I’ll be staying inside until it’s cleared off since I can’t risk falling, because reasons.

January 15, 2020 at 3:51 am Leave a comment

CircuitPython 2020 Thoughts

Adafruit has asked for feedback on CircuitPython goals for 2020. Here’s their list of topics. I’ll add my comments in a different color so they stand out. This was just off the top of my head, so I’ll make updates if/when I think of other things. Comments from others that I need to incorporate will be in this dark green.  I guess I’ll make my own additional thoughts in this color.

First off, I would like to give credit and thanks to everyone who makes these projects possible!

Projects you’d like to build

Oh boy. That’s a lot.

  • Finish the Sphero Adafruit CircuitPython library.
  • Finish the Sphero RVR Cat Chaser (uses Blinka).
  • Update my weather station to do a better job of maintaining persistent data through restarts (uses Blinka).
  • Revised home security system.
  • Figure out why Feathers occasionally just lose their brains and require manual reset. This happens when they’re gathering data and pushing them up to AdafruitIO, for example.
  • Learn how to design PCBs and create a multi-cell-bank Battery Management System for large-ish rovers. I’m thinking SAMD51 with large flash and SD card interface, with a bootloader installed (how do I do that?) to control the charging and discharging cycles.
  • Design and built large solar panel array to pump electricity into above-mentioned BMS to maintain charge on large battery banks.
  • Build custom PCB, again with bootloader and CircuitPython, for the High Power Rocket Flight Control System.
  • Plan some high energy physics projects.
  • CANbus (OBD II) hacks?

Things you think could be easier

No offense intended to any of the contributors!

  • Firmware build workflow.
  • Debugging hardware running CircuitPython. Maybe I haven’t spent enough time doing my homework, though.
  • Submitting feature request/suggestions. (Is support@adafruit.com correct?) Scott says, “feature requests should be done as GitHub Issues.”

Additional community programs

Weekly meeting

I hadn’t really thought about this. The CircuitPython weekly meeting is very good, and Discord #circuitpython is great.

The only thing I could possibly suggest would be a live stream “CircuitPython Office Hours” (waving at Scott) where the “regulars” can take questions about CircuitPython, or, perhaps, pick one project/problem and do a deep dive into figuring it out. Scott says, “the in the weeds section [of the Monday CircuitPython status call] tends to be the place we take questions now.”

I was actually thinking more along the lines of a university professor or teaching assistant office hours, where any of the students can show up for detailed help or questions. “In the weeds” feels more like the Q&A at the end of Ask and Engineer. Also, since I didn’t realize that was open to anyone, for non-CircuitPython-implementation questions, I’m pretty sure other community people won’t know that. Discord is great, and people seem to ask in either #help-with-circuitpython or #circuitpython, but I feel like people refrain from long threads in-channel. Office Hours would be a place to interact and teach in a more face-to-face way, if that makes any sense.

Core CircuitPython features

Core CPython libraries to add

Additional microcontroller platforms

RISC-V, but I think we’ve covered that in Discord conversations.

New boards to support

Wireless/USB keyboard and mouse FeatherWing with HDMI connector, so we can directly edit code.py and bits on the Feathers?

Library improvements


Additional libraries

  • Port the SD card support to STM32F.
  • adafruit_circuitpython_sphero (but that’s on my plate)

Package management

Documentation improvements

I’m not sure where it would go, but perhaps a master cheat sheet for CircuitPython? A Google Docs page, or a ReadTheDocs page, or a Learning Guide, or a Wiki. Something that puts all the information people need in one place. I’m thinking

  • Link to starters guides that Kattni wrote.
  • Links to the Library Bundle magic.
  • Links to the “how to add libraries” guide.
  • Links to the “how to build CircuitPython” guide.
  • How to request features.
  • Consistent workflow for “how to report bugs.”
  • How to do a pull request to work on patching code or adding new things.
  • Python boilerplate templates that include the standard Adafruit header info and sequences of code blocks. Mine are:
    • Docstring
    • Header comments
    • Libraries (standard, third-party, and package-specific sections)
    • Globals
    • Pre-Main Setup
    • Classes
    • Functions
    • Main

Scott says, “the awesome page is the master cheat sheet: https://github.com/adafruit/awesome-circuitpython

Learn guides

  • Several guides need to be revised or re-visited, or perhaps even retired (or marked retired.) I say this because, for example, the process I always used to build CircuitPython was to cd into my source directory, then “git submodule sync” and “git submodule update –init –recursive”. I learned in Discord very recently that the correct sequence is “git pull” “git submodule sync” and “git submodule update –init” (without “–recursive”). This particular one has been fixed, but I’m sure there are others. As a guide author I should go back and make sure all mine are still relevant and correct.
  • Finding the most current library Bundle with .mpy files instead of .py is somewhat hidden, since every time I need to do it I think, “now where do I find this?” I always end up opening a guide, finding the library section, clicking it, and then finding the correct .zip file. It would be great if that process were uniform and documented so it’s easier for people to do without referring to multiple sources.
  • It would be fantastic to get Randal Munroe (XKCD) to draw a “how to select the right boards” flowchart for Adafruit projects!


video tutorials

Ecosystem needs

the newsletter

Awesome list


Adafruit support forum

Discord channel

Tooling enhancements

Github Actions

the library bundle

Some comments above.

the bootloader

Where to get the bits. How to “install” them on a bare chip. How to debug.


January 2, 2020 at 12:43 am 2 comments

Finally some organization here.

I’ve spent entirely too much time throwing myself into my job(s) and not enough time curating my own content. I’ve added this blog, blog.moyer.ai, to my domain and will begin writing about things that I either enjoy or feel are important. This means there will be astrophotography that I’ve done, along with more serious topics like failures in cybersecurity risk assessment, or management’s culpability for the dismal state of information security in many (most?) companies. There will also be a fair amount of Maker content.

If you like, drop me a comment to let me know what you’d like to read about.

December 30, 2019 at 9:42 am 1 comment

Comparing Adafruit Gas Sensors

I am comparing the performance of the Adafruit CCS811 and SGP30 gas sensors. These sensors monitor the atmosphere for effective carbon dioxide (eCO2) and total volatile organic compounds (TVOC) and report those values when polled. You can artificially test the sensors by blowing on them and watching the reported values spike.

I wanted to make this comparison because I was running these sensors independently and I noticed occasional spikes or artificially elevated periods. In order to test the sensors and remove actual environmental fluctuations, I needed both sensors connected to the same board.

At first, I used an Arduino Nano, but then switched to an Adafruit ESP32 Feather. For some reason the CCS811 board would report only zeros. I suspect this is because the CCS811 uses I2C clock stretching, and the ESP32 probably doesn’t support that in hardware.

Enter the prototype Metro M4 Express. This is a new pre-production board (which I am helping test) from Adafruit. It runs a custom cross-compiled version of CircuitPython – currently 3.0.0 alpha 1 compiled on 2/27/18. There are CircuitPython modules available in Adafruit’s GitHub repositories for both the CCS811 and SGP30 sensors. It took me almost no time at all to compile the latest firmware for the M4, flash it, and connect the circuit that I used for the ESP32 test. Both sensors work flawlessly.

There is, however, the pesky case of spurious values. On a plot of observations vs. the difference between the readings (i.e., SGP30 – CCS811 values), we should see a flat line indicating the sensor values are moving in lock-step with each other, with perhaps some minor fluctuations. That’s not what we see, though!

As you can see, the SGP30 has quite large spikes that the CCS811 does not. This indicates that the SGP30 values are considerably less reliable than the CCS811, which is unfortunate because I like the electronics in the SGP30 a lot more (true I2C for one). Unfortunately, the numbers don’t lie: the CCS811 is a more reliable gas sensor.

March 1, 2018 at 1:23 pm Leave a comment