Image copyright AP

Lonnie Johnson was brought up in Mobile, Alabama in the 1960s, when black children were not expected to go far, but such was his talent for engineering that he worked for Nasa, and helped test the first stealth bomber. But as he explains here, the invention that made his fortune was a water pistol - the extremely powerful Super Soaker.

I've always liked to tinker with things.

It started with my dad. He gave me my first lesson in electricity, explaining that it takes two wires for electric current to flow - one for the electrons to go in, the other for them to come out. And he showed me how to repair irons and lamps and things like that.

The kids in the neighbourhood took to calling me "the Professor". We had little projects that we would work on, and I was the ringleader.

For example, I put together a working engine out of parts from a scrapyard, and we stuck that engine on one of our go-karts. It had thin wagon wheels instead of tyres, and the hood was just a crate. You controlled the steering with a piece of string.

I have never really understood why in this country so many people look down on black people

It was not perfect. We had to push the car to get it going, but after that it could sustain itself. And we had a lot of fun with it - though we were stopped by the police, because the vehicle was not exactly street-legal.

About three years later I was stopped a second time, when I was cycling around with some sheet metal on the back of my bicycle.

I was scared, but the police officer just wanted to know what the heck I was up to. So he escorted me home and I showed him how I was making a robot just like the ones I saw on TV.

Nobody had told me that the robots I saw on shows like Lost In Space had actors inside them!

This project took almost a whole year, my last year of high school. But finally the robot was finished and we entered him into a fair held by the Junior Engineering Technical Society at the University of Alabama.

We were the only black school there. This was 1968, just five years after Governor Wallace had stood in the doorway of the Foster Auditorium to attempt to block the enrolment of two black students - and my high school was in the news a lot because they were integrating us. White people were coming on TV, calling us all kinds of names, and saying they didn't want their kids coming to the school and being exposed to us.

Image copyright Getty Images Image caption Governor Wallace was asked to stand aside by US Deputy Attorney General Nicholas Katzenbach

It was all just curious to me. I have never really understood why in this country so many people look down on black people. I can't say it weighed on me at the time, though. I was just so excited to have my robot, to know that it worked and that I would have a chance to show it off.

The robot was called Linex. He was three-and-a-half-feet (1m) tall, had shoulders that could rotate and two arms with elbows and wrists that swivelled. He could pivot and move around on wheels.

His chest contained a propane tank that I'd filled with compressed air to move the limbs. His memory was a reel-to-reel tape recorder, which I'd linked to a remote-control unit improvised from my sister's walkie-talkie.

Linex was controlled by signals transmitted through this unit. When you turned the tape recorder on it recorded different frequencies and tones, like the noises you get when you press the buttons on a telephone. Then it would play back and the robot would follow all the instructions.

Image copyright Lonnie Johnson Image caption Lonnie and Linex

Well, I'm not sure if it's because the judges at the science fair were from out of town, or if it's because they were from industry, not the university, but in any case they awarded me and Linex first place.

Looking back, I am struck by the University of Alabama's lack of curiosity about me. You would have thought they would want to know, "Who is this guy? What kind of grades does he have? Is he qualified to attend school here?" But those overtures were not made to me.

I soon found my prototype water pistol was an excellent ice-breaker at social events

Instead, I got an Air Force scholarship and a math scholarship to Tuskegee University, a black school that's famous for the Tuskegee Airmen. During WWII there was an experiment to see if blacks could fly aeroplanes and the Tuskegee Airmen went on to become so successful as a fighter squadron escorting bombers that pilots would request them by name.

I received a bachelor's degree in mechanical engineering, then graduated with a masters in nuclear engineering.

In one of my first jobs, at Oak Ridge National Laboratory, I found myself working on cooling systems for nuclear reactors with an engineer who had graduated from a prestigious New England university. To my surprise I found I just knew how to do things he didn't know how to do. I had been exposed to things he hadn't been exposed to and I was able to solve problems more easily. I was struck by how well Tuskegee had prepared me to be an engineer.

Find out more

Listen to Lonnie Johnson speaking to Outlook on the BBC World Service

Get the Outlook podcast to hear more inspiring stories

I thought, "Here I am going toe-to-toe with an engineer from one of the top schools in the country."

