How to modify JuiceBox firmware

Toyota Rav4 EV Forum

Help Support Toyota Rav4 EV Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Dsinned

Well-known member
Joined
Nov 6, 2012
Messages
1,213
Location
San Jose, CA
The software side is fairly "technical". If you know anything about C programming you should be able to understand it. I am NOT a programmer, so I find it difficult to understand, but there are enough "comments" in the JB's firmware source code to help figure it out. MINOR modifications are not overly difficult to make yourself, although there is most definitely a "learning curve".

The Arduino platform and application programming for it is generally used by DIY "hobbyist", so it is not meant to be overly difficult to learn. But, if you have no software programming experience whatsoever, it can be formidable. I had a few Basic programming classes in college, but never learned a high level language like C++. I did, however, dabble in 8 bit microprocessor machine code programming at one time, which taught me about "source code" and compiling to create "executable" code. I learned enough to be able to modify an existing program such as used by the Juicebox, provided the original source code is well documented, and thankfully it is, fairly so, by eMW. I believe the JB code was written with the virtues of "open source" in mind, and therefore intended to be more easily modified by end users. But, sometimes, I think the original programmer "assumes" too much for the sake of others who may want to understand the code to make custom modifications themselves.

To get started, first you'll need to buy an FTDL Programming Cable from the eMW Online Store, iff your JB did not already come with this accessory. It includes an Arduino I/O interface board to plug in to the main PCB in the JB. Both items sell together for $13. All pre-assembled units (both Premium and Basic) are preprogrammed by eMW, so the FTDI Programming Cable would be considered an "option" and can be ordered separately.

http://emotorwerks.com/products/online-store/product/show/68-ftdi-programming-cable-for-arduino-juicebox

Next, download the Arduino "IDE" (V1.05 or greater) from the following website.

http://arduino.cc/en/main/software

Then, download the JB firmware Arduino source code from the eMW website's "public" webpage that corresponds to your hardware version of the JuiceBox (where 8.9 is the latest version just released about a month ago). My JB is based on V8.7, which I purchased with firmware version V8.7.9, and then modified myself. Note that there are specific "version" directories to choose from for your hardware version of the JB. The higher the version (e.g. V8.9.x) the more updated the firmware to go with it.

http://emotorwerks.com/JuiceBox_Public/

The rest will entail many hours of studying the code before attempting the mods you desire. Plan on spending some additional time correcting your programming mistakes, before you have reached the point of doing a successful compile of your modified code for uploading into the JB hardware via the FTDI Programming Cable. The Arduino IDE Compiler will help to pin point all invalid lines of source code programming before you can attempt to upload the JB hardware. A source code Editor, Source Code Verifier and Compiler are included in the Arduino "IDE" software.

Have fun and GOOD LUCK! And if anyone has something more to contribute, please post, so that we can all learn from each other and get more fulfillment out of the JuiceBox EVSE.
 
Aside to eMW . . . since the announced release of PCB V8.9 and V8.9.1 firmware updates several weeks ago, I believe eMW was planning to also make available firmware updates for older JB units as well. New features that can supposedly be added in software to older units (starting from V8.7 PCBs?) are:

1) onboard internal temperature monitoring, and
2) improved accuracy for AC voltage and/or current measurements

Periodically, I've been checking eMW's open source "public" files webpages http://emotorwerks.com/JuiceBox_Public/, but there are no new updates posted there other than for V8.9. Please tell us when we can expect a firmware update to be released for older versions of JuiceBox?
 
One thing to note is that the v8.6 PCB boards can take the v8.7 branch firmware, just need to override the 120v current settings. Unsure if the v8.9 branch is backwards compatible.
 
Yesterday, I went to eMW's production facility in San Carlos, and spent some time there getting my JB's firmware updated. Valery helped me modify V8.7.11 to add in some new code for more accurate AC voltage and current monitoring as seen on the LCD. These firmware mods based on V8.9.1 worked out well, and am very grateful for Valery's help. The folks at eMW are working hard to build more JuiceBoxes now that they are selling on Amazon.com. Also, I was very pleased to see work has begun on some new products planned for the future too. Keep up the good work eMW!!!
 
I'm surprised there has not been more interest in this topic. There are presumably over a 1000 other JuiceBox users out there and probably a fair number charging RAV4 EVs.

Anyway, I have progressed deeper into JB firmware modifications over the past week. I am trying to complete a "mini" project to convert my JB over to a more ergonomically pleasing front panel display. Total cost of the project - not counting my time - about $70 for an upgraded display module and associated USB programming cable.

