PDA

View Full Version : Arduino 12v Systems VCU



furyphoto
22 July 2015, 1640
In the generic thread I mentioned a 12v systems Arduino controller I was working on, and had promised to share some details and code. I figured I would start a new thread since there will likely be some questions, and hopefully suggestions to help me along the way.

This project was started as my "Get your feet wet" Arduino introduction. It was designed to replace most of the wiring on a vintage ICE motorcycle custom build, but will hopefully morph into a full on VCU /BMS for my Electric as I learn and add peripheral hardware and modules of code to the program.

I call it the sXootONE.

Here is the prototype:

http://services.andrewdoran.com/proofs/ElMoto/VCU-1.jpg

It currently consists of an Arduino Pro Mini (blue in the middle) an FTDI USB converter (Red on the left), a Voltage regulator (blue on the right) and an 8 relay breakout board to which everything else is mounted. There is a network cable soldered to 8 inputs on the arduino that will run to the handlebar controls, a network breakout for easily attaching wires from the switches. The switches will only need to carry 5v logic level voltage, so the shielded network cable is a tidy way to get feedback from the hand controls. Main power is attached to the common terminal of one of the relays, jumpered to the Voltage Regulator which has been adjusted to put out exactly 5v to the arduino and the logic side of the relay board. Ground to the boards is from the soldered pin in the bottom left of the Reg. Power to the boards is via red wire in the lower right from the Reg. out to a VCC pin on the Relay Board

http://services.andrewdoran.com/proofs/ElMoto/VCU-2.jpg

Any new versions will likely use a Arduino Nano which has a built in voltage regulator (up to 20v input vs. 12v for the Pro Mini) and USB converter, which will eliminate a bunch of soldering and fabrication.

I have added a 12AWG guage 12v buss on the back of the relay board to eliminate having to jumper the 12 volts to the common terminal on each relay
http://services.andrewdoran.com/proofs/ElMoto/VCU-3.jpg

The FTDI is soldered using bent over pins and double stick taped to the board. The arduino has the 8 network wires soldered to pins 10 through A3 for switch inputs:
http://services.andrewdoran.com/proofs/ElMoto/VCU-4.jpg

The VCC pin has a wire the runs under the arduino to the power pin on the relay board. The GRD and output pins 2-9 conveniently fit on the header of the Relay Board and so were soldered into place (+ double stick tape).
http://services.andrewdoran.com/proofs/ElMoto/VCU-5.jpg


The Code is pretty raw at this point and contains a bunch of stuff that may or may not get included in the final version, but it is working

