Both the Union and the Confederacy developed an army Signal Corps during the Civil War. The job of the Signal Corps in both the North and South was to quickly and accurately relay information and orders between the commanders of different units within the two forces (which was especially crucial during battles). The main way they did this was through the use of a flag system called wig-wag (not to be confused with semaphore), which was invented by Albert J. Meyer, an army surgeon, shortly before the war.
You’ll find records from both the Union and Confederate Signal Corps at Fold3. Check out the Fold3 HQ blog for details.