What I'll never understand about this whole thing is why most people seem to easily tolerate the rigamarole of maintaining an entire host SBC OS and sending or even cross compiling binaries to it, for microprocessor work. I much prefer maintaining a dev env on machine(s) and sending and flashing a binary over the wire. Maybe I just dislike state, but the pico (and several other MCU ecosystems these days) make it so easy to
The advantage is familiarity, I think.
Like: I suck at code. But I've known how to walk around in *nix systems and use things like bash to chain together commands like awk, grep, and sed for ~30 years. Maybe I'd even toss in some badly-cooked perl or python (or both!), when that seemed necessary.
For a very long time, I've been able to get some things done, but my skillset was focused on doing these things with real computers with live filesystems and real user interfaces, not MCUs.
So, some years ago: When I wanted to turn a window fan on and off based on some network-retrieved weather conditions, I didn't even consider an MCU. I didn't want to learn a new way of doing things; I just wanted a computer to get some data and decide whether to turn the fan on and off. And I wanted that done sooner instead of later.
I accomplished this with a Raspberry Pi Zero W -- with the whole OS. I didn't cross-compile anything. I didn't have to target some weird-looking external environment, or learn a new way of doing things.
Setting up the dev environment was very familiar: Dump a binary onto an SD card, boot it, get it onto the network, and use it.
I just SSH'd into that tiny little computer like I would any other Linux box and wrote my stupid little cobbled-up scripts right there, in-situ, on the final device that would be performing the work -- with a familiar interactive shell.
The end result worked very well. I'm not ashamed of any of this at all.
---
Later, I switched from networked weather reports to an RTL-SDR dongle and software decoding to listen for over-the-air broadcast reports from someone else's nearby APRS weather station, and used that as a source of weather data instead.
Can we even get that done in MCU land? (Should we even try to do so for just one window fan?)
In MCU land you can definitely listen to and decode OTA sensor data without using something as powerful as an RTL-SDR.
Consider common consumer wireless indoor/outdoor thermometers which have a temperature sensor you place outside and a display you place inside. Most of these use a much simpler radio protocol than WiFi or Bluetooth, and have nowhere near the compute power or memory resources to come anywhere near running Linux.
On the transmit side they typically have a fixed frequency oscillator (commonly near 433 MHz or a little over 900 MHz) connected to an antenna through a transistor. They send data by turning that transistor on and off. There are a variety of ways they might do this. Some might do it as pulses with different widths for 1 and 0. Some might do it by having have say 200 us on followed by 200 us off mean 1 and 200 us off followed by 200 us on mean 0. There are many more.
For home built stuff you can by cheap transmit modules to help with this, such as this one [1]. I'm linking to Sparkfun because they have good documentation, but you can find these all over the place.
On the receive side they use a simple receiver tuned to the same frequency (but with enough tolerance that it isn't a problem that both sides are probably using cheap oscillators that aren't very stable or accurate). Here a receiver module for home built stuff [2].
From what I've read the ways these work is that they automatically adjust the gain to have a constant high output level, but there is some lag in that. If there is nobody transmitting the output is just amplified background noise.
Then when someone starts transmitting the gain gets turned down so it is just enough for their signal to have max output. Let's say they are sending 1s as a pulse of 200 us on, 100 us off and 0s as 100 us on, 200 us off. With the gain set so the on level is at maximum output the off level will be quite a bit below that. As long as the gain adjustment is slow enough that it doesn't turn up the gain too much during that up to 200 us off, the next on will still be readily distinguished.
In that example the transmitter is sending 1 bit every 300 us. The firmware in the receiver can look for high/low and low/high transitions in the radio output, looking for the pattern of several consecutive 300 us intervals with 100 us on/200 us off or 200 us on/100 us off. Interpret that is a bit string, and make sure when you design your protocol your transmissions start with some kind of signature so you can tell you are actually listening to the right sender, and it should work. If you designed the radio protocol reasonably you should be able to do the recognition with some kind of efficient state machine.
[1] https://www.sparkfun.com/rf-link-transmitter-434mhz.html
[2] https://www.sparkfun.com/rf-link-receiver-4800bps-434mhz.htm...
Regarding the SDR, the Pico can act as a USB host (honestly a huge win as you can plug in a keyboard/mouse). But it’s not able to run at USB 2 speed. There’s no software for it and the CPU probably isn’t powerful enough. So in that case a Linux machine is completely justified. I tell people to reach for a Pi when they need both Linux and GPIO. But if you just need GPIO you should really save the money (and get major wins in simplicity) with the Pico.
I get the familiar angle of using a Pi Zero. But don’t be intimidated by the Pico. Especially these days with the help of an LLM, you’re not slowed down too much. The version of Python they run feels very familiar. The tooling is good. They’re awesome!
Oh, these days I still suck at code. And with the bot, I can hammer out a project for ESP32 or a Pi Pico in no time. (I didn't even put together the dev environment for that. I had the bot do it.)
And because I still suck at code: If I want to create something myself, then I still get to do that with a Linux box using unix methods.
That all said: I do enjoy working with RP2040 PIO assembler sometimes. The combination of its severe limitations and robustly resolute timing makes it both approachable, and fun. :)
Anyway, I think all methods are OK. There's no reason to judge them. (I think it's also OK to just use a computer to read Facebook, or as a porn machine, or to become an Amish leatherworker and leave all of this digital nonsense behind.)
The PIO is super cool. I haven't had a good use case for it yet but will enjoy messing with it once I do.
Party I am petitioning for passersby who might be wincing at the new prices for Pi 5s etc. for starter electronics/programming projects when they could save a ton of money with a Pico. I have to assume that a huge chunk of Pi 5 purchases from consumers end up with the computer either stuck in a drawer, having been used for a couple days, or running a workload they are completely overpowered for. Every time I see the new prices I wonder how much lower they would be if the consumers were better informed and demand was more appropriately redirected.
To give a specific example of a misused Pi, I've seen an RFID access system made by a hobbyist (low stakes, no need for professional/commercial solutions) running on a Pi 3. When the system glitches (another matter entirely - messy code) and needs to be rebooted you need to wait a minute or two for Linux to start up. I'm planning to replace this system with a Pico 2W. All it needs to do is handle a couple of buttons, a small LCD screen, and an RFID reader. We can handle all of that and a WiFi-accessible web admin interface using a microcontroller. Not only is it wasteful (for whatever that's worth) to have a quad core CPU, 1GB of RAM, and a whole Linux OS to perform such a trivial task. It's also leading to issues with complexity and performance.
I'm sure you're aware, but for the record the Pico has state. That's one of the best things about it. You have a very fully featured Python environment (or rust, or C) with a read/write filesystem. The WiFi SDK is also super useful. They can make HTTP requests (and HTTPS without full CA validation), host an HTTP server, even host an access point.