Federal and international regulations require boats to carry lights between sunset and sunrise and during conditions of restricted visibility. The number and colours of the lights vary with the size of the vessel.
Many commercial vessels carry special lights that identify them to the others. This is important because right of way depends on the types of vessels involved. Tugs and commercial fishing vessels have the right of way over sailboats, which have the right of way over ordinary power vessels.
Unique lights are carried by each one. For example, when you are anchored (or tied to a mooring ball), you must display an anchor light that is a white all-around light. It needs to be mounted high so it can be seen from a distance (refer Fig. 1).
However, most of the cruisers do not use a masthead anchor light because the light is too high above the water level and actually makes it difficult to judge the position of the boat from just the anchor light, especially in a pitch-dark anchorage. That is why many people have devised their own forms of anchor lights that they stick lower to the deck on both sides of their boat.
Here is the circuit of a compact yet inexpensive automatic anchor light integrated with an ambient light sensor that turns it on and off automatically. This 12-volt LED anchor light can be used as a traditional masthead anchor light and/or as an optional pretty clever custom-built anchor light. A typical commercial anchor light is shown in Fig. 2.