In 1825 Adams signed a bill for the creation of a national observatory just before leaving presidential office. His efforts led to the founding in 1830 of what is now the oldest, still-operational scientific institution of the United States, the United States Naval Observatory. Adams in fact spent many nights at the Observatory, with celebrated national astronomer and oceanographer Matthew Fontaine Maury, watching and charting the stars, which had always been one of Adams' avocations.
Source: Wikipedia