Indoor positioning systems using visible light communication (VLC) have potential applications in smart buildings, for instance, in developing economical, easy-to-use, widely accessible positioning system based on light-emitting diodes. Thus using VLCs, we introduce a new fuzzy-based system for indoor localization in this paper. The system processes data from transmitters (i.e., anchor nodes) and delivers the calculated position of a receiver. A particle swarm optimization (PSO) technique is then employed to obtain the optimal configuration of the proposed fuzzy logic controllers (FLCs). Specifically, the proposed PSO technique optimizes the membership functions of the FLCs by adjusting their range to achieve the best results regarding the localization reliability. We demonstrate the utility of the proposed approach using experiments.