The solid-state lighting is revolutionizing the indoor illumination. Current incandescent and fluorescent lamps are being replaced by the LEDs at a rapid pace. Apart from extremely high energy efficiency, the LEDs have other advantages such as longer lifespan, lower heat generation, and improved color rendering without using harmful chemicals. One additional benefit of LEDs is that they are capable of switching to different light intensity at a very fast rate. This functionality has given rise to a novel communication technology (known as visible light communication-VLC) where LED luminaires can be used for high speed data transfer. This survey provides a technology overview and review of existing literature of visible light communication and sensing. This paper provides a detailed survey of 1) visible light communication system and characteristics of its various components such as transmitter and receiver; 2) physical layer properties of visible light communication channel, modulation methods, and MIMO techniques; 3) medium access techniques; 4) system design and programmable platforms; and 5) visible light sensing and application such as indoor localization, gesture recognition, screen-camera communication, and vehicular networking. We also outline important challenges that need to be addressed in order to design high-speed mobile networks using visible light communication.