Battery level always 42% I purchased a second hand nexus 5 to find out that the battery indicator is always showing 42% and never updates, regardless of the actual battery charge level. 

I tried replacing the battery with the one from my brother`s nexus 5, then replaced the usb port board.
Also tried:


rooting  
installing twrp 2.8.7.1
elemenalX 6.0 kernel
Android 6.0.1
Cache and dalvik wipe
Use the battery until phone shuts down


Nothing helps, although the indicator jumped to 83% and to 54% after some actions which I dont remember. Maybe after cache wipe, not sure.

Anyone know how to fix this?
Battery contains the chip which provides information to fuel gauge hardware and drivers. Since you have already done that, next is to determine if the problem is with fuel gauge drivers/ software or hardware.

Wipe clean your phone (cache, dalvik and system) and flash stock ROM for your phone. Don't install apps. Switch to safe mode, charge  for about three hours (will certainly top the battery) and if the behaviour is same, then it is NOT OS related (yes, try all this with external SD and SIM removed...doesn't sound logical to do this and I agree but for some unexplained reason I had the experience of weird battery reading with SD card installed and reverting to normal when removed)

If this didn't help,almost certainly hardware related. Time to get the hardware checked and repaired