I try to build a controller to control VOTOL EM100 which control 80V BLDC Motor for electric motorcycle purpose.
My logic is quite simple, whenever I push a button (connected to D10, active LOW), it will trigger the parking signal (connected to A0, connected through cable above the pcb to the JST XH socket).
However, when I try to pull the gas through the throttle, the push button triggered randomly 1010101010. Can anybody tell me what is going wrong here?
Thanks in advance.
I used arduino nano, and the supply for it come from 12v dc dc converter. Below I attach my connection also pcb.
Yes, it is interference from the motor getting into the Arduino inputs.
You need robust pull up resistors on any input pin try with 1K to start with. Also you need to put a filter network in the motor to minimise the interference.
The actual schematic would help as well, and not the game of find the matching label you posted.
It looks like you are not driving the relays correctly as well.
Can you please post a proper connected schematic with all the switches and hardware that you have connected.
A PCB schematic is not very helpful to troubleshoot what the external hardware is not shown.
An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.
so maybe my first step will be, put a pullup resistor with 1k value accross pin A0 and GND? Do I have to remove the INPUT_PULLUP declaration on my code?
Hi,
On your digital inputs and you have 12V and 80V in the system, then consider opto-couplers on ALL your digital inputs to help isolate any interference.
How long are your wires from the input devices?
A 0.1uF capacitor on every input and connected to gnd, as well as some capacitors spaced on your PCB between 5V and gnd to minimise noise would also help.
Can you please post some images of your project?
So we can see your component layout.