I found a slightly larger, yet still drop in compatible, 1.7" OLED display made by the same company (4D Systems in Australia) already used by the JB Premium. I have a JB in a "Basic" enclosure, but whatever is used as a standard feature in the Premium also can be added to the basic level product. This OLED device is capable of displaying 128 x 160 pixels. The currently used display, based on LCD technology, displays 128 x 128 pixels. After swapping displays, I am going to implement (in firmware) a larger size font set, based on MS Window Tahoma size 12, and change to a portrait mounting of the display module behind a plexiglass front panel in my JB. This requires firmware mods affecting about 15 to 20 lines of Arduino controller code.

The end result should be that the new OLED makes it somewhat easier to read over a greater distance, with essentially the same number of readable characters and lines of information on the full horizontal width and veritical height of the display. The new font has a greater vertical character height, but not appreciably different horizontal width. This lends itself well to a portrait orientation of 160 x 128 pixels whereas before there was only 128 pixels squared to work with making the characters displayed hard to read.

I have already loaded the new ASCII character font set into a 4GB microSD card (way overkill for what I actually needed). This can be added to any 4D Systems' micro display module. 4D provides a free SDK (referred to as their "Workshop 4 IDE") for all its products, which I have used as well in this project. All 4D displays are fully programmable using a serial (UART interface) command set. An inexpensive programming cable that plugs into a PC/MAC USB port is all that is required. Here's the specs on the 1.7" OLED.

http://www.4dsystems.com.au/product/uOLED_160_G2/

This has been kind of a "fun" D-I-Y project and I have learned a lot about small intelligent display modules and Arduino microcontroller programming.

Hopefully, perhaps by tonight, I will have uploaded the modified code and verifying everything works out favorably as planned! :mrgreen:
 
Another trip to eMW this afternoon for technical assistance was required, but with Valery's expert help - plenty of HELP! - we were able to get all the firmware mods completed and my customized JB up and running. Valery helped me implement several mods to the uLCD_144_SPE (.h and .ccp) library files as well as a few more tweaks to the main JB firmware. We encountered a few troublesome "bug" after trying to download the modified code. One was a bonafide H/W problem with my FTDL Programming cable's inline UART IC. Must of somehow got zapped at the same time false GFCI trips suddenly materialized. In fact, we had two UARTS chips go bad. The second "bug" was an old fashion software programming oversight with one particular line in the source code. Turned out to be not enough memory allocated in RAM. This inadvertently corrupted the GFCI code following this one buggy line in the code. Just one of those "GOTCHA" kind of inadvertent programming errors.

It was educational watching Valery troubleshoot all my modified JB firmware problems, but eventually he got it all sorted out.

THANKS VALERY!!! :mrgreen:
 
Starting to play with mine (have an v8.6 PCB). Stuck at getting the upload to work from the IDE. The green LED on the board flashes two times during the start of the upload process then gets stuck there. A suggestion was made that the Arduino be reset while the FTDI cable is connected and powered. However, the physical button is kind of impossible to get to given on how the board is mounted.

Probably bug the folks at EMW later this week if my Google-Fu fails me.
 
Braxus, you probably only need to make sure you're connected to the correct COM??? port. Been there, done that! :oops:

Go to the Arduino IDE's "Tools" menu to select the correct port. Also, don't forget to select the correct Arduinio MCU (Arduino Pro or Pro Mini 5V, 16 MHz w/ ATmega328). Or, you may have possibly not yet downloaded and installed the serial "driver" necessary for proper communications with the FTDI programming cable's I/O board. The latter contains a USART (Universal Serial Asynchronous Receiver Transmitter) IC that plugs in to the JB's main PCB. Here's where you go to download the necessary serial port driver.

http://www.ftdichip.com/Drivers/D2XX.htm

Btw, be sure to back up your existing source code, so that you can revert back to the original firmware if necessary. Trust me, attempts to modify firmware - even if the modified source code compiles without error - does not necessarily make for a properly "working" JB. But, don't be discouraged! With enough perseverance, you will get to the PROMISE LAND! :mrgreen:

I see you're in Mountain View, so you and I both have the advantage of living close to eMW's shop in San Carlos. I was just there again this past Saturday afternoon getting debugging assistance from Valery. He created the Arduino firmware for the JB, and is truly a marvel at debugging my bonehead programmer mistakes. We had one particularly troublesome bug in my modified code that was somewhat challenging even for him to sort out, but eventually he did. Many kudos to Valery for that!!!

One other suggestion based on my recent experience with making mods to the firmware in my JB, now with a newly customized display, be sure to re-test all operational JB control functions after each successful upload, especially if you have Premium. It is quite possible with each change to one part of the code, some other part of the code will be inadvertently affected, which may cause "new" problems. It is best to only change one thing at a time, then test again, before making more changes. This way, you can verify each change works as expected without disturbing any other functionality, before proceeding on to the next change.

Please keep us informed of your progress and GOOD LUCK!
 
Back
Top