Smart Energy Management for Marine and Off Grid

Please or Register to create posts and topics.

OLED display

I am using the open-source firmware and added a .96" OLED in the case.  This displays Volts, Amps, Temp for both Battery and Alternator, Charging mode, countdown while in warmup and ramp-up, PWM%, and a flag for and external input that I use to cycle the PWM% down when I have my scuba compressor running off the genset.  It's a small display but it packs all that in nicely.  Used I2C.

Those little OLEDs are cheap and the display is amazingly good.  Cool!  Are you using the UNO with the OLED on the i2c and capturing the WS500 serial port data as it gets spit out here too.  Is the WS 500 powering your Uno? Feel free to attach some pics.  Other users often get a better understanding with a pic.

The OLED is on I2C right off the regulator board.   I created a class structure for holding the formatting information for each data field and some template methods (functions) to accommodate the different data types (integer, float, and char*) for doing the screen updates.  The Update method only writes to the OLED if the data has changed, so calling the Update method checks to see if the data changed, then if it has, it updates just that field on the OLED.  This eliminates "flickering" which happens on such a relatively slow display interface if you constantly update the display.  With that, the call to update each field is very clean.  A few examples of the call:

LCDaltAmps.Update(measuredAltAmps);
LCDbatAmps.Update(measuredBatAmps);
LCDbatAmps.Update(measuredBatAmps);
LCDaltTemp.Update(measuredAltTemp * 9 / 5 + 32);
LCDbatTemp.Update(measuredBatTemp * 9 / 5 + 32);
LCDPWM.Update((100 * fieldPWMvalue) / FIELD_PWM_MAX);
LCDState.Update(chargingStateString);

 

 

Nice Job Pete! I was thinking to use the CAN bus data for a High voltage/Low voltage Alarm. The alarm should work when the higher cell is 3,7V or the lower cell is 3,0V.

Do you think it would be easy to do using the CAN bus?

Hey Federico,

I am not sure what CANBus device you are using will be providing you with individual cell voltages, but if you have a BMS that is CANBus compatible you should be able to find the PGN (or custom string within) that contains cell voltages.  You would then need to get something like an Arduino and a CANBus shield or MCP2515 device on the I2C bus, load it up with a CANBus library and extract these voltages.  From there you could write a CPP/INO app and create a high/low select on all of the cell voltages and trigger a GPIO binary output into a relay.

It would be a bit of a challenge but is possible, but it all comes down to having the correct PGN (likely a custom one) with the data you can extract.

Here is a link to explore:

https://www.seeedstudio.com/blog/2019/11/27/introduction-to-can-bus-and-how-to-use-it-with-arduino/

Let us know how you make out.

x Logo: Shield Security
This Site Is Protected By
Shield Security