Arduino Controls for Electric Motorcycle

Hello all,

I am new to Arduino but not to general hardware, programming, and buffoonery. I've built a EV Motorcycle before and now I'm on my 2nd. The control panel on the old bike was ugly and lacked many features. I'm looking to incorporate an Arduino touch panel display into my build. I'm hoping to have access to these features completely within the touch panel and would appreciate any advice on feasibility:

----------------- What I need:
-----Speedometer: possibly GPS instead of a wheel sensor. This has the benefit of having an Odometer log if I'm not mistaken.
-----Battery Voltage: I need a system wide voltage readout and a sub-screen of individual battery volts would be great in monitoring battery health.
----- System Amps: This is a nice way to make sure I'm not overtaxing my electric motor
----- DC Motor Temp: I think my motor already has a temp sensor connection but if not a sensor on the housing would do I'm guessing?
----- Headlight: It's be cool to integrate smaller functions like a headlight or laser bike lane but this may be overkill since the buttons can be easily mounted to handlebars.

----------------- What I'd like:
----- System shutdown: As much as I'd hate to have my bike mysertiously shut down it may be prudent to have this overvoltage/temp disconnect switch.
----- Pandora player: I'd go with a simple MP3 player but I don't have a music library. Not sure how doable this is without a data plan of sorts.
----- Bluetooth: Could connect to helmet ear buds. Good for music and other things.
----- Garage door opener: This would be nice as I wouldn't have to get off my bike to get back into my shop.
----- Keycode password: Thought this would be cool for panel security or event EV startup (no keys!)

I've already purchased an Arduino Mega and a display. I would welcome any advice on any aspect of this. I'm just getting started so I have a long way to go and plenty of directions I can pursue.

Thanks,

Brian

I will assume you've considered safety concerns of trying to build your own vehicle. Arduino is not designed for automotive use, but it could be used for prototyping. Just make sure you do significant testing.

As for the other parts:
Speedometer: Easy, use a rotary encoder on the wheel? You can double check with a GPS, but that seems the simplest. You can get magnetic or optical ones, and I'm surprised you aren't already using them to intelligently control and monitor the speed.

Voltage meter would be easy, just buy an analog Mux that goes between the various voltages you want to read and only use one ADC. It would probably need heavy filtering.

Ammeter: you can use either a hall effect or a shunt resistor. Fairly simple. Should probably be tied into the motor controller anyways for safety.

Temperature: There are plenty of sensors, just make sure you get one with the right range. It might be easier to get a digital sensor (i2C or something similar) to avoid noise issues.

Headlight: Again simple, especially if you find a premade module you can just switch on and off with a transistor or relay.

Other stuff:
System Shutdown: this is a must, as well as an E-Stop that will kill power to the whole system no matter what. Use a relay/solid state relay. The E-stop is usually that is just a massive switch wired in series with the battery. However, make sure you display warnings before you just kill power.

Music/Bluetooth: This will require an external device. Its entirely possible, however arduino is non-ideal for music. There might be a complicated way to integrate this, but you do not want to dedicate much processing power to this over essential functions.

Garage Door Opener: This is an eternal device. The easiest way would be buy a working one, and replace the button with a transistor/relay controlled by the device.

Keycode: This is just software

If you take these things one at a time, I don't see any big problems. You'll have to count the number of required inputs/outputs and figure-out if you need some sort of "expansion". And, try to think about data-rates... You can update things like speed & temperature a few times per second, but audio requires thousands of samples per second, etc.

I'm not sure if GPS will give you enough short-term real-time information to work as a speedometer, especially at slow speeds.

Voltage & current should be no problem. The current is an indication of battery drain at any moment in time. Your motor is going to take whatever it needs or whatever it can get, depending on the situation. Usually, you can stall a DC motor (worst case heat/load situation) with full-voltage applied, it will pull the maximum current, and nothing bad will happen. But I suppose every motor is different.

Automatic shutdown should be OK as long as there is sufficient warning, allowing you to pull off the road. And, maybe a bypass button. Or maybe instead of automatic shut-down, a big warning light that tells you to stop and shut-down.

Of course, your music player is going to require either streaming audio, or local storage. The music player might need it's own Arduino, or a different processor.

An RF receiver/transmitter could be used for your garage door opener, but you might need a 2nd Arduino on the receiver (garage door) side.

Using a keypad access/security code, shouldn't be a problem.

This is an awesome start.

Mirith
Thank you for the warning on safety. Too many people tinker in EV without respect for the power and get hurt. I've already built an EV so the actual functioning of the vehicle isn't a big problem. I just wanted a slick interactive display to have access to information. I'll look into the rotary sensor since GPS is seemingly not accurate enough for a proper speedometer. Having a display warning is a good idea as that will give me a clue of what the problem is before shutdown.

DVDdoug
I like the idea of a big warning light, allowing me to shutdown at my safety. combined with Miriths warning display suggestion I think this is my best option. I figured the keycode would be just software, glad to hear I was right.

With everything going into this build I think it's more prudent to just have a bluetooth headset in my helmet that can use my phone. Seems simpler and I don't need to be looking down at my display hunting for a song anyway. I was contemplating trying to replace the expensive motor controller entirely but that may be out of my skill range at the moment.

I've attached my wiring diagram for fun. It's old and the Arduino controls would replace the key switch but it's a start. If you see anything wrong or have any ideas I would welcome them.

Questions:

  1. Would you guys suggest any likely sensors, shields, controllers, or loggers you think I may need or get use out of?
  2. I would like to hard wire the build into the electrical series so it's always on but I'm not sure if it would eat up power even in sleep mode. Should I have a separate DC battery for it or just a DC step down with a dedicated fuse for protection?

All I can do is tinker and study but I mached up a sample of what my minds eye had for the EV interface.

Primary interface. I figure the top and bottom figures need never change.

Battery health menu

Just messing around. Changes and suggestions are welcome.