It's an unfortunate side effect to pain medication. For some people it will make them fall asleep, but for people like us it will keep them awake. My best advice would be to ask your doctor for a medication for insomnia. When it's close to bed time and I'm still in pain, I take my sleep medication instead of my pain medication. I do this because we don't feel pain in our sleep.
If you want a more natural way for sleep, look into melatonin or even dramamine (motion sickness medication). Medication like Excedrine PM have the same active ingredient as Benadryl.
I have more tips and tricks, email me at ***@****, and let me know how you're doing.