Simple raspberry pi pico 433mhz receiver/transmitter controlled via http
a. More fun projects: https://pico.otilia.dev/
b. I did eventually solder the wires to the pico and the antenna to the transmitter for reliability.
c. I am controlling this via telegram
d. Transmit range is about 5m with antenna, receive is 3cm The antenna I used is very basic, you can find a better one in this fork: https://github.com/bnthn/pico433mhzMQTTGateway
e. RF Device code in rfdevice.py is adjusted code for raspberry pi pico, original is from: https://github.com/milaq/rpi-rf
a. Start receiver via a HTTP call. Press remote button you want to sniff a few times once you get 200 OK. After 15 seconds it will return all sniffed keys.
curl -v "http://192.168.100.196:80/receive"
* Trying 192.168.100.196:80...
* Connected to 192.168.100.196 (192.168.100.196) port 80 (#0)
> GET /receive HTTP/1.1
> Host: 192.168.100.196
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-type: text/html
<
* Closing connection 0
[{ "code": "14012112", "pulselength": "350", "protocol": "1" }]
API: http://[ip-address]/send/[code]/[protocol]/[pulselength]
example:
curl -v "http://192.168.100.196:80/send/14012112/1/350"
And light should turn on and off.
Set up micropython on pico (use the firmware for 'Raspberry Pi Pico W (with urequests and upip preinstalled)') URL https://www.raspberrypi.com/documentation/microcontrollers/micropython.html
Update 'src/config.py' with your SSID and password. Copy all files from src to pico. (you can use thonny for this)
Run webserver.py code with Thonny. (or rename to main.py and let pico run on each reboot) It will print the IP address it obtains once it starts up. You can also obtain the IP address from your router and ideally assign a DNS and static IP.
a. Raspberry pi pico
b. DollaTek 5pcs 433MHz receiver and wireless
c. Cables (1x40) - 4.29 (only need ~4 depending on skill)
d. Either
e. Antenna cable
f. Extra fun pieces:
It's a lot easier to do with breadboard.
We only have one 3.3V port, so we'll need to connect that to the TX/RX pair, I just cut a cable and connected the copper. There are multiple ground ports but I used the same trick as for 3.3V
Did not solder (I should), it still works fine with copper twisted to the pin. Pins for data are GPIO 27/22.
The antenna is a simple power copper wire, should be at least 17.2cm and straight. It goes into the antenna port on 433 TX. (can chip at cable with cutter until it fits if it's too large).
Without antenna, there's not enough power to transmit more then a few cm. (same for receiver) The 433mhz rx/tx pair work fine with 3.3V.
Tools needed:
This replaces old style remotes for led lights:
For antenna I used regular copper wire that is normally used for wiring lights inside house. Any copper wire will work if it's held straight (including the jumper cables above, I tried, they work fine) I used solid core since it will stay straight without anything else holding it.
Measure to 18cm or higher: (since we're gonna cut up a bit)
Chip at copper until it can fit the antenna port
Push the cabble through back of the card inside the port. (Then twist the other end so it doesn't come loose)
Use some tape or glue or both on the other side to have antenna stuck on card