Wirelessly control 49 MHz toy with I/O line flipping on Pi Pico
Вставка
- Опубліковано 7 лют 2025
- Figuring out how to send commands to an unmodified 49.86 MHz remote controlled toy by only toggling an GPIO line on a Raspberry Pi Pico, using the Pico's PIO state machines
You've always been one of my favorite channels, but now with 'pseudo machining', and more microcontroller, and "bit banged software defined radio", this is quickly turning into one of the premiere casual engineering channels!
I understood precisely 0.0.012% of what was talked about here, and I still loved it. Have another upthumb 😊
This is exactly the kind of rabbit hole I can really appreciate. I hope I still have the mind to allow me to explore these itches when I finally get to retire.... someday. 😅
Amen. Although, I can’t see myself ever retiring.
Better do it now. I’m involuntarily retired and I just can’t anymore (burnouts suck). But I agree, it’s an awesome piece of dirty engineering :-).
As a lot of other commenters I really like this.
For me there’s no “you have to focus on *one* interest.” Everything is just fun and creative.
I haven’t tried the pico that much but it’s clear that the timing (when using Python) is much faster than the old, for example, 3b versions of the Pi.
And speaking of assembler (assembly) language, well I’ve programmed USB descriptors on PIC, and I think this ARM would be a fun challenge, but.. this video shows that Python and the pico is ok for even quite fast things.
Great little foray into SDR. Always impressed by Mathias’ broad range of general engineering knowledge. Especially combined with tools like ChatGPT that suggest different paths / help make you aware of existing technologies, the sky’s the limit.
That oscilloscope trick was really neat!
This is great. I have a whole new set of experiments for my mini pi now. In retrospect I should have realised that this was possible. Budget friendly remote controlled lawnmower is my ultimate goal at this point i think.
you still need a receiver. The whole ESPnow wireless thing might be interesting to explore.
I think "budget friendly remote controlled lawnmower" is one of the scariest phrases I've heard in a long time! :)
High low, high low, it's off to work we go! :)
[Long blank silence after watching this video, then whispers in a tiny voice] "...But can I use pocket screws??"
Meanwhile various devices in the neighbours houses are switching on an off... :)
Best comment, lol, Thank you for the laugh
Some day, I might understand what exactly I listened to. Like the mouse trap video that I watched before ever doing any wookwork. Now I have a collecrion of tools and knowledge. Much comes from you and others from yt. Thanks for all of that!
I have no idea what he was talking about. I got lost after 28 seconds. But he is so good, love the videos!
Reminds me of the (now very old) pirate radio instructable that used a first generation raspberry pi, where it outputs FM audio from a single IO pin.
Man, you give the Professor from Gilligan's Island a run for his money.
0.o They were stuck for years and he was no help.
@@MrWizards1974 And we all have been (willingly) "stuck" here on Mathias's Island channel (happily) for years, so maybe not such a stretch. I mean, most of what he says does not help me (because I do not understand it), but I watch it all anyway. ... [haha]
I remember watching a mousetrap video one night maybe a decade ago which made me sub ...not quite sure how the channel ended up here but I'm still all in lol
Matthias your brillance sets you apart. No wonder you are a wood worker.
this was super fun to watch. Thanks Matthias. I think it is your excitement that is infectious. More projects that you find interesting!
I listened to this morning's Democracy Now shortly before watching this video, and then there was the exact same broadcast at 7:04. So the footage was from today. That's a quick turnaround!
Super cool that timing like this is achievable on the pico, and that you can send data so far through the air with just a GPIO pin and a tiny wire. Great project.
I just watched you speak a language I can't really understand for about 8 minutes. And i liked it.
my mechanical engineer brain only understood like half of what he said
Friday night I lay in the bed watch Matthias and drink a beer.
Matthias hacks his kids toys. 😂
Hah, I'd never have thought to do what you did with the scope to measure without the counter.
I'd personally have looked for the pin that drives the oscillator in the controller, then pulled that high so the scope could get a good read.
Amazing resourcefulness
I had previously measured it with the cursor so I knew it was 49.8-something megahertz, but couldn't get it close enough.
I knew I was very close because I have a set of computer speakers that picks up both transmission, and the beat frequency of interference was getting quite low.
I love this tinkering so much. You’re the best 👍
I didn't understand any of that. But it's still fun watching you be your usual smart self.
living proof that you only need a normal computer, excel, terminal, a 4$ microcontroller and a toy (and a big brain) to do some cool stuff.
you forgot the 2k oscilloscope
@@RFDarter 250 euros with free shipping.
@@onurson4000 I would want to see the oscilloscope for 250 tha can process such high frequenzys
@@RFDarter just google Hanmatek DOS1104
@RFDarter The one he uses is sold on AliExpress for roughly 160 USD. I didn’t want to believe it either.
Dude, this is so cool!! Congratulations!!
You can overclock the RP2040 much much faster than the datasheets suggest -- most chips will run at 250-260MHz without even breaking a sweat.
Past about 270 MHz you have to pull a few more tricks, including executing from SRAM (since the SPI flash chip stops being able to keep up), overvolting the chip (modify VSEL in the VREG_AND_CHIP_RESET register to select 1.15 or 1.2 volts instead of the default 1.1), and providing additional cooling; but with some luck you can get the RP2040 all the way to 1 GHz.
Can we talk about that wooden junction box you have on the floor at 6:51?
Pi-FM-RDS does a pretty decent job with a full sized Pi and a 1/4 wavelength dipole, but I think it can clock the PWM at many hundreds of MHz. :)
I think the thing that's MOST interesting about being able to manipulate it via the PICO, is that you can pair it with a Pi to make a WiFi FPV rig with a camera and remote control from a computer interface in a programatic way. Could honestly hack it to do a lot of rudimentary automation patterns for some kind of proximity sensor, tbh...something latching into an "on" position when it received the carrier signal, and maybe cycling a pattern of responses based on the zone the object is operating in, as encoded by the carrier signal's enconding, like having the car follow a programmable "ghost track" by having each "pixel" of the track signaling a different direction. So it turns as if the human is manipulating it to do that, but in a programmatic way. It makes me think of a very backyard Amazon Warehouse robot system!
Amazing how useful bit banging can be on modern high speed processors.
Wait until you discover ExpressLRS, Matthias... You'd have a freaking lot of fun! 😂
Stay safe there with your family! 🖖😊
Absolutely no idea where is going on but I enjoyed watching! lol
that is incredibly esoteric!
you can xmit anything you want as long as you're radiating 100mW or less.
I love that embedded boards are *so fast* that the current generation can learn RF games not as abstract formulas, but as "you can just *make* that waveform" - the math helps of course, but the direct connection makes it so much more "real"...
And the neighbors are all wondering why their FM radios bonk out when Matthias's kid starts yelling to please let him play with his RC car. I bet they never make the connection. . .
You probably know how dds works. You add a phase increment to a phase accumulator at a fixed and fast rate. Possibly serviced by an ISR or something. Normally you would feed the phase to a phase-to-voltage converter to generate a sine wave. But for a square wave, you can directly use the most significant bit of the phase accumulator. So it would be a tight loop. Add phase increment to accumulator. Mask out msb of accumulator. Set gpio to be equal to msb of accumulator. Repeat. The phase increment is also called the "frequency tuning word." Since the first derivative of phase is frequency, that makes sense.
yes, aware, but the PIOs on the pico don’t have the necessary math instructions, nor the cycles to spare,so just went with fixed adjustment intervals
May not be very useful, but sure was interesting! Pleasant video, Matthias!
That's a nice video about wood gears.
1:22 this is such a clever method
I bet you could clean up the signal quite a lot with a low pass filter. You might even be able to get some premade ones for the 6m (50mhz) ham bands. but you could also pretty easily do it yourself with a hand wound coil and a capacitor.
Did the reverse of this, got a really nice remote control from the bin, found out it was for some sort of cheap airplane like toy (looking like a dragon), 2.4GHz, used an nrf and and pico to decode it. The remote has 2 joycons, 8 buttons and a small LCD. That was fun and hard at the same time.
what's an NRF?
@@matthiasrandomstuff2221 Nordic Semiconductor has a bunch of rf modules named nrf (more than one series), they were/are pretty ubiquitous, even Sparkfun carries them.
Oh, that aliasing trick is smarrrrt..... Thanks!
Love thisss!❤😊
So damn cool Matthias..... as always!
Brillant and interesting again.
random childhood toy that an autist just dumped ALL the information for how the radio worked.... Genuinely love this
Its happening. I even barely understand the title of the video. Before it was just parts of the video.
Wirelessly TX-> wirelessly transmitting
49 mhz -> specific range for car to understand stuff
I/O line flipping-> turning a switch on and off using a computer
Well did you get anything out of it? Pretty interesting I think 😊
@@FiveSixEP What's aliasing?
Makes total sense why he was hired by blackberry
super cool
Just amazing! :D
That’s crazy, I just bought a 49 MHz Vintage Tyco RC car from the thrift. I was trying to figure out how to make it work without an original remote.
Awesome, just subbed !
Lovely
High Low, High Low, it's off to work we go😊
Ah yes. The intentional unintentional radiator.
incredible
I'm not sure what you just did, but I want to do it also!
Im pretty sure as long as you don't put a tuned antenna on it, the broadcast will definitely be below 25mW in strength so it shouldn't go long enough for the neighbors to notice so the fcc will probably never find you or care. But it you do put a tuned antenna and an rf amplifier it may cause interfere at the neighbors house. If you want to do that just buy a proper transmitter so its fcc legal! You could probably just wire the pico to the conteoller and use it that way. But I have seen a few radios with these little microcontrollers recently.. many years ago I played with an arduino mega like this. But it is very limited speed.
If you're ever trapped on mars without a working radio that might prove very useful :)
Super!
This is the kind of content that I really enjoy! What a Venn diagram of my interests! Question - your mention of FCC made me wonder - Do you have you have an amateur radio license?
Matthias, very ingenious to work this out! As an aside would you consider doing a video on your calculators? You seem to have a few dotted through your back catalogue - TI-30XA, Media SS650 etc, thank you!
I'm not into calculators. I just use what I have lying around.
afaik the pio has a clock divider that can do 8 bit fractions. Another option since you are generating square waves is to generate a lower frequency with an (odd) harmonic on the desired frequency
but then I'd have way less power in the band I actually want
@@matthiasrandomstuff2221 sure, 1/N but for an FM radio you don't need much
@@matthiasrandomstuff2221 i don't know if you've heard about it but Charles Lohr (CNLohr on youtube) did just that bit-banging the LoRa protocol on CH32 and ESP32 microcontrollers, they managed to transmit packets over 2.5km with some aliasing/harmonics black magic... don't know what else to call it xD
I wonder if you wind the wire like a spring to extend the range.
Are you an programmer or a radio technician?
Matthias: ...Yes
There’s a house I pass daily and every time I do the radio goes out and I’ve often wondered if they’re running some broadcast to block the station I listen to.
Idea: PWM is a squarewave. You don't have to use the fundamental, you can use the 3rd or 5th. The master clock can thus be clocked lower
Then most of my power ends up out of band. Also, I now have to be 3x as accurate with the edges, and the frequency also needs to be 3x as exact. Nothing gained really.
@@matthiasrandomstuff2221 I thought that because the clock is high, precision was unavailable (seen in 0:52)
Cool trying to follow, but did something to my brain.
Having done some basic Arduino programming in college a few years back, I think I understood most of the bit-banging in this video, but I didn't understand how sending signals to a GPIO pin meant for wired transmission was able to be transmitted wirelessly from this video alone. Is there a more in-depth explanation for that aspect of this technique?
3:54
BINARY SOLO!!
This is quite similar to a RAMBO (Radiation of Air-gapped Memory Bus for Offense) attack
I don't understand a word you just said but it was kinda awesome
That's cool and all. But can you share what happened to that fnirsi scope you reviewed not long ago?
I bet Claude Sonnet would have got it in one go, it's a beast when it comes to MicroPython
agreed. also I think he's doing something a lot of us are, suddenly being able to do a lot more weird stuff without being turned away, by using llms
Can you listen to the remote control from the PI without an extra amp thing?
Your PWM has become QRM heh.
Just curious ... At 6:20 you mentioned FCC regulations. Is there a Canadian FCC? Or were you referring to the US
there is its a department called Innovation, Science and Economic Development Canada (ISED; formerly Industry Canada)
I'm curious what the lowest frequency you can hit with the arduino is.
How aboot wooden gears?
As a Canadian the crtc will have your head
No worries the CRTC is a useless bureaucratic mess.
poor mans software defined radio
Just a poor engineers software defined radio approximation...
Can it work with 27MHz toys?
I don’t see why not
"It seems to run on some form of electricity"
Screw FCC regulations! Do what you want and have fun while doing it
Yes, the FTC will come after you for this. No they likely will not find you but that's just a matter of not having the people to actually search all the areas
Well that escalated quickly.
So far what I've learned from this video is that I have a long ways to go in learning to use my scope, and RF is indeed black magic
That frequency hack is genius. Did you figure it out yourself or is it already used in some applications?
I knew the signal aliased a lot when looking at a longer bit to see the modulation. so why not take advantage of that? only really useful cause the frequency is close to one of the scope’s sample rates.
"the FCC would like to know your location"
Canada.
Mathias, unrelated question for you:
I'm making a plywood tool hanging wall thingy. Should I use 1/2 or 3/4 inch plywood?
Half inch is strong enough and will be a lot cheaper
If you want to hang stuff off of screws driven into the plywood, go with thicker. If everything is tool holders, thinner will do too, as long as you don't mind the occasional screw going through the plywood into the wall too.
You should know that Matthias never does anything in inches.
@@Manigo1743 but all material in Canada and the US comes in inches, so unless you want to plane down your plywood on your 4' wide planer...
@@gorak9000 Except it's all actually manufactured using metric sizes. They just label it with approximate inches for sale.
You'll be getting a visit from the FCC soon.
When playing your videos it buffers about 8 times then a couple of times the picture looses most pixels momentary making it impossible to watch. I watch other you tube videos and this doesn't happen. Its like some one is messing with your videos. Love your videos Matthias
Do you have any guy dude friends that you bring over and show this stuff to?
Does Canada have an FCC?
yes, its called the CRTC.
Googling is your friend.
Knock Knock. Who's there. CRTC. 🤐lol.
Boiled Peanuts
I believe the IMSAI 8080 actually had a sound card that used an AM transmission to send audio. And the sound was just bit banged out on a IRQ line as single bit data
Actually it seems it was the vanilla Altair 8800 that had EMI that could be controlled enough to use it as an AM transmitter.
The IMSAI card was the IRQ just low pass filtered and then sent straight out to a line out, so still bit banging audio, but no radio there.
Weird, I tried using "translate to English" and t made no difference. I still have no idea what Mathias was talking about. Regardless, it amazes me the stuff he comes up with.
try 14meters
6m yagi