This question already has an answer here:
I have HP i3 laptop and I recently install Ubuntu 16.04 LTS and I could not detect my home wifi. Later I found out that the wifi gets connected only if Im like a feet near the router. It does not work even 5 feet away, where in windows 7 (dual boot) it works even 12-15 feet away. Please help me fix this. I tried every solution given in similar posts. But nothing worked.