Skip to content

A Demo using MQTT to control Servos using a Raspberry Pi Pico W

License

Notifications You must be signed in to change notification settings

philleach/PicoMQTTServoDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PicoMQTTServoDemo

A Proof of concept demo using MQTT to control Servos using a Raspberry Pi Pico W

Dependencies

The demo has been built using the following libraries. Copies of which are included in the /lib directory (unchanged).

  1. The mqtt_as client from micropython-mqtt.
  2. I created a prototype asyncronous servo library servo_as to drive the servos.

Requirements

This is a list of items used:

  1. Raspberry Pi Pico W
  2. Waveshare Pico-Servo-Driver
  3. 2 SG90 Servos connected to pins 0 & 1
  4. A local Mosquitto Broker (or use test.mosquitto.org)

Getting Started

  1. Download/ Clone this repo
  2. Add a file secrets.py to the top-level directory with the following content :
SERVER = 'test.mosquitto.org'  # Or the adress of your local MQTT Broker
SSID = '<Your WiFi SSID>'
PW = '<Your WiFi Password'
  1. Download the project to your pico and run demo.py
  2. Send commands using any MQTT Client (e.g.EasyMQTT) to topic /PicoMQTTServoDemo/command
Servo1 90
Servo2 -45
  1. Monitor servo status by subscribing to topic /PicoMQTTServoDemo/status

About

A Demo using MQTT to control Servos using a Raspberry Pi Pico W

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages