I love using melons, trampoline, hydrant and utilt against sonic. Having a trampoline destroys his standard spin dash approach game, and usually a bounce from the trampoline results in players inputting fair. We can punish landing sh aerials with utilt. Bair is also useful, of course, for zoning and spacing. having a trampoline infront of a hydrant either makes sonic stay in place, jump on the trampoline, or jump on the trampoline and over the hydrant. Melon can make good reads with this. Sh Melon over the hydrant can hit Sonic right when he gets bounced up from the trampoline. Z-dropping melons are really good in cqc against sonic. They have good priority over his aerials, and when positioned right can a punish for attack us. If you're worried about sonic just running through the hydrant, just have a trampoline on the ground. Granted, you should have a trampoline out 100% of the match, but I can't stress how great the trampoline is against characters who approach by running up to us. It basically allows us to know exactly what they're going to do, which is jump.
Also spin dash doesn't one hit the hydrant. It takes a couple hits and keeps sonic stuck to the hydrant trying to plow through it. This is very good for us, because we can just bair the hydrant after even one hit of Sonic's spin dash attack the hydrant. If the positioning is really good, both the bair and the hydrant can connect, leading up to at least ~21% depending on stale moves or not. Also, this can work with Blinky and hydrant.
We also have the tools to edgeguard sonic. I think what needs to happen is more development of this part of the matchup. Sonic will most likely air dodge if you get anywhere near him off the edge. We can try to bait this and get an attack before he springs, or predict where he is aiming with landing the spring. Usually, sonic likes clinging to the edge when he recovers. I believe there's landing lag if he just lands on the stage. Our side B is really good at covering the edge, we can jump off and aim for the edge ourselves, hitting sonic, as he is aiming for the exact same spot. You can also just guard the ledge on stage if you curl the Pac-dot trail correctly along the ledge.