It uses the Clickbutton Library which can be found here (https://code.google.com/p/clickbutton/)

You can copy the code and paste it into the Arduino IDE if you want to play with it. You will have to install the Clickbutton Library (https://www.arduino.cc/en/guide/libraries) for it to work

It also has the non Clickbutton code still included but commented out, although I don't recommend use without Clickbutton, as it de-bounces the switch inputs for more accurate button push readings.


/*

sXoot ONE
Motorcycle Virtual Wiring Harness
2014 Andrew Doran
http://andrewdoran.com

*/




//INCLUDE LIBRARIES:-------------------------------------------------------------
#include "ClickButton.h"


// DEFINE INITIAL FUNCTION STATES: ----------------------------------------------
boolean runlightsActive = true;
boolean britesActive = false;
boolean brakeActive = false;
boolean leftTurnActive = false;
boolean rightTurnActive = false;
boolean hornActive = false;
boolean startActive = false;
boolean suspendRunlights = false;
boolean parkActive = false;
boolean hazzardActive = false;
//boolean killActive = false;
//boolean headlightActive = false;


// DEFINE INPUT PINS: -----------------------------------------------------------//
#define frontCtrlPin A0
#define britesCtrlPin 10
#define brakeCtrlPin 11
#define leftCtrlPin 12
#define rightCtrlPin A0
#define hornCtrlPin A1
#define startCtrlPin A3


// DEFINE CLICKBUTTONS


ClickButton britesButton (britesCtrlPin, LOW, CLICKBTN_PULLUP);
ClickButton brakeButton (brakeCtrlPin, LOW, CLICKBTN_PULLUP);
ClickButton leftButton (leftCtrlPin, LOW, CLICKBTN_PULLUP);
ClickButton rightButton (rightCtrlPin, LOW, CLICKBTN_PULLUP);
ClickButton hornButton (hornCtrlPin, LOW, CLICKBTN_PULLUP);
ClickButton startButton (startCtrlPin, LOW, CLICKBTN_PULLUP);


// DEFINE RELAY PINS: -----------------------------------------------------------


#define runlightsPin 2
#define britesPin 3
#define brakePin 4
#define leftTurnPin 5
#define rightTurnPin 6
#define hornPin 7
#define startPin 8
//#define killPin 9
//#define headlightPin


// DEFINE INITIAL RELAY STATES FOR TIMED FUNCTIONS: -----------------------------
int leftLight = HIGH;
int rightLight = HIGH;


// DEFINE INITIAL MS COUNT FOR FUNCTIONS: ---------------------------------------
// will store last time LED was updated OR switch debonce
unsigned long leftTurnMs = 0;
unsigned long rightTurnMs = 0;
unsigned long hazzardMs = 0;


unsigned long britesCtrlMs = 0;
unsigned long brakeCtrlMS = 0;
unsigned long leftCtrlMS = 0;
unsigned long rightCtrlMS = 0;
unsigned long hornCtrlMS = 0;
unsigned long startCtrlMS = 0;








// DEFINE CONSTANT INTERVALS:----------------------------------------------------
#define turnInterval 500
#define hazzardInterval 200






// SETUP ///////////////////////////////////////////////////////////////////////


void setup() {


// SET INITIAL RELAY STATES TO AVOID MISFIRES AT STARTUP:------------------------
digitalWrite (runlightsPin,LOW);
digitalWrite (britesPin,HIGH);
digitalWrite (brakePin,HIGH);
digitalWrite (rightTurnPin, rightLight);
digitalWrite (leftTurnPin, leftLight);
digitalWrite (hornPin,HIGH);
digitalWrite (startPin, HIGH);
//digitalWrite (killPin, HIGH);
//digitalWrite (headlightPin,HIGH);

/* / ACTIVATE INPUT BUTTION PULLUPS:-----------------------------------------------
digitalWrite (britesCtrlPin, HIGH);
digitalWrite (brakeCtrlPin, HIGH);
digitalWrite (leftCtrlPin, HIGH);
digitalWrite (rightCtrlPin, HIGH);
digitalWrite (hornCtrlPin, HIGH);
digitalWrite (startCtrlPin, HIGH); */

/* // DEFINE INPUT PINS:------------------------------------------------------------
//pinMode(frontCtrlPin,INPUT);
pinMode(britesCtrlPin,INPUT_PULLUP);
pinMode(brakeCtrlPin,INPUT_PULLUP);
pinMode(leftCtrlPin,INPUT_PULLUP);
pinMode(rightCtrlPin,INPUT_PULLUP);
pinMode(hornCtrlPin,INPUT_PULLUP);
pinMode(startCtrlPin,INPUT_PULLUP); */





// Setup button timers (all in milliseconds / ms)
// (These are default if not set, but changeable for convenience)
//button1.debounceTime = 20; // Debounce timer in ms
brakeButton.multiclickTime = 1000; // Time limit for multi clicks
startButton.longClickTime = 1500; // time until "held-down clicks" register

// DEFINE OUTPUT PINS:-----------------------------------------------------------
pinMode(runlightsPin, OUTPUT);
pinMode(britesPin, OUTPUT);
pinMode(brakePin, OUTPUT);
pinMode(leftTurnPin, OUTPUT);
pinMode(rightTurnPin, OUTPUT);
pinMode(hornPin, OUTPUT);
pinMode(startPin, OUTPUT);
//pinMode(killPin, OUTPUT);
//pinMode(headlightPin, OUTPUT);
}




// MAIN LOOP ////////////////////////////////////////////////////////////////////
void loop()
{

// CHECK CONDITIONS FOR EACH FUNCTION STATE AND CALL APPROPRIATE FUNCTION ////////////////////////


readInputSwitches();


if (runlightsActive == true && suspendRunlights == false ){ runlightsOn();}
else{runlightsOff();}

if (britesActive == true){britesOn();}
else{britesOff();}

if (brakeActive == true){brakeLightsOn();}
else{brakeLightsOff();}

if (hornActive == true){hornOn();}
else{hornOff();}


if (startActive == true){
starterOn();
suspendRunlights = true;
}
else{
starterOff();
suspendRunlights = false;
}

if (leftTurnActive == true){
leftTurnOn();
rightTurnActive = false;
parkActive = false;
hazzardActive = false;
}
else if (rightTurnActive == true){
rightTurnOn();
leftTurnActive = false;
parkActive = false;
hazzardActive = false;
}
else if (hazzardActive == true){
hazzardFlashers();
leftTurnActive = false;
rightTurnActive = false;
parkActive = false;
}
else if (parkActive == true){
parkingLightsOn();
leftTurnActive = false;
rightTurnActive = false;
hazzardActive = false;
}
else {blinkersOff();}



// TEST SEQUENCE TO CHECK FUNCTIONS WITHOUT BUTTONS


//leftTurnActive = true;


//rightTurnActive = true;


//hazzardActive = true;


//parkActive = true;


//brakeActive = true;


//headlightOn();


//britesActive = true;


//runlightsOff();


//hornActive = true;


//startActive = true;


}






//FUNCTIONS///////////////////////////////////////////////////////////////////




// READ INPUT SWITCHES


void readInputSwitches(){

//WITH CLICKBUTTON


britesButton.Update();
if (britesButton.depressed == true){britesActive = true;}
else britesActive = false;


leftButton.Update();


if (leftButton.depressed == true){leftTurnActive = true;}
else leftTurnActive = false;


rightButton.Update();
if (rightButton.depressed == true){rightTurnActive = true;}
else rightTurnActive = false;


brakeButton.Update();
if (brakeButton.depressed == true){brakeActive = true;}
else brakeActive = false;


hornButton.Update();
if (hornButton.depressed == true){hornActive = true;}
else hornActive = false;


startButton.Update();
if (startButton.depressed == true){startActive = true;}
else startActive = false;

/* WITHOUT CLICKBUTTON
if (digitalRead (britesCtrlPin) == LOW){britesActive = true;}
else britesActive = false;


if (digitalRead (leftCtrlPin) == LOW){leftTurnActive = true;}
else leftTurnActive = false;


if (digitalRead (rightCtrlPin) == LOW){rightTurnActive = true;}
else rightTurnActive = false;


if (digitalRead (brakeCtrlPin) == LOW){brakeActive = true;}
else brakeActive = false;


if (digitalRead (hornCtrlPin) == LOW){hornActive = true;}
else hornActive = false;


if (digitalRead (startCtrlPin) == LOW){startActive = true;}
else startActive = false; */


}


// RUNNING LIGHTS: --------------------------------------------------------------


void runlightsOn(){
digitalWrite(runlightsPin, LOW);
}


void runlightsOff(){
digitalWrite(runlightsPin, HIGH);
}




// HIGHBEAM: -------------------------------------------------------------------


void britesOn(){
digitalWrite(britesPin, LOW);
}


void britesOff(){
digitalWrite(britesPin, HIGH);
}




// BRAKE LIGHTS: ---------------------------------------------------------------


void brakeLightsOn(){
digitalWrite(brakePin, LOW);
}


void brakeLightsOff(){
digitalWrite(brakePin, HIGH);
}




// LEFT TURN SIGNAL: ---------------------------------------------------------


void leftTurnOn(){
unsigned long currentMs = millis();
if(currentMs - leftTurnMs >= turnInterval) {
// save the last time you blinked the LED
leftTurnMs = currentMs;


// if the LED is off turn it on and vice-versa:
if (leftLight == HIGH)
leftLight = LOW;
else
leftLight = HIGH;


// set the LED with the ledState of the variable:
digitalWrite(leftTurnPin, leftLight);
digitalWrite(rightTurnPin, HIGH);
}
}




// RIGHT TURN SIGNAL: ---------------------------------------------------------


void rightTurnOn(){
unsigned long currentMs = millis();
if(currentMs - rightTurnMs >= turnInterval) {
// save the last time you blinked the LED
rightTurnMs = currentMs;


// if the LED is off turn it on and vice-versa:
if (rightLight == HIGH)
rightLight = LOW;
else
rightLight = HIGH;


// set the LED with the ledState of the variable:
digitalWrite(rightTurnPin, rightLight);
digitalWrite(leftTurnPin, HIGH);
}
}




// HAZZARD FLASHERS: -----------------------------------------------------------


void hazzardFlashers(){
unsigned long currentMs = millis();
if(currentMs - hazzardMs >= hazzardInterval) {
// save the last time you blinked the LED
hazzardMs = currentMs;


// if the LED is off turn it on and vice-versa:
if (rightLight == HIGH)
rightLight = LOW;
else
rightLight = HIGH;


if (leftLight == HIGH)
leftLight = LOW;
else
leftLight = HIGH;


// set the LED with the ledState of the variable:
digitalWrite(rightTurnPin, rightLight);
digitalWrite(leftTurnPin, leftLight);
}
}




// PARKING LIGHTS: -------------------------------------------------------------


void parkingLightsOn(){
digitalWrite(rightTurnPin, LOW);
digitalWrite(leftTurnPin, LOW);
}




// BLINKERS OFF: ---------------------------------------------------------------


void blinkersOff(){
digitalWrite(rightTurnPin, HIGH);
digitalWrite(leftTurnPin, HIGH);
}




// HORN: ------------------------------------------------------------------------


void hornOn(){
digitalWrite(hornPin, LOW);
}


void hornOff(){
digitalWrite(hornPin, HIGH);
}




// STARTER: ---------------------------------------------------------------------


void starterOn(){
digitalWrite(startPin, LOW);
}


void starterOff(){
digitalWrite(startPin, HIGH);
}




/* / KILLSWITCH: ------------------------------------------------------------------


void killOn(){
digitalWrite(killPin, LOW);
}


void killOff(){
digitalWrite(killPin, HIGH);
}
*/




/* / HEADLIGHT: ------------------------------------------------------------------


void headlightOn(){
digitalWrite(headlightPin, LOW);
}


void headlightOff(){
digitalWrite(headlightPin, HIGH);
}
*/



// END OF CODE (FOR NOW)



Currently the program does the following fairly basic things using the relays:

Turns on the running lights (headlight and tail light) when ignition comes on
Turns on the high beams when the switch in on
Turns on the brake light when the switch is activated (front and rear brakes need to be wired in parallel)
Flashes the left turn signal when the switch is activated (flasher interval can be adjusted, default 500 miliseconds)
Flashes the right turn signal when the switch is activated (flasher interval can be adjusted, default 500 miliseconds)
Sounds the horn when button is pushed
Triggers the ICE bikes original starter solenoid when the start button is pushed, and suspends all lights while starting to feed all power to the starter


The connections are pretty simple:

The controls are attached to the input pins as defined in the code. Each button is connected to the wire from the arduino on one side and ground on the other side. The inputs are "pulled up" which means they are normally reading 5v so shorting the buttons to ground activates the input. This eliminates the need for two wires to the arduino for each button. The switches have to be Normally Open.

For the outputs, again each device is connected to the Normally Open side of the respective relay and grounded to the frame.

The goal was to simplify the wiring, one Network buss for the inputs and one 12v wire to each device, eliminating lots of redundant ground wires, and things like a flasher relay.

Although it doesn't do much that is special right now, once the system is in place, all sorts of options for additional features are in now in play through software updates.
Some Ideas I have are:

Custom turn signal flashing sequence (multiple pulses of different lengths perhaps to the beat of the Imperial Death March)
Auto canceling turn signals (either timed, or by distance using a hall sensor and a magnet or both)
Auto brake light using a accelerometer to light the lamp anytime the bike is decelerating)
Pulsing brake light for added visibility
multiple clicks of the brake switch or high beam switch to activate parking lights or hazzard flashers
electronic kill switch
RFID or Fingerprint Ignition switch instead of a key
Auto dimming high beams
Head light doesn't light until after the bike is running to save battery
custom horn sequence (beep beep ba bee beep) (or Imperial Death March!)


I'm open to any suggestions too

So take a look if you are interested, play with it, and contribute if you like.

Cheers,

SplinterOz
23 July 2015, 0258
That is cool.. will download and try. Seems to be a reasonable replacement for the m-Unit from Motogadget

Ken Will
23 July 2015, 0334
Auto canceling turn signals (either timed, or by distance using a hall sensor and a magnet or both)

Excellent Post!

How about using a GPS board to cancel turn signals?

SplinterOz
23 July 2015, 0424
Btw gotta ask where you got that relay board from.

furyphoto
23 July 2015, 0729
A poor man's m-unit was the motivation. The parts total about $20. Got the relay board from eBay, about $6. Search "arduino 8 relay (http://www.ebay.com/sch/i.html?_odkw=arduino+8+relay&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR3.TRC2.A0.H0.TRS1&_nkw=arduino+8+relay&_sacat=0)" you can get a solid state relay board for about 15 bucks but the SSR'S have a much lower amp limit.

SplinterOz
23 July 2015, 1959
A poor man's m-unit was the motivation. The parts total about $20. Got the relay board from eBay, about $6. Search "arduino 8 relay (http://www.ebay.com/sch/i.html?_odkw=arduino+8+relay&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR3.TRC2.A0.H0.TRS1&_nkw=arduino+8+relay&_sacat=0)" you can get a solid state relay board for about 15 bucks but the SSR'S have a much lower amp limit.

Cool I actually found some advertised and based on your descovery have orded a relay board, Arduino Nano (I have some Uno's and Mega's), and FTDI board for about 30 bucks australian. pretty good.
I am turning over in my head how you could put the fuse box as part of this arrangement... a main one on the input and a fuse for each relay out.

Nuts & Volts
24 July 2015, 0752
Cool I actually found some advertised and based on your descovery have orded a relay board, Arduino Nano (I have some Uno's and Mega's), and FTDI board for about 30 bucks australian. pretty good.
I am turning over in my head how you could put the fuse box as part of this arrangement... a main one on the input and a fuse for each relay out.

Yea the only thing missing for me is the fuses. With those you have a drop in 12V solution. Just add wires.

This is a cool project.


Sent from my iPhone using Tapatalk

Jonny Panic
24 July 2015, 0950
I want one. Real bad.

furyphoto
24 July 2015, 1807
Cool I actually found some advertised and based on your descovery have orded a relay board, Arduino Nano (I have some Uno's and Mega's), and FTDI board for about 30 bucks australian. pretty good.
I am turning over in my head how you could put the fuse box as part of this arrangement... a main one on the input and a fuse for each relay out.

You shouldn't need the FTDI with a Nano, it has USB support built in.

furyphoto
24 July 2015, 2333
Yea the only thing missing for me is the fuses. With those you have a drop in 12V solution. Just add wires.

This is a cool project.

I don't know much about PTC resettable fuses (https://www.google.ca/search?q=ptc+fuse+12v+5a&tbm=isch&tbo=u&source=univ&sa=X&ved=0CD8QsARqFQoTCLnG_NLV9cYCFYE1PgodDocLFA&biw=1600&bih=775#tbm=isch&q=ptc+resettable+fuse), but I might have to take a look at incorporating some into the 12v buss I added to the relay common pins on the bottom of the board.

It would be great to get a custom PBC made with everything incorporated in one package. Maybe someday once I get it running smoothly.

SplinterOz
25 July 2015, 1541
You shouldn't need the FTDI with a Nano, it has USB support built in.

Your right... I didn't order one just couldn't remember when I typed.

BaldWatson
10 May 2016, 0707
Hi everyone..i am new to this forum. By profession i am an electronic hardware designer and recently started working on Arduino. I found the project discussed here very cool. Thanks fort sharing such a cool thing. Hope this will be helpful for me to learn something new about the Arduino. I want to know you attached the relays on the same board if they do not cause any temprature effect?

prototype hdi pcb (http://www.7pcb.com/HDI-PCB.php)

marcexec
08 May 2017, 1329
I wonder if I can revive/hijack this thread. :o

I've been thinking about this project and would agree on the Arduino Nano / IRF540 MOSFET combo. This is "down the line" for me atm to reduce cabling and add features that the bike doesn't have yet.
The 4 way variant is ~$5 on Aliexpress (search for "Four Channel 4 Route MOSFET Button IRF540"), the Nano only about $2 these days (crazy, huh? - order a spare).
With the port limitations: http://www.pighixxx.com/test/wp-content/uploads/2014/11/nano.png
one could drive 8 MOSFETs, measure a voltage/current or three and display something (LEDs/OLED/small SPI TFT.
I also considered the now ubiquitous Wemos D1 mini, but it doesn't have the pins (e.g. port extender) and needs extra 5V etc. It could always be put on later for added functionality.

(Mechanical) compatibility with pre-wired fuse boxes would be handy, too, e.g. this (https://www.aliexpress.com/item/8-Way-DC32V-Fuse-Holder-Circuit-Car-Trailer-Auto-Blade-Fuse-Box-Block-Holder-ATC-ATO/32615676357.html?ws_ab_test=searchweb0_0,searchweb 201602_5_10152_10065_10151_10068_436_10136_10137_1 0157_10060_10138_10155_10062_10156_10154_10056_100 55_10054_10059_10099_10103_10102_10096_10147_10052 _10053_10142_10107_10050_10051_10171_10084_10083_1 0080_10082_10081_10110_10111_10112_10113_10114_101 81_10037_10183_10182_10185_10032_10078_10079_10077 _10073_10070_10123-10050_10112,searchweb201603_16,ppcSwitch_2&btsid=42f83fbf-41f6-485b-b94d-4eca9b0fd647&algo_expid=e1c0f915-c77c-4ec2-bec2-51d172ea04a2-8&algo_pvid=e1c0f915-c77c-4ec2-bec2-51d172ea04a2).
This could be a very compact and fairly cheap powerhouse. Any thoughts?

DaanRademaker
15 September 2017, 0116
Anyways to revive this thread? The knowledge shared, and the initial design are actually one of the best out on the web. I am also currently looking to build a diy (and Open Source!) M-unit alternative, as I think the price they ask for their product is too steep. I am a newbie in the arduino field, but I know quite a bit about motorcycles. Perhaps we can get some momentum after this project? I can also add some value in 3d designing a case, I have experience in CAD software.

marcexec
15 September 2017, 0958
Anyways to revive this thread? The knowledge shared, and the initial design are actually one of the best out on the web. I am also currently looking to build a diy (and Open Source!) M-unit alternative, as I think the price they ask for their product is too steep. I am a newbie in the arduino field, but I know quite a bit about motorcycles. Perhaps we can get some momentum after this project? I can also add some value in 3d designing a case, I have experience in CAD software.

Welcome to the forum!
I'm still working on getting my bike running to use it for the commute, but see the need to tidy up cabling big time now :).
Have you played with Arduinos at all? If not, I'd recommend getting one from someone reputable like Banggood (http://https://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?p=5H30161851557201506R) (it'll run your bike, right?) and have a got at the tutorials in http://tronixstuff.com/tutorials/.

Stevo
17 September 2017, 1130
thanks for that tutorial link... I may have to dive into this when I have spare time

furyphoto
18 September 2017, 2311
I'll chime in quickly to say that I really haven't made much progress on this lately (or my El-Moto either) I have taken on a much bigger project, and have been almost singlehandedly rebuilding a 130 year old farmhouse. We will have siding going on in the next couple of weeks, and our occupancy inspection is in 4 days. so soon it will be buttoned up, and I will have time to play again. I am spending my rare spare minutes arranging some shop space for this winter.

That said, I would be thrilled if others took this and tried to improve. My plan was to open source this software, so input is welcome!. I like the FET boards too, I haven't seen those breakout boards before. I had looked at solid state relays breakout boards, but they can only handle 2A where the FETs will take 30. I suppose I should order a few to check them out. The first unit will be going in my ICE Cafe Racer this winter, I will update with progress on that when it happens.

Cheers -A

DaanRademaker
19 September 2017, 0224
Welcome to the forum!
I'm still working on getting my bike running to use it for the commute, but see the need to tidy up cabling big time now :).
Have you played with Arduinos at all? If not, I'd recommend getting one from someone reputable like Banggood (http://https://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?p=5H30161851557201506R) (it'll run your bike, right?) and have a got at the tutorials in http://tronixstuff.com/tutorials/.

Thanks for the resources, I will order a couple to start tinkering. In the meanwhile I'll keep a close eye out on your prototype! I can't believe the prices of the components either. So the MOSFETs would be used for both the indicators and the fuse circuit?

marcexec
20 September 2017, 1422
Well, you guys egged me on - I ordered one of the FET boards today (Aliexpress in this case, less than half the price of Banggood).
I'm still contemplating the resettable fuses, they seem to max out at 14A & 16V, which might be a bit close, especially on the voltage...

furyphoto
02 October 2017, 2259
Ordered 3 of the MOSFET boards to try out. By the time they arrive, hopefully I will have some time to tinker.
7425

Stevo
03 January 2018, 1428
Andrew, your code is very difficult to read on my puter. Is there another location on the web you have it available to download where it's easier to see the type??

furyphoto
07 January 2018, 1901
You should be able to select and copy it and paste it into wordpad, or the arduino ide

Stevo
08 January 2018, 0945
Did you write it all from scratch, or did you copy and paste it together from different sources? I'm trying to learn the structure of how to put multiple sketches together, or add a new sketch to a working program without fouling the whole thing up. It seems similar to HTML

furyphoto
08 January 2018, 2316
I wrote it, but in small chunks. If you break it down, one function at a time, it comes together pretty easily.
You need to learn the structure, where the variables, pins, etc need to be defined, and what goes in the loop.
you'll see that I structured it with a small section for each function at the end. These are basically subroutines than can be called using the function name. This keeps the loop less cluttered, and easier to manage.
once you have the structure figured out, you can search for tutorials or samples to achieve what you need, try it out in a separate sketch, then add the bits where they belong in your main program.

This is basically the fake it til you make it coding technique. I learn each more complicated bit of coding as I need it. It probably won't be the cleanest code to start with. It can be refined or rewritten when you have a decent beta version working. I think the coding language is C++ (at least when it is compiled)

coleasterling
10 January 2018, 1317
This is a super cool project. I've been lurking a long time and posting at ES under the same name here. I'd personally like to see some plausibility and safety checks integrated. Is kickstand up? Is throttle in a reasonable range for enabling main contactor? Stuff like that. Maybe even precharge checking.

darksplat
26 February 2019, 1651
Hi,

This is a very good project and I am wondering how your progress is going?

Cheers

furyphoto
01 February 2020, 1257
Here's another thread revive on this. I am tinkering again, and have added a Nextion Touch Screen into the mix. The RFID igniton on my ICE kicked the bucket this past summer, so I am doing a complete rewire, and replacing all of the analogue gauges and warning lights with this Touch Screen Human Machine Interface.


https://youtu.be/ixrIBekt090