Raspberry Pico Circuit
This circuit will have a collection of sensors that will capture data. The Pico will read the data and display it on the LCD, send it to the ESP32 over UART, and write the data to the default Serial port so that it can be read by the Node-RED flow.
The ESP32 communication circuit will publish the sensor data to the MQTT broker from where it will be read by the mobile app.
This circuit will also have a collection of relays and motors that will receive control signals from the ESP32 communication circuit over UART and over the default Serial port from the Node-RED flow.
Components
Only connect components that have a operating (signal) voltage of 3.3V. Also make sure there is a microPython library for the component.
Component | Function | Voltage | Pins |
---|---|---|---|
Temperature and | |||
Humidity Sensor (DHT11/22) | Measures temperature and humidity. | 3.3V | Digital Out |
Infrared Sensor | Detects the presence of an object. | 3.3V | Digital Out |
Ambient Light Sensor | Detects ambient light intensity. | 3.3V | Digital Out |
Sound Sensor | Sound sensor. | 3.3V | Digital Out |
I2C LCD 16x2 | Used to display data. | 5V | I2C |
Relay | Controlled by binary signal from IoT app. | 3.3V | Digital In |
LED Module | Used as a visual indicator. | 3.3V | Digital Out |
I2C LCD 16x2 | Used to display data. | 5V | I2C |
Circuit Diagram
Connections
Board pin numbers are those printed on the board while code pin numbers need to be used in code (generally indicated in the pinout diagram as the GPIO pin number). They may be the same or different, depending on the board.
Board Pin | Code Pin | Mode | Component | Pin |
---|---|---|---|---|
4 | 2 | Digital GPIO Out | Relay | Signal |
5 | 3 | Digital GPIO | - | - |
6 | 4 | I2C SDA | I2C LCD | SDA |
7 | 5 | I2C SCL | I2C LCD | SCL |
9 | 6 | Digital GPIO | - | - |
10 | 7 | Digital GPIO | - | - |
11 | 8 | Software UART TX | ESP32 | 16 (RX2) |
12 | 9 | Software UART RX | ESP 32 | 17 (TX2) |
14 | 10 | Digital GPIO Out | Servo Motor | Signal |
15 | 11 | Digital GPIO Out | Red LED | Red Cathode |
16 | 12 | Digital GPIO Out | Blue LED | Blue Cathode |
17 | 13 | Digital GPIO Out | Green LED | Green Cathode |
19 | 14 | Digital GPIO | - | - |
20 | 15 | Digital GPIO | - | - |
21 | 16 | SPI CIPO | - | - |
22 | 17 | SPI CS | - | - |
24 | 18 | SPI SCK | - | - |
25 | 19 | SPI COPI | - | - |
26 | 20 | Digital GPIO In | DHT22 | Data Out |
27 | 21 | Digital GPIO In | IR Sensor | Data Out |
29 | 22 | Digital GPIO In | Sound Sensor | Digital Out |
31 | 26 (ADC0) | Analog In | LDR | Signal |
32 | 27 (ADC1) | Analog In | Raindrop Sensor | Analog Out |
34 | 28 (ADC2) | Analog In | Raindrop Sensor | Digital Out |
Code
The code for this circuit is distributed across multiple files, so will not be displayed here. It will be available for download for subscribers.