Abusing Raspberry Pi GPIO pins as a radio transmitter to control my ceiling fan

Sdílet
Vložit
  • čas přidán 1. 06. 2024
  • In Part 1, we covered capturing and decoding the remote control's signal using
    a USB TV tuner: • Hacking My Ceiling Fan...
    In Part 2, we take use a Raspberry Pi's GPIO pin as an antenna to transmit our
    own signals to the ceiling fan.
    rpitx: github.com/F5OEO/rpitx
    The ceiling fan / light combo I have is Minka Aire brand. I think most of the
    different ones on the market work pretty similarly.
    ----
    Parts:
    rpitx lists the Raspberry Pi 4 as having "beta" support. (I used a Raspberry Pi 3B.)
    Sparkfun: www.sparkfun.com/products/14643
    Adafruit: www.adafruit.com/product/3055
    Amazon: amzn.to/3crvFFI
    I found my low-pass filter on eBay (overseas shipping). Digikey has low-pass
    filters that would also work, but not as cheap.
    eBay low-pass filter: ebay.us/4cSPe5
    eBay SMA antenna: ebay.us/GcL9qa
    eBay SMA connector: ebay.us/PGPmGM
    Note that these all have SMA connectors, not RP-SMA (which look very similar).
    Also note that eBay listings come and go, so double-check that you get
    compatible parts. The antenna does not need to be exact - the one I got is
    listed for 315 MHz and works just fine.
    -----
    Background music:
    Aerosol Of My Love by Kevin MacLeod
    Link: incompetech.filmmusic.io/song...
    License: filmmusic.io/standard-license
    -----
    Some links may be affiliate links.
  • Věda a technologie

Komentáře • 75

  • @thekaratekid02
    @thekaratekid02 Před 3 lety +25

    This was incredibly interesting. Definitely subscribed.

    • @riveducha
      @riveducha  Před 3 lety +2

      Appreciate the compliment - it’s real motivation for me to make more videos!

  • @evocatiproductions
    @evocatiproductions Před 3 lety +10

    This was amazing! This may be what I need to finally have a way to remotely control my ceiling fan.
    I bought an old house from the 70s back in 2007, and its where I still currently live. In my master bedroom is the only ceiling fan in my house that did not come with its remote control. This ceiling fan is a knock off brand ceiling fan, but I have ordered dozens of different ceiling fan remotes for ceiling fans that looked like mine through google searches, and every single one of these remotes did not work with my ceiling fan. The ceiling in my room is also really high, so even though I am 6 Feet tall, I still have to get up on the top of my step ladder in order to pull the chains to change the fan speed, and the chain for light is broken, so I just installed a different light in my room.
    I kind of gave up after the 12th time I ordered a remote and it failed to work. I already have a bunch of Broadlink devices in my house that I use to capture remote signals, so I can control RF and IR Devices over WiFi using this device, but I have never been able to figure out how to capture the signals my Ceiling fan needs to transmit the correct RF commands to it to change the fan speed or turn on or off the light or fan in it.
    Do you know of a way to capture the codes needed without having the remote to the ceiling fan by chance?
    Either way, Awesome Video man! I hope this brings in the subscriber base you deserve, I am subscribed now, and I actually found this through a Toms Hardware article that referenced your video, so hopefully that will direct more traffic your way!

    • @riveducha
      @riveducha  Před 3 lety +4

      I don’t know a great way to figure out the wireless commands without the remote. There’s a chance you can find the “FCC ID” inside the fan that you can then look up on the FCC’s database. You may be able to figure out manufacturer and frequency this way.

  • @tracelandreth8704
    @tracelandreth8704 Před 3 lety +12

    "Holy sh**, it worked!" I died XD

  • @jawidwardak691
    @jawidwardak691 Před 3 lety +13

    Dude, thanks for this awesome video. I wish there would be more content like this.

    • @riveducha
      @riveducha  Před 3 lety +2

      Working on more vids! They take a long time to make though.

  • @hindenberg25557
    @hindenberg25557 Před 2 lety +6

    So much useful and interesting info packed into 5 minutes. Thank you!

  • @rossrobots5160
    @rossrobots5160 Před 3 lety +5

    Awesome. I had tried to broadcast fm radio with a pi 0, but this is an even better usecase and the software seems to have improved since then as well!

  • @KenanArik
    @KenanArik Před 3 lety +1

    Awesome - thanks for the great explanation and detail! Subscribed! Looking forward to your next projects :)

  • @yeetyeet7070
    @yeetyeet7070 Před 3 lety +1

    Amazing explanations, love these kinds of videos

  • @structure7
    @structure7 Před 3 lety +3

    Fantastic series of videos. I somehow managed to make this work for my Home Depot "Britton" fan controllers... made my Sunday! Thank you!!!

    • @riveducha
      @riveducha  Před 3 lety

      Great to hear it worked for you! I’m also glad that my explanation was understandable enough!

  • @kdausu90
    @kdausu90 Před 3 lety +2

    Amazing! Exactly what I was looking for.

  • @repzo5551
    @repzo5551 Před 3 lety +6

    Very cool video, straight to the point with a lot of information in a short time ! Liked & subbed

    • @riveducha
      @riveducha  Před 3 lety +2

      Thanks! Always tough to decide what info to include or leave out.

  • @MrRoma70
    @MrRoma70 Před 2 lety +2

    I just stopped to watch your video as getting into the Raspy world, and I was amazed. Can I ask if possible to provide the Flask code? Anyway, either way keep up with the work I am hooked now, lol

  • @-someone-.
    @-someone-. Před 2 lety +1

    Awesome! More raspberry pi please!

  • @honzaled
    @honzaled Před rokem

    Awesome video, just discovered your channel through the Valorant video, you definitely deserve more views and subscribers!
    By the way, could you consider making the HA integration open-source? I have a Bluetooth controller light that also has a RF remote and I think that RF control would be more consistent that Bluetooth

  • @alexiswiniger173
    @alexiswiniger173 Před 3 lety +1

    Really inspiring, thank you for this one. :)
    I would love to learn more about the "web app" you quickly made to test the setup.
    All the best

    • @riveducha
      @riveducha  Před 3 lety +1

      There’s not a whole lot to it - the web app simply runs sendook when you push a button. It uses Flask as the framework so I didn’t have to write much code.

  • @cjhoyle
    @cjhoyle Před 2 lety +1

    Fantastic tutorial! This was exactly what I was looking for. I was able to follow your instructions to control an old Radio Shack wireless remote switch using my Raspberry Pi. Believe it or not, without any kind of antenna plugged into the pin, it actually works within a range of up to 2 meters! I'm planning on using this technique to control the fan speed on my humidifier, but first I had to order the optional remote for it so I can eavesdrop on the signals it sends. Thanks for the video!

    • @riveducha
      @riveducha  Před 2 lety +1

      I’m so happy you got it to work on your own appliances! It’s amazing how wireless stuff used to be such a mystery to me but with some cheap electronics it’s so easy to figure out and control!

    • @cjhoyle
      @cjhoyle Před 2 lety

      @@riveducha Absolutely! Thanks to your video I feel like I truly understand how those wireless remotes work, and they are surprisingly simple. Still, it was very exciting when my switch turned on for the first time from a command that I sent using the Pi. I have an air conditioner which operates using an IR remote control, so learning to controlling things with an infrared LED is on my list of things to learn next summer.

  • @jakeb4597
    @jakeb4597 Před 3 lety +1

    Just watched previous video and this one. Very neat and impressive!

  • @Thealiw1
    @Thealiw1 Před 2 lety +2

    Wow! Fantastic! Have you been able to integrate it into Home Assistant as you mentioned on 4:25 ?

  • @nostrislife
    @nostrislife Před 6 měsíci

    3:50 no truer words have been spoken 😂😂

  • @therealguts268
    @therealguts268 Před 3 lety +3

    Now, this is epic

  • @bitterrotten
    @bitterrotten Před 3 lety +2

    If anyone is having trouble getting this to work with their fan, pay attention to the pause interval and move the repeat number up to at least 3. These issues tripped me up.

    • @riveducha
      @riveducha  Před 3 lety

      I also noticed that repeating the message only once or twice didn't always work. The manufacturer remote just repeats the message for as long as you hold down the button.

  • @AbuSous2000PR
    @AbuSous2000PR Před rokem

    Many thx...very helpful. I wonder if you made the follow up video you referred to with the home assistant?
    I searched your channel but could not find it
    HONESTLY... that is a simple Idea and I am shocked I have not thought about it
    Do you kow if it is capable of transmitting text? I mean like as packet radio
    good job man
    too bad I just noticed your channel
    cheers from palestine

  • @chinchinchin695
    @chinchinchin695 Před 3 lety

    incredible project, i came from reddit 😎

  • @MrPacMan36
    @MrPacMan36 Před 4 měsíci

    This is exactly what I need to control my motorized projector... I'm in IT but can't totally write program language, but I can kind of understand and can definitely copy and paste 😅... I hope to also have it tied into Google Assistant

  • @baremetaltechtv
    @baremetaltechtv Před 2 lety +1

    I really want to use the GPIO pins as a wireless transmitter and reciever to network 2 pi's and create an ssh link over the connection. I know its possible but haven't seen it done anywhere.

  • @PixelatedDoesStuff
    @PixelatedDoesStuff Před 2 měsíci

    where can i find a video on how to connect the matierials (for example that small antenna with the wires, etc...) . i really need help with learning such skills

  • @davidpeterson894
    @davidpeterson894 Před 3 lety +1

    Great work!
    I want to adapt this to control X10 devices. I guess receiving signals would be asking too much.
    Thanks

    • @riveducha
      @riveducha  Před 3 lety

      The RPi cannot receive arbitrary signals like this, but you can look into the CC1101 transceiver which a lot of hobbyists use.

  • @wolframzirngibl1147
    @wolframzirngibl1147 Před 3 lety +2

    Sorry for stating, that any effort to filter out "harmonics" must fail when made this way. The wires for connecting Pi and Filter will radiate probably as much still unfiltered signal than attached antenna will radiate filtered signal - if not more than the antenna.

    • @riveducha
      @riveducha  Před 3 lety

      Yes, that was an oversight that I also mentioned in the errata webpage. Luckily the harmonics are pretty weak!

  • @alfatech8604
    @alfatech8604 Před 3 měsíci

    earned a new subscriber please make a video on using universal radio hacker

  • @DDBAA24
    @DDBAA24 Před měsícem

    What kind of range do you get with the filter + antenna ? Also whats the dbi on the one your using ?

  • @dennisasamoah2213
    @dennisasamoah2213 Před 3 lety

    Genius stuff

  • @kushavlogs8433
    @kushavlogs8433 Před rokem

    Do you know how to connect or attach the raspberry pi GPIO pins to the DWM1000 uwb IC?

  • @PijnackerRonald
    @PijnackerRonald Před rokem

    Nice! I'm trying this with my Pi 3b, but I have some trouble getting the "antenna" to stick to the GPIO pin.
    How did you manage to get that attached without it falling off?

    • @riveducha
      @riveducha  Před rokem +1

      Easiest is probably to get a female-to-female pin connector wire. You don’t need the other end to be connected to anything, of course.

    • @PijnackerRonald
      @PijnackerRonald Před rokem

      @@riveducha Thanks. A piece of plastic stripped from an electric cable did the job too :)

  • @xspacephotography31
    @xspacephotography31 Před rokem

    How do you power up your antenna? I need a range more than 30 ft…

  • @mohammedmohsen723
    @mohammedmohsen723 Před rokem

    would it be possible to be done for esp32?

  • @thej8944
    @thej8944 Před 3 lety +1

    Hello, love the videos and I subscribed do you know the code for your web server

    • @riveducha
      @riveducha  Před 3 lety

      Hey, I haven’t posted the code and honestly it’s not great code or interesting code. Sorry! If you can hack together a web page with buttons in PHP, Python, whatever, then it should be pretty straightforward to recreate.

  • @Electromakerio
    @Electromakerio Před 3 lety +3

    We loved this project so much that we featured it in this weeks episode of The Electromaker Show! czcams.com/video/TDF12MVMOfM/video.html

  • @user-fo3to8rn2x
    @user-fo3to8rn2x Před 2 lety

    Does the added antenna improve the range of the signal or not?

    • @riveducha
      @riveducha  Před 2 lety

      Adding an antenna increased the range by a huge amount compared to having no antenna. I don't think there's much difference between having a simple wire and a nice-looking antenna but didn't measure.

  • @forxan
    @forxan Před rokem

    Hi everyone,
    I would like to be able to receive the signal from a controller with an HCS301 (MICROCHIP KeeLoq) in the transmitter and with a PICxxx or an ATMELxxx in the receiver.
    There is a library for ARDUINO about receiving the signal from an HCS301 and another to emit the signal from an HCS301, but I can't find it... I'm still looking.
    Greetings to all.

  • @PijnackerRonald
    @PijnackerRonald Před rokem

    The signal I recorded isn't a nice OOK signal. Any way I can send a frequence modulated signal on a carrier signal with rpitx too?
    (Is there a better support channel for these questions?)

    • @riveducha
      @riveducha  Před rokem +1

      Rpitx can do basically anything, but you may need to roll up your sleeves and write some code. There is a group here: groups.io/g/rpitx

  • @skeeviesteve1071
    @skeeviesteve1071 Před 3 lety +1

    Genius

  • @aim__freakz8499
    @aim__freakz8499 Před 2 lety +1

    what are you doing as a profession? and how did you learn all this?

    • @riveducha
      @riveducha  Před 2 lety

      I'm unemployed, but that might change if I'm lucky! Most of the stuff I learned is just from Googling.

  • @arjunlagoon2015
    @arjunlagoon2015 Před rokem

    My raspberry pi 4 crashes when I run the script, it's able to send out a signal and I'm able to turn on some radio controlled lights in backyard, but I have to restart my pi everytime I want to run it. Do you know a fix for this? Love your vids I wish you posted more.

  • @VadymZakrevskyy
    @VadymZakrevskyy Před měsícem

    It looks like sendook requires sudo to be run.. were you able to get it to work normally, or did you give www-data sudo rights?

  • @n.w.aicecube5713
    @n.w.aicecube5713 Před 3 lety

    What range of freq could transmit ?

    • @riveducha
      @riveducha  Před 3 lety

      According to the rpitx readme: "It can handle frequencies from 5 KHz up to 1500 MHz."

    • @n.w.aicecube5713
      @n.w.aicecube5713 Před 3 lety

      @@riveducha very interesting

  • @i-am-kluge
    @i-am-kluge Před 3 lety

    I cloned rpitx off github, but it doesn't have the sendook util... Did I grab the wrong one?

    • @riveducha
      @riveducha  Před 3 lety +1

      It needs to be compiled first (source code is in src/ook). I think the install.sh script that comes with rpitx should install all the dependencies and compile everything for you.

    • @i-am-kluge
      @i-am-kluge Před 3 lety

      @@riveducha Yeah.. forgot to take my anti-stoopid pills earlier. Noticed the install script a few mins after I asked, and forgot to run back here and delete my post before anyone read it and thought I was a moron, hahahaha...

  • @Bharathk-bi9tg
    @Bharathk-bi9tg Před 2 lety

    Does this rpitx works in pi4

    • @riveducha
      @riveducha  Před 2 lety

      There's a compatibility list on the project page: github.com/F5OEO/rpitx
      Support for Pi4 is listed as "beta".

  • @wladyslawkorczynski7386

    Please sens address.

  • @apfelstrudlOfOA
    @apfelstrudlOfOA Před 3 lety

    So hold on a second, did you just shut off a ceiling fan and regular light, none of which are "Smart" using a Raspberry Pi sending radio frequencies?

    • @riveducha
      @riveducha  Před 3 lety +1

      The ceiling fan has a built-in light (it’s a combo unit) and it comes with a remote control. It’s not “smart” meaning it doesn’t speak any standard protocols like Zigbee, Bluetooth, etc.