I have an arduino nano on a 50cc bicycle. This arduino measures pulses from; one reed switch on the front wheel and one reed switch on the pedal. It works great in a shop environment when the motor isn't going, but when the gasoline motor is on, the arduino will freeze or act erratic after about 10 minutes of the motor going and me riding around. I then have to turn the arduino nano off and on again and it works fine for a few minutes before doing the same again.
The arduino nano is separated from the bike frame with 4 inches of wood. So I think the issue is definitely the arduino is collecting stray (maybe high) ac voltage (from 50cc motor) on the wires going to the reed switches and causing it to freak out.
tldr; This is my circuit right now. It works, but the arduino hardware becomes erratic after a few minutes of the motor going.
I don't know if my circuit is right to protect the inputs from the motors stray ac voltage? Did I put the resistors in the right place? Do I need a resistor in series with those capacitors to protect my battery ground? Do I need a 1k resistor going to the input? pls help, Im quite the numpty
Not realy, I went around the motor with the wires to keep distance and also kept most of the wire and arduino seperated from the bike frame by at least 2 inches.
Google said something like that but I'm too numpty to understand the grounding. If I buy a shielded cable, do I just ground the shielding to the bike on the frame in one spot. Would the motor reverse conduct to that shielding through the ground point though? Do I keep the arduino floating or ground it to the frame also?
Power is just from 4x AA batteries with a 5v regulator. I only have tiny capacitors where I drew them in the schematic. Should I add more capacitors or resistors somewhere? I just kind of guessed at how the schematic should be when I first made it, mind you, I am very beginner
Just think of it like having a wire attached to the frame (ground) and you coil that wire around your signal wires. Your wire in this case is the foil and it doesn't have an insulator around it. It acts like an antenna, taking any stray signals back to the bike ground and not into your signal wires.
Oh, and only take it back to the frame at a single point. Making contact at two or more points creates loops and you don't want those.
I don't think you should tie the grounds together.
I'd look at varistors and/or Zener diodes to help with overvoltage protection. Adding resistors wouldn't hurt, but you'll be creating a voltage divider and you want to make sure the voltage to the pin doesn't go too low.