This is only a preview of the September 2025 issue of Silicon Chip. You can view 42 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Power Breakout for PICkit Basic":
Articles in this series:
Items relevant to "HomeAssistant, Part 1":
Items relevant to "HomeAssistant Satellite":
Articles in this series:
Items relevant to "Ducted Heat Transfer Controller Part 2":
Items relevant to "USB-C Power Monitor, Part 2":
Purchase a printed copy of this issue for $14.00. |
Project by Richard Palmer
HomeAssistant Satellite
using a Raspberry Pi Pico W
» Analog and digital inputs and outputs
» Can transmit infrared remote control codes
» Includes a relay/LED driver
» ESPHome supports hundreds of sensors and controls
» Includes an I2C bus connector compatible with
2QWIIC, STEMMA QT, GROVE & PiicoDev
» Remote configuration and management
This simple board lets you
connect lots of different
kinds of sensors, displays
and other things wirelessly
to a HomeAssistant based Home
Automation system.
n a Home Automation system, sensors and actuators CON9, a 4-pin JST-SH connector that is compatible with
Itions
attach to ‘satellites’, which can be placed at different loca- QWIIC, Stemma QT, Grove and PiicoDev devices. CON8
around the home. Each can support multiple attached also provides access to the I2C0 bus, allowing the connec-
devices communicating with the hub over the household tion of a small OLED screen.
If two devices with the same I2C address need to be
WiFi network.
Our Satellite uses a Pico W microcontroller module pro- connected, a second I2C bus is available at several locagrammed with the ESPHome firmware. While the newer tions on the expansion connector, CON4. However, note
Pico 2 W may be used, it costs a little more and the extra that pull-up resistors will need to be added if the second
power is not required for this application.
I2C1 bus is used.
A small PCB hosts the Satellite’s
The adjacent table lists the functions
CON4 expansion header pinout
basic components and makes it easy to
available on the expansion connector.
connect to a wide range of supported Pin Signals
Separate pads for the 5V and 3.3V supdevices. You can see a list of the sup- 1
plies and ground are provided at CON1GP15, I2C1, SPI1
ported sensors at https://esphome.io/
CON3.
2
GP14, I2C1, SPI1
components
For remote control, IR LED1 is driven
3
GP13, SPI1, UART0
by Q1, a BC817 or similar NPN transistor,
Circuit description
from the 5V supply. Its 40mA operating
4
GP12, SPI1, UART0
Fig.1 shows the Satellite circuit.
current is higher than can comfortably
GP11, I2C1, SPI1
As you can see, there isn’t a lot to it 5
be supplied directly by a digital output
besides the Raspberry Pi Pico W mod- 6
pin on the Pico module.
GP10, I2C1, SPI1
ule shown in the middle.
Transistor Q2 can drive an off-board
7
GP9, SPI1, UART1
Most sensors and many control
5V relay or solid-state relay (SSR). LED2
GP8, SPI1, UART1
devices will connect to the Satellite 8
lights when the relay is operating, while
via a two-wire I2C serial bus. I2C0’s 9
diode D1 protects the transistor against
GP7, I2C1, SPI0
SDA (I2C data) and SCL (I2C clock)
back-EMF when a traditional relay
GP6, I2C1, SPI0
functions are connected to GPIO pins 10
switches off.
GP28, ADC0
20 and 21, with pull-up resistors to 11
The 64kHz PWM signal at GP16 is
the 3.3V rail as required for I2C com- 12
smoothed
by an RC low-pass filter formed
GP27, ADC1
munications.
by a 10μF capacitor and 470W resistor,
GP26, ADC2
Access to the I2C bus is provided by 13
giving a -3dB frequency of approximately
54
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
Fig.1: the Raspberry Pi Pico W module drives the IR LED (LED1) and relay through transistors Q1 and Q2. Digital and
analog I/O is via CON4, with power available from CON1-3. CON9 is a QWIIC, Grove and PiicoDev compatible I2C
connector. The I2C OLED display connects via CON8.
34Hz, reducing the ripple of a 50% duty cycle output to
around 10mV peak-to-peak.
While the Pico is capable of much higher PWM frequencies, which would result in even lower ripple, there is a
trade-off between frequency and bit depth (resolution),
which is 10 bits at this frequency. The smoothed output
is presented at CON6, forming a basic kind of digital-to-
analog converter (DAC).
The board’s 5V supply is powered either via a microUSB cable plugged into the Pico W, or from CON5. In most
cases, a 5V 500mA supply should be adequate, as the Pico
W draws less than 100mA and the IR transmitter requires
20mA on average.
However, the supply must also be able to support the
needs of any connected devices. For instance, 5V relays
commonly draw 75mA or more when energised.
The Pico W module has an onboard 3.3V regulator
capable of supplying 250mA to auxiliary devices. If
more than this is required, an additional 3.3V supply
will be needed.
Construction
The Satellite is built on a double-
sided PCB coded
15104251 that measures 51 × 54mm. Start by soldering
the SMD components in the locations shown in Fig.2. The
band on the diode must point toward the power header.
Next, add the two 20-pin female headers for the Pico, the
JST-ST connector (CON9) and the two LEDs. Leave CON1CON8 off at this stage.
Solder headers to the Pico W, if they weren’t already
fitted, and plug it in with the USB socket at the top of the
board. You can use the sockets on the board as a jig to hold
the headers while soldering them to the Pico W.
Now plug the USB cable into a port on your PC. 5V
should appear on CON1 and 3.3V at CON3. Disconnect it
after checking those supply rails.
siliconchip.com.au
Configuration
If you have difficulty with any of the configuration
steps below, there is documentation at ESPHome’s website (https://esphome.io) and a helpful user community at
https://community.home-assistant.io
Load the ESPHome firmware next. Go to the ESPHome
Builder tab in HA, click on the + NEW DEVICE button and
CONTINUE. You can name your device “myHome” (or
something else if you prefer). Select Raspberry Pi Pico W
as the platform, then click INSTALL. A copy of the encryption key will be saved in the configuration file.
Select the “Manual download” option when the pop-up
window appears – see Screen 1. It will take a minute or
more for HA to compile customised code for the new device.
When the wheel stops spinning, select Download project
and UF2 factory format, then close the pop-up window.
You may need to approve the download in your browser
(“Keep” in Chrome) as it’s coming from an unsecured host.
Hold down the BOOTSEL button on the Pico while plugging its USB cable into your computer. Copy the downloaded UF2 file across to the “RP1-RP2” drive that has
appeared in the PC’s
file manager and close
the pop-up window.
Fig.2: all components
are on the top of the
PCB; mount the SMD
components before the
through-hole items.
Australia's electronics magazine
September 2025 55
The block with your Pico’s name should become ONLINE
in the ESPHome Builder tab, after a 30 second delay (Screen
2). This is a basic ESPHome device, with no sensors or outputs configured. Click on the EDIT link on the myHome
card and the configuration file will be displayed. Additional configuration lines for sensors and controls will be
added below this code – see Screen 3.
Screen 1: the “New device” screen while the code is being
compiled.
Each YAML block starts with an identifier, usually the
item’s type. Values are indented and the number of leading spaces is significant (usually two per level). Each level’s information is terminated when a less indented item
is encountered. Comments begin with a “#” and continue
to the end of line.
Close the editing window by clicking the X at the top left
corner and click on the LOGS link in the myHome card.
A window will open with the history of the device since
it was last booted. In this case, most of the information is
in purple, describing the WiFi connection process. Close
the window.
The Satellite is now ready and the final step is to tell the
HA Core that it exists.
Go to Settings then Devices & services and +ADD INTEGRATION. Search for “ESPHome” and click SUBMIT. The
Satellite should pop up as a discovered device. If not, type
“myHome.local” (or prefixed with whatever name you gave
it) into the “Host” field and click SUBMIT.
If you had to enter the host name, the installer will ask
for the encryption key from the myHome.yaml configuration file. Click SUBMIT after that.
The Area field may be left blank on the next screen.
Approve the request for the device to perform HomeAssistant actions, then click FINISH to make the Satellite active.
The Satellite may not appear on the Overview dashboard
at this stage, as it has no sensors or controls defined.
Adding a sensor
Unplug the USB cable, connect an SHT40 temperature
sensor to the I2C port and plug the USB cable back in.
Re-open the editor and add the following code at the bottom of the myHome.yaml file.
Screen 2: the initialised Pico W Satellite’s card in the
ESPHome builder tab.
## Temperature.yaml
## Temperature & Humidity sensor
## Pico W I2C0 bus
i2c:
sda: 20
scl: 21
scan: true
frequency: 400kHz
## SHT40 sensor
sensor:
- platform: sht4x
update_interval: 10s
humidity:
name: “Humidity”
id: humidity
temperature:
name: “Temperature”
id: temperature
Screen 3: the myHome device’s initial configuration file.
56
Silicon Chip
Rather than typing this in, you can copy and paste this
from the file named “Part2.yaml” in the download package for this series (siliconchip.au/Shop/6/2482). That will
not only save time but ensure you get the correct formatting for it to work.
The first section defines the I2C bus that will be shared
by other connected devices. The sht4x ‘platform’ uses the
defined I2C bus by default. The “name:” field is used when
displaying the entity, while the “id:” field is required if the
entity is to be referenced by code.
Australia's electronics magazine
siliconchip.com.au
In the SHT40 section, humidity and temperature sensors
are defined, and the interval between readings is shortened
from the default value of 60 seconds to 10.
After adding the code, click SAVE and INSTALL (in the
top right-hand corner) and select the Wirelessly option in
the pop up. Depending on your HA setup, compiling the
code may take a minute or more. You will know it has finished when the green SUCCESS message appears in the log.
The code will then attempt to upload to the Pico and,
after a delay of thirty or more seconds; the screen will show
the Pico’s boot log. At the bottom should be light blue text
indicating that temperature and humidity readings are
being sent to the HA hub.
If your configuration won’t compile, it may be due to
incorrect indentation or code in the wrong location.
The window may be closed by clicking STOP at any
time after the download has completed. While STOP may
appear a strange command to close the window, HA has
launched a virtual Docker machine to do this work, and
stopping the virtual machine when it is no longer needed
closes the window.
Close the myHome.yaml edit window, then go to HA’s
Overview dashboard. After a minute or so, the myHome
card should appear, showing the temperature and humidity. If it doesn’t, try reloading the web page.
Screen 4: the myHome dashboard card with the Relay LED.
The SSD1306 display
showing temperature,
humidity and the state
of the Relay LED.
Controlling the relay and LED
Only a few extra configuration lines are needed to map
the relay driver’s GPIO pin as a switch output. They are
added to the Satellite system’s myHome.yaml configuration file below the SHT40 sensor definitions. The “switch:”
component indicates that this is a binary output. The GPIO
platform then maps the function to a microcontroller pin:
## Relay_LED.yaml
## Pico Relay and LED
switch:
- platform: gpio
pin: 22
name: “Relay LED”
id: led
Save and install the updated configuration. After a minute
or so, the myHome tab on the Overview dashboard should
include a switch for the Relay LED – see Screen 4. Toggling
the switch should cause the LED to come on.
The completed
Satellite board with
and without the Pico
W. All components
are mounted on the
top of the doublesided PCB. The
optional header pins
at CON8 allow easy
disconnection of the
OLED display.
Adding a display
ESPHome supports a wide range of displays. The
SSD1306 OLED used in this project has an I2C interface
and we can use it to show the current temperature and
humidity, along with the LED/relay state and a graph of
temperature over time.
The display can be daisy-chained with the temperature
sensor or connected via CON8. When wiring it up, take
care with the pinouts as they tend to vary between display manufacturers.
The I2C bus is already defined, so all that is needed is to
declare the OLED display and add some lines of code to
run regularly that write to the display. The OLED screen
is set to the standard I2C address for 128×64 pixel mode.
As the built-in font is blocky, we can use some Google
fonts instead.
In the display section of the code below, there is a portion
siliconchip.com.au
Australia's electronics magazine
September 2025 57
Parts List – Home Assistant Satellite
1 double-sided PCB coded 15104251, 51 × 54mm
1 Raspberry Pi Pico W module with two 20-pin headers (MOD1)
1 micro-B USB cable
2 20-pin single-row female header sockets
4 3-pin headers (CON1-CON3, CON7) (optional)
1 13-pin header (CON4) (optional)
2 2-pin headers (CON5, CON6) (optional)
1 4-pin header (CON8) (optional)
1 4-pin JST-SH 1mm-pitch socket (CON9)
[Core Electronics PRT-14417]
Semiconductors
2 BC817 NPN transistors, SOT-23 package (Q1, Q2)
1 5mm 50mA IR LED (LED1)
[Altronics Z0880A, Jaycar ZD1945, Core Electronics ADA387]
1 3mm red, yellow, amber or green LED (LED2)
1 SS14 or similar 1A schottky diode, DO-214AC/SMA
[Altronics Y0084]
Capacitors
4 10μF M2012/0805 16V X7R
Resistors (all SMD M2012/0805 size 1%)
3 2.2kW
2 1kW
1 470W
1 100W
Add-on sensors & display used in this article
1 SHT4x QWIIC temperature and humidity sensor
[Core Electronics ADA4885 or ADA5776]
1 QWIIC cable
[Core Electronics CE07773, Altronics Z6596 or Z6597]
1 AM312/AS312 PIR sensor module [Altronics Z6382A,
Jaycar XC4444, Core Electronics CE05786]
1 SSD1306 I2C OLED display
[Altronics Z6525, Jaycar XC3728, Core Electronics CE09493]
marked “lambda”. Any code following the lambda marker
is passed to a command interpreter for execution at runtime. Lambda code is written in the C language.
Add the code to myHome.yaml below the relay’s
“switch:” definition block:
## OLED_display.yaml
## define the fonts
font:
- file: “gfonts://Roboto”
id: roboto_12
size: 12
- file: “gfonts://Roboto”
id: roboto_16
size: 16
## graph configuration
graph:
- id: temp_graph
sensor: temperature
## sliding time window
duration: 60min
width: 106
## half display height
height: 32
border: True
max_value: 40
min_value: 10
y_grid: 10
## SSD1306 display
display:
- platform: ssd1306_i2c
model: “SSD1306 128x64”
address: 0x3C
## Print the text and graph
lambda: |it.printf(0, 0, id(roboto_16),
“%.1f°C
%.0f%%”,
id(temperature).state,
id(humidity).state);
if (id(led).state) {
it.print(0, 14,
id(roboto_16), “ON”);
it.filled_circle(44, 22, 6);
} else {
it.print(0,14,
id(roboto_16), “OFF”);
it.circle(44, 22, 6);
}
it.print(110, 30,
id(roboto_12), “40”);
it.print(110, 52,
id(roboto_12), “10”);
it.graph(0, 32,
id(temp_graph));
As with other YAML code, the lambda block ends when
less indented text is found. The version in the download
pack is easier to read, as the lines haven’t been wrapped
to fit into a magazine column.
The lambda code prints temperature and humidity on
the first line, with the state of the LED and a circular on/
58
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
Screen 5: the Traces screen for the “AC
off” automation.
off indicator on the second line. The bottom half of the
screen displays a graph of the temperature over the past
60 minutes, between 10°C and 40°C, with horizontal grid
lines every 10°C.
The state of the relay LED slider on the dashboard (Screen
4) should be reflected in the OFF/ON text and indicator
on the display.
A simple thermostat
Automations use the output of a sensor or other input
condition, such as the time of day, to trigger an action. We
will create a simple air conditioner thermostat that switches
on the relay/LED when the temperature rises above 28°C
and off again when the temperature falls below 27°C. These
settings are convenient for testing with a finger on the temperature sensor.
To implement the thermostat, the temperature reading is
connected to the Relay/LED using two automations. On the
HomeAssistant screen, go to Settings then Automations &
scenes. Click on + CREATE AUTOMATION at the bottom
right corner of the screen and Select “Create new automation” from the pop-up menu.
Under “When”, click on + ADD TRIGGER. Select Device
and choose “myHome” from the drop-down list. Select
“myHome temperature changes” from the Trigger dropdown. Enter 28 into the Above field. The Below and Duration fields should be left blank.
Under “Then do”, click ADD ACTION. Select Device
and “myHome” as before. The Action is “Turn on myHome
Relay LED”. Save the automation as “AC On”.
Click the back arrow at the top of the screen to return to
the “Automations” menu and create a second automation
to turn the AC off.
Under “When”, click on + ADD TRIGGER. Select
Device and then myHome from the drop-down list. Select
“myHome temperature changes” from the Trigger dropdown. Enter “27” into the Below field. Under “Then do”,
click ADD ACTION. Select the Device myHome as before.
The Action is “Turn off myHome Relay LED”. Save the
automation as “AC Off”.
The two automations will automatically activate within
a minute. Go back to the Overview dashboard and hold
a finger to the temperature sensor. The LED should light
once the temperature rises above 28°C. The indicator
on the dashboard should change, the relay LED should
light, and the OLED display should indicate that the virtual AC is on.
siliconchip.com.au
When the temperature is allowed to fall, the relay LED
should switch off below 27°C.
Go back to the Automations & scenes menu and select
“AC off”. Click on TRACES at the top right corner. The
Trace Timeline tab should produce a screen very much
like Screen 5; this view is useful when debugging more
complex automations.
We’ll have a follow-up article next month that describes
how to use IR remote control to switch a split-system air
conditioner on and off, a more realistic control method.
Analog outputs
We can set up GP16 to generate a 64kHz PWM signal
that is smoothed by a simple RC filter and presented at
CON6. The result is a voltage that’s proportional to the
temperature, with the output scaled to a maximum of
3.3V at 33°C.
The “monochromatic light” platform component is used
as it provides a straightforward conversion from an input
value to a brightness output. However, the conversion
isn’t linear by default; the gamma value must be explicitly set to 1.
Edit the configuration file’s “sensor:” block to add the
on_value clause immediately after the “id: temperature”
statement, then add a new “output:” block for the PWM at
the end of sensor clause:
## PWM_temp.yaml
## PWM set by temperature
## Replaces existing temperature
## and humidity sensor code
## sensor:
- platform: sht4x
update_interval: 10s
humidity:
name: “Humidity”
id: humidity
temperature:
name: “Temperature”
id: temperature
on_value:
then:
- light.turn_on:
id: pwm_lamp
## 10 degrees/volt
brightness:
!lambda “return x/33;”
Australia's electronics magazine
September 2025 59
Screen 6: the myHome dashboard card with the PIR sensor.
Also add the following after the sensor block:
## PWM_output.yaml
output:
- platform: rp2040_pwm
pin: 16
id: PWM_16
frequency: 64000Hz
light:
- platform: monochromatic
output: PWM_16
## straight line temp:pwm
gamma_correct: 1.0
name: “PWM lamp”
id: pwm_lamp
When the code is installed, the PWM output voltage at
CON6 will track the measured temperature.
PIR motion detection
Connect a PIR sensor to the GP15 input at pin 1 on CON4,
with 5V power and ground to CON1 and CON2, respectively. The required connections are shown in Fig.3.
The sensor produces a binary value, so the code sits
in a separate block to sensors that produce numeric values. Add the following code to your device in ESPHome
Builder after the “sensor:” block, then save and install the
changed configuration:
## PIR.yaml
binary_sensor:
- platform: gpio
pin: 15
name: “PIR”
device_class: motion
id: PIR
The MyHome card on the Overview dashboard should
SC
now look something like Screen 6.
Fig.3: wiring for the PIR
sensor is simple. In this
example, Vout goes
to GPIO GP15 (pin 1
on CON4), while 5V
power comes from
any combination
of pins on CON1 &
CON2.
60
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
|