In 1975, I was called to active duty in the Air Force, studying US space launches that used nuclear power. I felt it was a big deal to be involved in such an important project - we were providing technical support for launch recommendations that ultimately went to the president.

After I presented an analysis that identified a possible failure Nasa had overlooked, I was invited on to the Galileo Mission, the unmanned spacecraft sent to study Jupiter and its moons. I was given responsibility for attaching the nuclear power source to the spacecraft and allocating power to the various systems - the science instruments, the computer, the power control system.

A major concern was that in the event of a short circuit, power to the memory would be lost and the spacecraft would be unable to call home. So I devised an isolation circuit that would maintain power to the computer memories even when power was lost.

Image copyright Getty Images Image caption The famous Tuskegee Airmen

So in 1982 you could say that I had a fun day job working on these spacecraft in Pasadena, California, but all this time I continued to tinker on my own ideas in the evening.

At that time I was experimenting with a new type of refrigeration system that would use water as a working fluid instead of ozone-destroying CFCs. One evening, I machined a nozzle and hooked it up to the bathroom sink, where I was performing some experiments. It shot a powerful stream of water across the bathroom sink. That's when I got the idea that a powerful water gun would be fun! But it was months before I did anything about it.

I opened my suitcase, took the gun out and shot it across the conference room. And they said: 'Wow!' Lonnie Johnson, Inventor and father of modern water weaponry

I rejoined the Air Force and relocated with my family to a military base in Omaha, Nebraska. I went on to become the first engineer from the Strategic Air Command - which had responsibility for identifying nuclear targets - assigned to test the B-2 Bomber, the Stealth Bomber.

After I had settled into my new job and home, I set to work making the parts of the plastic water gun on a little lathe and milling machine in the basement. I really had no idea if the magic I had in mind was going to materialise until all the parts were put together and I was ready to pull the trigger.

I gave the plastic gun to my seven-year-old daughter, Aneka, and watched as she used it to play with the other kids on the airbase. They couldn't even get close to her with their little squirt guns.

I soon found my prototype water pistol was an excellent ice-breaker at social events. I took it to an Air Force picnic one day and a superior officer, a major, saw it and said, "What is that you got, Johnson?" I said, "This is my water gun, sir." And he said, "It looks really strange - does it work?"

So I turned to him and shot him right between the eyes. After that, the picnic was over. Everybody was throwing cups of water, cups of beer and it just turned into a big free-for-all.

Image copyright Getty Images

My initial idea was to manufacture the gun myself. A factory told me it would cost $200,000 to get the first 1,000 guns off the production line. Well, I didn't have $200,000, so I realised I would have to go into a strategic partnership with a toy company.

There followed seven years of frustration and false starts. I don't know what it is with me, but I've never been very good at giving up.

Then, in February 1989 I was walking the halls of the American International Toy Fair in New York, the world's largest toy fair, when I ran into a company called Larami.

At the time, they were knock-off merchants - they would look at what the major toy companies were making, and what had TV advertising, then they would make cheap copies and grab 10% of the market.

At the toy fair, the vice president, a guy called Al Davis, told me that the idea of a really high-performance water pistol was interesting. "I can't really review a product here," he told me, "but if you're ever in Philadelphia, where our headquarters are, I'd be happy to talk to you. Drop in and see us."

So I said, "Ok, great." But just as I was turning to leave, he called after me and said, "By the way - don't make a special trip."

Despite these discouraging words, as soon as I got home I started work on a fresh prototype of the water gun. The new test model was made of plexiglass and PVC piping, and incorporated a new design feature - instead of keeping water inside the gun itself, a two-litre soda bottle sat on the top, and acted as a water reservoir.

Image caption A patent for an early version of the pistol, which was not commercialised

Image caption The design that Larami brought to market had a simplified mechanism and stronger, blow-moulded reservoir

Image caption In the follow-up version the user pumped water rather than air, which was easier

It was 628mm long. The diameter of the water stream was 2.4mm and could reach more than 12 metres.

It took me a couple of weeks to build the model, then I called Larami and said, "It just happens that I'm going to be in your area soon…"

