M5Stack Unit Light Pinout

Unit Light provides a raw analog reading and an adjustable digital threshold output on PORT.B.

Main pinout

100%Drag to pan · Ctrl/⌘ + wheel to zoomSwipe up/down to scroll the page · Swipe sideways to pan · Use two fingers to pan and zoom
Show signal routes

Pin index

Pin index

Quickly scan every header pin, port name, supported function and usage note.

4 visible
PinMCU pinTypesNotes
GNDCommon ground and host signal reference.
PowerNominal 5 V supply input.
DigitalThreshold output to a host digital input.
AnalogPhotoresistor divider voltage for a host ADC.

Specifications

Model
Unit Light · U021
Sensor
R4 photoresistor with a 10 kΩ divider resistor
Connector
PORT.B · J1 · HY2.0-4P · 2 mm pitch
Supply
5 V nominal at J1.3 · HT7533 generates an internal 3.3 V rail
Analog output
Ain · Light-dependent divider voltage for a host ADC
Digital output
Din · LM393 open collector with a 10 kΩ pull-up to 3.3 V
Threshold
The 10 kΩ R3 trimmer sets the digital switching point
Size
32.0 × 24.0 × 8.0 mm

References

Datasheets

Manufacturer references and technical documentation.

ChipRoleManufacturerNotesLink
U021Product documentationM5StackPhotos, PORT.B cable colors and dimensioned drawing.Datasheet
UNIT_LIGHTNESS V1.0SchematicM5StackJ1 numbering, the sensor divider, comparator and 3.3 V rail.Datasheet
LM393DR2GComparator datasheetonsemiInput range and open-collector output.Datasheet
Unit LightEnclosure STLM5StackCase outline and connector location.Datasheet
Unit LightArduino tutorialM5StackExample with analog input on GPIO36 and digital input on GPIO26 on Basic V2.7.Datasheet

Board notes

Connector orientation
Face the photoresistor and blue trimmer with the socket at the bottom. From left to right, the four contacts are GND, 5V, D.OUT and A.OUT.
Read both signals
Connect A.OUT to a host ADC that can accept the divider voltage up to the nominal 3.3 V rail. Connect D.OUT to a digital input and share ground. The Basic V2.7 example uses GPIO36 and GPIO26, respectively.
Response to light
The schematic places the photoresistor between Ain and ground. Brighter light lowers its resistance and pulls Ain down. Within the comparator input range, D.OUT goes low when Ain drops below the threshold set by R3.
Revision evidence
The published schematic is V1.0, dated July 18, 2018. The PCB revision is unconfirmed in the photographs of the enclosed unit.