A specialized optical chemical sensor for boron detection was designed using a polymer inclusion membrane (PIM). This unique sensor relies on an encapsulation method to create its optical membrane. The components involved in this sensor include azomethine H (AMH) as the reactive agent, polyvinyl chloride as the foundational polymer, and dinonylnaphthalene sulphonic acid (DNNS) as the extraction agent within the PIM structure. Various parameters, such as membrane thickness, concentration of AMH and DNNS, plasticizer proportions, stirring dynamics, and the pH of the solution under study, significantly affected the sensor's performance. Within a detection range spanning 4.0-116 ng mL