Inspiration

I've become fascinated with autonomous ships - mainly due to how they could visually look, but also on how they could revolutionise the logistic industry. It also seems like a logical stepping stone to an autonomous world.

However, ships are notoriously bad at manoeuvring. This combined with the poor weather conditions mean that ships are still colliding with each other.

Infrasound travels huge distances (even at low amplitudes), especially at sea. Further, it can't be heard by humans, so prevents discomfort. With machines that have turning circles measured in nautical miles, this seemed like a perfect solution to the problem.

Doppler Shifts of sound waves are also measurable, allowing for more information to be gathered.

What it does

At the moment, two ships are simulated on a collision course. Virtual infrasound waves are transmitted with serial information with all information encoded coming from Arduinos. The sound is virtually transmitted through an animation, and upon collision with the other ship, the information is transmitted to the Arduino. Upon receiving the transmission, a response is transmitted to allow for distance to be measured (i.e. echo location).

How I built it

The animated aspects are simulated on c# using Blend for Visual Studio 2019. This includes the travelling of the ship, to scale, and the transmission of the sound waves. The sound waves were reduced in speed by a factor of 100, since the animation was too quick for the collision event to be triggered.

Challenges I ran into

Unfortunately, I do not have two ships on which I could test this on. Further, I do not have any speakers or microphones for the Arduinos, so all real world occurrences had to be simulated virtually.

Animating on Blend proved a challenge. I could not figure out how to use the storyboard as suggested online, and had to make do with the DoubleAnimation object instead.

C/C++ has far fewer functions available than I'm used to. Even things like length() aren't there. Most notably is the difficulty I came to trying to declare a 2d global string array (although in hindsight this may have been a memory issue instead). I overcame this by creating a 2d char array with a pointer (although I am aware this probably was not the best practice). I also created a small function designed to reduce the size of my arrays by cleaning out old data.

Running out of memory on the Arduino's occurred several times, leading to me having to be conscious about how big the program was. Not something I've had to do before.

The Serial communication appeared to be very poor, both with delays and loss of information. Never having used serial connections before, I am unaware on how to fix this, so it is still unfortunately broken.

Accomplishments that I'm proud of

Finally decided to try out OOP, despite my comp sci friends trying to get me to for ages! It worked really well! I've also got the basics of Blend now, which should hopefully help in the future!

I've been wanting to try out using an Arduino for a while now, and have finally done it! Despite getting annoyed at the low-level nature of the programming language, I think this will definitely help me get a better understanding of how higher level languages work.

What I learned

OOP, Arduino, Blend, Serial Communication

What's next for ship_anticollision_system

I need to figure out how to fix the serial transmission issue. After this, I need to get the Arduinos to be able to communicate with the program to adjust ship courses. Then, I might even ...

CREATE MINI SHIPS TO REPLICATE IT!

Built With

Share this project:

Updates