Arduino Nano Vin problem

Hello arduino members,

My project is to make a quick shifter for a bike, using a proximity sensor and arduino nano.
I use a nano board, a relay 12volt 10A, a IRF520 το give 12 volt to relay.
Look that photo,
https://www.photobox.co.uk/my/photo?album_id=4589805876&photo_id=500105089853.

Description:
12 volt from battery -> 7812 to keep 12,2 volt -> fuse box 200mA -> Nano Pin30 Vin.
In pin 29 connect Ground (Negative from battery).

In pin 27 connect brown wire from proximity (5 volt power)
In pin 28 connect blue wire from proximity (negative)
In Pin 5 (Digital pin D2) connect black wire from proximity (give 5 volt when come close to metal)

When D2 is HIGH (proximity ON), D13 is HIGH for 50msec.
D13 gives in IRF520 (Gate pin) 5 volt and allow RELAY to change from NC to NO.
D13 connect to Ground via 10kΩ (pulldown resistor)

Relay has + 12 volt from pin30.

The problem is when bike revs are over 10.000rpm, D13 change to HIGH -> LOW -> HIGH -> LOW etc.
nano on board led flash.

What happen? Electromagnetic field? Too much voltage? failty nano? small/big pulldown resistor?

Thanks

Your link does not work.

.

That tells me your bike charging circuit has a voltage sensor that opens when the voltage is above a certain value. An alternator output voltage is a function of RPM. Your attempt to limit the 12 volt input to 12 volt wont work when the input is 12 volts.

Paul

This is nano board

i try with external power supply (12 volt battery) with 7809 voltage regulator, work better, but then stop.
Tomorrow morning i try 7805 regulator and Independent Vin source.

Copy-paste that " https://www.photobox.co.uk/album/4589805876 " and you will see it.

How calculate the size of pulldown resistor?
How i make an Electromagnetic shield for signal?

I have had similar problem with a car rev counter and i made a circuit to isolate to battery supply to the rest of the circuit.

Also have a filter circuit to clean the incoming signal

gioujazz3902:
This is nano board
Go Create! :: Arduino :: OEM Nano V3 (ATMEGA328) FT232RL Compatible with Arduino IDE

i try with external power supply (12 volt battery) with 7809 voltage regulator, work better, but then stop.
Tomorrow morning i try 7805 regulator and Independent Vin source.

Copy-paste that " https://www.photobox.co.uk/album/4589805876 " and you will see it.

How calculate the size of pulldown resistor?
How i make an Electromagnetic shield for signal?

Your picture photobox wants me to join to see your picture. There is an option to include a photo on the forum "reply" box

Paul

Sorry i didn't look about attachment. Here we are..
How you made a circuit to isolate to battery supply to the rest of the circuit, ulisees?