GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsThe Pico W can make HTTPS requests with MicroPython's urequests module, which is all a Telegram bot needs. You create a bot with BotFather, find your chat id, and the Pico W sends a message each time the PIR sensor trips. A two-minute cool-down stops one person walking about from sending dozens of messages. The PIR needs 5 V, so power it from the Pico's VBUS pin.
Use it as an alert only, not as the sole protection for valuables.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB power adapter so VBUS gives 5 V.
main.pyimport network, time, urequests
from machine import Pin
SSID = "YOUR_WIFI"
PASSWORD = "YOUR_PASSWORD"
TOKEN = "123456:YOUR_BOT_TOKEN"
CHAT_ID = "YOUR_CHAT_ID"
COOLDOWN = 120 # seconds between messages
pir = Pin(15, Pin.IN)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID, PASSWORD)
while not wlan.isconnected():
time.sleep(0.5)
def send(text):
url = "https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s" % (TOKEN, CHAT_ID, text.replace(" ", "%20"))
try:
r = urequests.get(url)
r.close()
except Exception as e:
print("send failed:", e)
last = -COOLDOWN
while True:
if pir.value() and time.time() - last >= COOLDOWN:
last = time.time()
send("Motion detected by the Pico W")
time.sleep(0.2)
Check the chat id with getUpdates and that you sent the bot a message first. The Pico W needs a working internet connection.
Keep it away from heaters, fans and sunlit windows, and turn its sensitivity down.
Some firmware builds need the package installed: run `import mip; mip.install('urequests')`.
Yes, bots and messages are free.
Not from the Pico W. Use an ESP32-CAM or a Raspberry Pi with a camera for pictures.
It is a learning project and a convenience alert, not a certified alarm.
4 parts: Raspberry Pi Pico W Microcontroller Board, HC-SR501 PIR Motion Detector Sensor Module, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 1.5 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (main.py).
About ₹808 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Sending HTTPS requests from the Pico W; Creating a Telegram bot; Debouncing a PIR with a cool-down.
Use it as an alert only, not as the sole protection for valuables.
Ideas that reuse this build: ESP32 flame alert via Telegram. They are listed under Take it further on this page.
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Records where you went every five seconds, ready to open on a map.
Two boards, two radios: press the button at the gate and it rings indoors.
Check temperature, humidity and pressure from any phone on your Wi-Fi.
Learning project. Check every circuit and the datasheet of each part before you power it up.