This is my idea on a design for a shark repellant device, the image below is a rough draft of how it would look.
The logic behind it is simple: even in the ocean there are creatures you don't approach, even sharks like a jellyfish because experience teaches the pain you'll get is not worth anything you might win back like a meal.
First part is it needs to be buoyant so it always floats on water, on the image you'll see 2 `swiveling firing pins` and `catridges` at the top when a shark approaches it will shoot a non-lethal dart with a serum intended to induce the same type of reaction as touching a jellyfish; like touching poison ivy but on another level. You might also consider how accurate the targeting might be given the water has waves but the same way there's motion calibration cameras you can have motion calibrated targeting that compensates for this movement. The method it will use to know a shark is present can include sonar and a camera and once it locks on it prepares to fire if it gets too close for comfort and this also means within range for the dart to hit. At the same time it will send a warning signal as a unique sound under the water and if the shark leaves all well and good otherwise it will get struck by the dart. As stated before it's non-lethal and the effect shouldn't last too long preferably. The point of using the sound is that if a shark that's ever been there before and struck passes by and hears the same sound should deviate away, this might take more than one encounter but once it associates the sound and the dart coming from a single "animal" it will try to avoid it the same way it would avoid a jellyfish.
Once this conditioning has been set it will have the added advantage of being self-replicating where a swarm of shark given a number of them have encountered the device pass near and hear the sound and flee, the others which haven't will also likely flee also.
The intent of this device then would be to deploy a number of them on shore-lines with known shark attacks where they would form a barrier of artificial jellyfish which let people and non-lethal fish pass by while keeping back any predator that can attack a human. If successful it would make it a natural deterrent without having to kill or maim them. The same logic could be applied while out in the ocean but with less likelihood of assured success given depending on how many shots it can fire at a moment and how many sharks might attack you at a given moment. By this I mean whereas on the shoreline you might have at least 30 of the devices patrolling a small area on the boat you'll likely have about 4 surrounding you, it's better than nothing but I'd recommend it where your ready at a moment's notice to retreat.
There's also LED's at the top which should flash green when there's no threat and possibly yellow or blue when there are some sighted sharks far enough and still the estimation is they can be fended off. If not let's say one is shot but continues to pursue without regard and continuous shots seem to do nothing, like a shark that can't feel pain this is a known condition in people so there's a chance it could also be found in a few sharks. Then the LED's change to RED for a warning and at the same time the speaker on top gives out a warning allowing people to know there's a risk. This is a highly unlikely event but still if needed another separate design for a device that only has a lethal shot can be made to patrol with this.
An example of a proof of concept would be this: imagine you have a shark tank with a couple of sharks. Normally if you put for example a duck on the water it would be attacked and eaten, you introduce the devices floating on the water till the sharks won't approach them. Now if you place the duck and they don't attack then in principle it should also work on the beach.
I didn't draw the propulsion but you can simply have a propeller and some guiding fins to direct it to where you want. Connected to a central hub they can give stats on spotted threats, threats successfully fended off, you can have a charging station that they automatically swim to when the charge is low, the cartridges will probably need to be refilled manually and finally if there's a school of sharks nearby they can act as a group and access the need to reposition themselves to fend them off without being overwhelmed.
Also if by some chance they get swept away by strong currents the GPS set to last for days will be used to locate them.