Yet Another Chair Occupancy Sensor Integration with Home Assistant and Raspberry Pico Wireless

Ferry Djaja
4 min readNov 27, 2022

I built yet another chair occupancy sensor and connected to the Home Assistant with an analog sensor. The initial version I built is using the window door sensor.

I put the analog sensor in the middle

The component comprises the Raspberry Pico Wireless and analog distance sensor Sharp OA51SK.

Analog to Digital Converter (ADC) in Raspberry Pico

An Analog to Digital Converter (ADC) is a circuit that converts a continuous voltage value (analog) to a binary value (digital) that can be understood by a digital device which could then be used for digital computation.

The Raspberry Pi Pico supports four 12-bit SAR based analog to digital converters. Out of the 4, you can only use 3 analog channels. The 4th analog channel is internally connected to the internal temperature sensor. You can measure the temperature using build-in temperature by reading the analog value of ADC4. The following table shows that the input signal for ADC0, ADC1, and ADC2 can be connected with GP26, GP27 & GP28 pins respectively.

Connect Pin 2 and Pin 3 of analog sensor to 3.3V Pin & GND Pin of the Raspberry Pi Pico. Connect the Pin 1 of the analog sensor to GP28 of Raspberry Pi Pico.

--

--