On January 6, 1838, inventor Samuel Morse made the first public demonstration of a new machine that would revolutionize the way the world communicated—the telegraph. Unlike many other innovators, who pursued their technological passions from their youth, Morse came to his scientific pursuits later than most, after a personal tragedy left him emotionally shattered and newly set upon a new path. Check out six things you may not know about the inventor of the telegrap

1. Morse had an earlier career as an accomplished painter.
The son of a Calvinist preacher, Massachusetts-born Samuel F. B. Morse studied philosophy and mathematics at Yale University before turning his attention to the arts, eventually travelling to England in 1811 to study painting. After his return stateside, he received commissions to paint portraits of former Presidents John Adams and James Monroe, several wealthy merchants in Charleston, South Carolina, and a series of allegorical works depicting the inner workings of the U.S. government to hang in the halls of Congress. For the ardent nationalist Morse, an offer in 1825 to paint the Marquis de Lafayette—the French nobleman so inspired by the ideal of liberty espoused by the Declaration of independence that he fought alongside the colonial army—was likely the pinnacle of his career.

2. The death of Morse’s wife was the impetus for his work on the telegraph.
It was while working on the portrait of Lafayette that Morse suffered the personal tragedy that changed his life forever. In Washington, D.C., for the commission, Morse received a letter from his father–delivered via the standard, slow-moving horse messengers of the day–that his wife was gravely ill. Morse immediately left the capital and raced to his Connecticut home. By the time he arrived, however, his wife was not only dead—she had already been buried. It is believed that the grief-stricken Morse, devastated that it had taken days for him to receive the initial notification of his wife’s illness, shifted his focus away from his art career and instead dedicated himself to improving the state of long-distance communication.

3. Morse has competition for the title of “inventor” of the telegraph.
After his wife’s death, Morse once again travelled to Europe, and on the return trip had a chance encounter with Charles Thomas Jackson, an American scientist who showed Morse his latest work on electromagnetism, inspiring Morse’s idea of using electricity to transmit messages over long distances. And Morse was not alone in his work on such an invention. Unbeknownst to him, two English scientists, Charles Wheatstone and William Cooke, were conducting their own experiments in electrical telegraphy. Though they had begun their work later than Morse, they had some success sooner, developing—and receiving a British patent for—a machine that utilized multiple telegraph wires to transmit a single message. Morse, whose research was focused on a single wire system, eventually gave the first public demonstration of his telegraph machine on January 6, 1838, in Morristown, New Jersey.

4. A teenaged girl selected the words for the first official telegraph message.
In 1835, Henry Ellsworth (a Yale classmate of Samuel Morse’s) was appointed the first Commissioner of the U.S. Patent Office, where he quickly became a champion of American inventions, supporting the development of Samuel Colt’s revolver among other projects. Morse had received a U.S. patent after the 1838 demonstration of the telegraph, but desperately needed additional funds and government support to make it a viable technology. He sought assistance from Congress for nearly six years, to no avail. Finally in 1844, after an all-night session in which Ellsworth had lobbied forcefully on his friend’s behalf, Congress appropriated the money for Morse’s work. A grateful Morse, who wanted to show his appreciation for his friend’s support, decided to allow Ellsworth’s 17-year-old daughter Annie to choose the text of the first formal telegraph message. Annie, a part-time patent employee who was rumored to have a crush on the much older, widowed inventor, chose a passage from the Old Testament’s Book of Deuteronomy. On May 23, 1844, Morse, situated in the U.S. Capitol, tapped out Annie’s words to his longtime assistant Alfred Vail. Seconds later, Vail, sitting in a Baltimore, Maryland, railroad depot less than 50 miles away, received the brief message that would usher in a new world of communication—What hath God wrought?

5. Morse spent years in court fighting for recognition of his work.
After years of hard work, Morse’s telegraph was an immediate success: Within a decade there were more than 20,000 miles of telegraph wire in the United States alone, and by 1866 a transatlantic line had been laid from the U.S. to Europe. Morse probably expected to kick back, relax and reap the benefits of years of hard labor. That’s not quite how it worked out, though. Despite the fact that Morse obtained patents and established telegraph exchanges in countries around the world, many governments (including for a time the United States) often ignored his claim to be the sole inventor of the telegraph, refusing to pay the correct royalties due. Eventually, Morse took his case all the way to the Supreme Court, who found that while others had indeed created earlier telegraphs somewhat similar to Morse, he was the first to make use of a single-circuit, battery-powered machine. Eventually, several governments came around, giving Morse a cash payment worth more than $2 million in today’s money and insisting that he be paid future royalties on time—finally making Morse a very wealthy man.

6. Samuel Morse made a memorable exit from public life.
When Alexander Graham Bell died in 1922, telephone lines in both the U.S. and Canada went silent for a full minute to coincide with the start of his funeral. Nine years later, a similar tribute was offered up for Thomas Edison, when President Herbert Hoover asked all Americans to dim their lights in honor of the recently departed “Wizard of Menlo Park.” Few inventors, however, are able to receive the adulation of their adoring public—and bid them adieu—while still alive. Samuel Morse did both: In 1871, a group of Western Union employees began working on a fitting tribute to the man who made their careers possible, selecting June 10 as a semi-official “Samuel Morse Day.” The daylong celebration included a parade, a cruise around New York Harbor and the unveiling and dedication of a statue of Morse in New York’s Central Park, a ceremony that drew 10,000 onlookers. Congratulatory messages poured in from around the world—by telegraph, naturally. At 80 years old, Morse himself was unable to attend many of the daytime events, but he did show up for the grand finale, a reception at the NY Academy of Music held that night. While speeches heralding his accomplishments continued for more than an hour, a secret project got underway. A series of telegraph instruments, hidden from view of the guests, slowly became the hub of a communications network that stretched across the country—with every city and town with a Morse set-up connecting in remotely. When everything was in place, it was announced that Mr. Morse himself would now say goodbye to the American people. A Western Union operator slowly typed out Morse’s final message, slightly longer than his first: “Greeting and thanks to the Telegraph fraternity throughout the world. Glory to God in the Highest, on Earth Peace, Goodwill to men.” Morse then took his own turn at the desk, finishing off the message by signing his name, S.F.B. Morse. Morse died 10 months later.