We present optical time-resolved multi-band photometry of the black widow binary millisecond pulsar J2052+1219 using direct-imaging observations with the 2.1m telescope of Observatorio Astronomico Nacional San Pedro Martir, Mexico (OAN-SPM). The observations revealed a variable optical source whose position and periodicity P = 2.752h coincide with the pulsar coordinates and the orbital period obtained from radio timing. This allowed us to identify it with the binary companion of the pulsar. We reproduce light curves of the source modelling the companion heating by the pulsar and accounting for the system parameters obtained from the radio data. As a result, we independently estimate the distance to the system of 3.94(16) kpc, which agrees with the dispersion measure distance. The companion star size is 0.12-0.15 Rsun, close to filling its Roche lobe. It has a surface temperature difference of about 3000 K between the side facing the pulsar and the back side. We summarise characteristics of all black widow systems studied in the optical and compare them with the PSR J2052+1219 parameters derived from our observations.