Your sensor signal's noisy, the microcontroller's misreading it, and you've already swapped the wiring twice. You don't need a cleaner wire. You need a Schmitt trigger. The 74LS14 gives you six independent Schmitt-trigger inverters in one 14-pin DIP. Feed in that wobbly analog-ish signal, get a crisp digital edge out. Six channels means you can clean multiple sensor lines on the same board. Jaycar stock, ready to slot in tonight
| brand | Jaycar |
| part_number | 74LS14 |
| package | 14-pin DIP |
| function | Hex Schmitt Trigger Inverter |
| category | Electronics & Components |
| subcategory | Electronic Components |