I'm trying to program an Arduino Pro mini 5v/16mhz (from sparkfun.com). I'm going to use this program to control the ignition of the custom electric trike (e-bike) I'm working on. I've purchased parts for this project but it will take time for the parts to get to me.
What I'm trying to accomplish:
- When entering the trike you would swipe and RFID card near the dash, The unit that I've purchase for controlling the RFID has a relay that is activated when a card is in the sensors range (item from eBay). I was hoping to use the relay as a button input. I've managed this no problem in past projects.
- On the dash is going to be a Light up push button that states "start engine." I'm hoping that when a proper RFID tag has been sensed that the button will light up, allowing the user to be able to see the start button in the dark, this light will be controlled through a relay as it uses 12v. But what I don't want to happen is for the RFID tag to be swiped and the light to stay on until you start the bike. In other words i want to the button to light up and give you time to push the button, but if you wait too long the Arduino resets and waits for the RFID tag again.
- Once the start button is pushed I want a relay triggered to turn on the bike. my bike uses 48v 30 amps continuous and 50 amps peak. So this relay would actually be controlling a 12v contractor to turn on the bike. at this point another smaller momentary tactile button that is labeled "off" would light up It would be wired to the Arduino so that once the bike is on that if this button is pushed the Arduino turns off the power to the bike, at this point the RFID would be needed to turn the bike back on.
I know how to program the setup and have it turn on the LED for the start button when the RFID is triggered, from this I would set up some sort of a timer that waits for the Start button to be pushed but if not it times out. This is the part of the code I'm having trouble with. I can't seem to figure out how to program such timer.
Any help that People can give to help me program this project would be greatly appreciated.