I remember sitting in their conference room with the president and vice-president of the company and some marketing people. I opened my suitcase, took the gun out and shot it across the conference room. And they said: "Wow!"

I knew that I had captured their imagination. But we had the challenge of commercialisation. This gun was more complicated than the squirt guns that were on the market, and it took a lot of work to bring the price down to $10. Even then, we weren't sure that anyone would pay anywhere near that amount for a water pistol.

In 1990, the gun appeared in the toy shops. It was called the Power Drencher. To begin with we didn't do any marketing or TV advertising - but it still sold well.

Image copyright Johnson R&D Image caption A prototype and early model Super Soaker

The following year, we rebranded the toy the Super Soaker and did a big push on TV. That was the summer we sold 20 million guns, and I remember just staring at my royalties cheque in disbelief.

It seems strange now, but back in 1992, the Super Soaker was quite controversial. There were a few tragic incidents - on one occasion some kids shot someone with a Super Soaker, and he shot back with a real gun. On another occasion, a water fight in Boston escalated into a real gun fight and a teenager was killed.

There were also reports of people using them in weird ways, for example filling them with bleach instead of water.

The mayor of Boston tried to introduce a voluntary sales ban on the toys. I got a phone call from a reporter from that city, who, in the most serious and grave voice told me, "We've got a report that Super Soakers are being used in drive-by shootings, and we were wondering if you had any comment."

I had no idea what to say to him. In the end, I said, "Well… you know… I think we should have more of that."

In the back of my mind, I felt that my work on toy guns was probably less harmful than the work I did on real weapons systems.

Further generations of Super Soakers followed, and I went on to design the N-Strike range of Nerf dart guns, which used some of the same compressed air technology. Being a toy that sells year-round, I made even more money through Nerf guns than I had with the Super Soaker.

I didn't buy a yacht or anything. I've spent the money on something much more interesting - to me, anyway.

I have built a scientific facility in Atlanta, Georgia, which has about 30 staff.

Image copyright Chris Reid Image caption Many versions of the gun were sold - here is Super Soaker superfan Chris Reid's super collection

For more than 20 years I have been interested in battery technology. Batteries typically contain liquid, but we have developed an all-ceramic battery which uses glass as an electrolyte.

It can hold three times as much charge as a lithium ion battery and it is stable enough that it can be used in very harsh environments, such as oil wells. It can be bulk-manufactured in a similar way to ceramic plates.

We are also working on an engine which is the great, great-grandson of the cooling system I was working on in 1982 when I hit upon the idea of the Super Soaker. The Johnson Thermo-Electrochemical Converter (J-TEC) is a very efficient engine that uses hydrogen to convert heat directly into electricity and it has no moving mechanical parts.

When I look at a problem I have an intuition about whether or not it can be solved, but that isn't good enough for most investors. The process of invention requires breakthroughs and you can't predict when those will happen. So it's really only thanks to the Super Soaker and Nerf guns that I have been able to develop the ceramic battery and the J-TEC.

Image copyright Getty Images Image caption Super soakers - and copycat water guns - feature heavily in the Songkran Festival in Thailand every year

At our offices we have a lot of the toys kicking around and every now and then we do play with them.

I also take the guns into schools to give talks. Kids need exposure to ideas, and they need to be given an opportunity to experience success. Once you get that feeling, it grows and feeds itself - but some kids have got to overcome their environments and attitudes that have been imposed on them.

In spite of the things that have been perpetrated on my race - holding us in bondage under slavery, then making it illegal to educate us and then subjecting us to long-term discrimination and criticism - we succeed anyway, to a very large extent. We just need to realise what we're capable of.

More than 170 Super Soaker models were launched, and they have made more than $1bn (£760m). For a while I tried to buy every toy that contained one of my patents, but I couldn't keep up.

After I'm finished with all this hard science stuff, I'm looking forward to doing some more straightforward inventing. Stuff where it's easier to make a bit of money.

I have a few ideas in mind - not toys, just consumer products that I know will be easy to manufacture and that will sell well.

But I hope you don't mind if I keep them to myself for now.

Image copyright Johnson R&D

As told to @williamkremer. Listen to Lonnie Johnson speaking to Outlook on the BBC World Service.

Follow @BBCNewsMagazine on Twitter and on Facebook