Trying to build a micro controller for motorcycle Aux Lights. Possible?

Hello everyone I'm totally new to Arduino. So i don't know if this is possible? I have a momentary switch and high powered led lights for my motorcycle. Basically i want to make the arduino control how the light functions.

Such as -

Hold down the momentary switch for a specified amount of time and the lights turn on.

Hold down for a specified amount of time and the lights turn off.

If the motorcycle is Ignition is on, Leave lights on. But if the motorcycle ignition is off the lights will turn off after 5 min.

The lights will be controlled through a relay. 12v

Is this possible and how would i even go about this? Thank You!

Nice little project.

While you might prototype on an Arduino board, and I suppose it would be just as cheap to use a Pro Mini in the final version, you could use just the ATMega chip on its own, plus a regulator and programmed to use its internal clock, to do this function. In fact, you could use an ATtiny, but then you have to modify the code slightly and prototype it for the different chip - it isn't worth it.

Interfaces:

The momentary switch connects from an input to ground and uses the internal pull-up of the MCU. For protection, you should add a 1k series resistor near the MCU input pin in case of mishaps with the wiring.

You need a transistor to control the 12V relay with a base resistor of the order of 1k. The resistor and transistor should of course be in the same enclosure as the MCU, whether or not the relay is.

To sense the ignition line, you need a voltage divider on the digital input pin of about 10k to the ignition and 4k7 to ground. A capacitor of 0.1µF from the pin to ground and also from the switch input pin to ground would be a good idea.

You need to study proper debounce code for both the button and the ignition input pins. The debounce code itself will take care of your "Hold down the momentary switch for a specified amount of time" concern.

If you based your project on a Pololu Baby Orangutan, that would give you an integral dual h-bridge driver which could be used to drive the relay (up to four relays, actually).

Ok, Thank You, Some of that makes sense. Off to learn the basics of Arduino.

Any ideas on amount of memory i will need for these simple tasks?

ktrim89:
Any ideas on amount of memory i will need for these simple tasks?

A few bytes at maximum.

// Per.

Should the circuit look like this?

Also can this small relay handle a motorcycle battery?

arduino-control-relay-schematic.png

ktrim89:
can this small relay handle a motorcycle battery?
http://www.gravitech.us/quick2relays.html

The issue is not the battery, it’s how much current the load will draw when connected to that battery. Relays have a maximum rated current and you need to ensure that the load does not exceed that.

There are 2 lights, they pull 0.8A each. Relays are rated to 8A/DC. Should work. Thanks

The schematic looks sound. I would recommend using a pull-up resistor on the button, instead of pull-down. it will be more noise-immune this way.

// Per.