If you surf with your Samsung Galaxy S5 in a wireless network with a weak signal, then it is possible that it automatically switches to the mobile data connection. This can be very disturbing, because usually the signal of the wireless network should still be strong enough to surf with it. The automatic switch of WLAN to mobile data connection is an activated option in the Android settings of the Samsung Galaxy S5.
This is the so called: "Smart network switch"
It was intergrated on the Samsung Galaxy S5 in order to automatically switch between Wi-Fi and mobile networks, such as LTE, to build up a stable network connection all the time.
To disable the smart network switch on the Samsung Galaxy S5 proceed as follows:
First, enable the mobile data connection of your Samsung Galaxy S5. This is necessary because otherwise the setting is grayed out and can not be deactivated. When your mobile data connection on the Samsung Galaxy S5 is enabled, navigate to Menu -> Settings -> Wireless. Right at the beginning of the page you will see the option "Smart network switch".
Remove the check mark to obtain a not so stable wireless connection of your Samsung Galaxy S5 with the router still upright. Then your phone should no longer automatically switch between Wi-Fi and the mobile internet.