MJLorton Solar Power and Electronic Measurement Equipment Forum
New proof of concept ideas, projects, inventions => New proof of concept ideas, projects, inventions => Topic started by: kibi on March 09, 2013, 02:01:23 PM
-
Martin has done a video or two on the Victron MBV-600 series battery monitors. It really is a fantastic little unit, regarded by some as one of the best battery monitors about these days.
I while ago I posted how I hacked a cable to get it to work with the free software.
(http://www.wkirby.co.uk/Images/Victron/IMG_2284.JPG)
The interface is good and does what it should do, the software can log to a .CSV too, but you need a computer on all the while, burning energy.
I also stated at the time that it would be better to have the data presented online - cheaply. Victron do have a solution, but you must pay, a lot.
So, I finally got around to it and I have used an Arduino with an Ethernet Shield to grab the data that spews profusely out of the back of the BMV-600S and present it on Cosm's IoT website. Now I can view the data wherever, whenever. It could even be interactive, so I could switch things on or off via Cosm on the Arduino. I have not done this yet though.
Whats more, I can download the data from Cosm in CSV, XML or JSON. I think free Cosm accounts will store three months worth of data.
I looked everywhere for some code that I could load onto my Arduino to do the job, but it seems that nobody else has done it. So I had to write the code myself armed only with the datasheet supplied by Victron. I hate writing code. I like soldering irons and bits of old wire.
I got 99% of what I need to do done in the Arduino sketch, but after many many hours of wailing and gnashing of teeth I was stuck with one last bit. I got around this by using a soldering iron and some bits of wire - job done. Basically I needed to block the data stream into the Arduino at certain points, but I couldn't figure out how to do it in the sketch, so I soldered a crusty old BC547 in open collector mode to pull the Rx pin down to ground externally. The transistor gets turned off by the Arduino when it is ready to receive data. Crude, but it works.
This is what the raw data looks like as it comes out of the BMV-600
(http://www.wkirby.co.uk/Images/Victron/BMV-capture.JPG)
So here is a link to my Cosm feed where my BMV-600S is currently posting data live. Unfortunately, nothing too exciting is going on at the moment because I dont have my solar system set up yet. The inverter is just charging the battery continuously for now. Annoyingly you have to keep refreshing the Cosm page to see the latest data.
https://cosm.com/feeds/116608 (https://cosm.com/feeds/116608)
I hope to set up my solar system early in the summer time and then things will get interesting. I'll also wire my temperature sensors to this Arduino and modify the code to suit at some point.
I'll attach the Arduino code too if anyone is interested, it's a TXT file, but just paste into the Arduino IDE. I have a lot of comments in the code, so that should explain what I did in more depth.
Not much to see here, just the hardware lashup.
(http://www.wkirby.co.uk/Images/Victron/IMG_0164.JPG)
EDIT: I forgot to include the screen shot of the raw data feed from the Victron.
-
Very nice there. My little solar panel is not really attached to any monitoring other than a basic voltage and current sensor, but I did notice today that in the rain that this was the first day where I have actually drawn more energy out of the battery than I put in. Normally the charge limiter will kick in in late afternoon, or even at noon, but today nothing, I have been using lighting off it for half the day and it is slightly discharged. Max draw is 1.2A though, 4 3W LED lamps at present. I hope to power the workbench lighting from it soon as well, along with doing cordless screwdriver charging as well ( seeing as they all are provided from the same 12V supply it will be easy to change over).
-
That is good to know. It's always interesting to find out what other people are getting away with in terms of solar sizing. It's amazing what you can do when you start being sensible with energy.
I plan to run my workshop with two 250W panels to start with and provision for another if required when winter time swings by.
I'm going to go with a Midnite Classic 150 charge controller which can log data for 380 days and it has a web interface. It'd be nice to incorporate some of it's data into the Cosm stream, although I might need to use the Arduino MEGA for that one. This current code has gobbled up 22KB already and I still have to put my temperature sensors on it. 10K is enough for the temperature sensors, but I don't think it'll be enough once I start having to do web queries on the Classic. Maybe I could use the Classic's RS232 interface instead.
This is all talk for now, I stop getting paid in two weeks time. I hope for an extension on my contract then I can go ahead.
I hate coding.
-
Good luck on the extension, you are doing well there it seems.
-
Thanks you. It should be alright as there is still lots of work coming up.
I just don't want to spend a load of money without having a bit of paper that says I will get paid for the next six months.
One thing that was pretty cool about this battery monitor project is that it didn't cost a cent!
-
Preferable to have a longer term as well, but as they say.............. Holding thumbs for you, never know when I might want a TTI power supply delivered to a UK address.
-
It's one of the disadvantages with being a contractor. The maximum term is usually six months.
-
Holding thumbs for you as well Kibi...I know how that waiting on a contract / extension used to feel.
Excellent work on that hack and getting around the fees Victron would have charged....that's something I did not know...glad you raised it.
-
Thanks Martin.
The financial holdup has been a bit of a blessing actually because it has given me more time think about and design the system properly, making a few savings along the way :)
At the moment it's looking like a 800Ah - 1000AH bank, 750 - 1KW array (space permitting) and the Midnite Classic MPPT controller. The Classic is more powerful than a FM 80, the Classic 150 will charge at 96A giving just over 1KW charge capacity for a 12V bank. It'll charge a 48V bank at nearly 4.5KW!!!! I believe that it'll accommodate higher voltage banks offering even more power. The classic also has all the bells a whistles built in the that Outback doesn't. The Classic is more expensive than the basic FM 80, but considering the extra power and toys it's well worth it I think.
-
Brilliant, I've seen a video review on the Midnite and it looks very good....especially with all the features. Look forward to seeing how it all comes together.
Cheers.
-
OK, so today Cosm blew up. They sold out to LogMeIn. Their IOT thingy is called Xively.
My old Cosm feed was ported across as a legacy feed, but I have created a new Xively feed because in due time the legacy Cosm feeds will no longer be supported I expect.
So, my new Xively feed is as such:
https://xively.com/feeds/611817707 (https://xively.com/feeds/611817707)
The Xively feed updates the values without having to refresh the page, which is nice. Unfortunately however, the brain surgeons at Xively have not thought to have their graphs plot negative values. This is a big problem which I hope will be resolved soon. Also, you can't select the resolution of your timeline and there is no scale on the Y axis.
I have also had to amend the code to write directly to Xively. It is attached below, it only works on an Arduino MEGA, but you'll get the idea. This code also includes my DS18B20 sensors which my previous attachment did not.
-
Hi kibi,
in your first post you notice about cable hacking. Unfortunatey I can't find this post. Victron write about galvanic isolated cable. Can you give me a link to the cable hack. Is it TTL 5V or 3.3V Level on the BMV-602 side?
By the way the WIN Software seems to be download fro free on http://www.victronenergy.com/upload/documents/BMV-602BatteryMonitorV1.1.zip
So for first testing normaly only a cable is needed, best a ftdi USB cable solution or something like this. Who has a RS232 connector today.
-
Hello Sail
I did not go into any details about the cable hack. I basically used a MAX3232 which is a 3.3V TTL to RS 232 converter. The BMV is TTL 3.3V. You could then use a FTDI USB to serial converter to connect to a laptop or whatever. It is most unfortunate that manufacturers are omitting the RS232 ports these days.
Yes, the Windows software is free.
-
Hi, great post.
I'm hoping to connect a Victron BMV 700 or 702 to an Arduino for a similar purpose.
Just wondering though, what is the physical interface on the BMV side?
Did you buy it extra or did it come with the BMV?
(http://imgur.com/zujiFtQ.png)
This is what's provided on the Victron website but it doesn't really give any other clues. Shame, because if it said the exact interface, I'd be much more likely to give them the business.
Is that what yours looks like?
-
This is what it looks like on the back of my BMV-600. It's a standard 2.54mm pin pitch, so I just used a header plug to connect to it.
-
G'day, my BMV 702 actually has 2mm pitch, it appears to be a PH style JST connector (i.e http://au.element14.com/jst-japan-solderless-terminals/b4b-ph-k-s-lf-sn/header-top-entry-4way-2mm/dp/9492437 (http://au.element14.com/jst-japan-solderless-terminals/b4b-ph-k-s-lf-sn/header-top-entry-4way-2mm/dp/9492437)) so this looks like the ideal plug: http://au.element14.com/jst-japan-solderless-terminals/phr-4/housing-4way-2mm/dp/3616204 (http://au.element14.com/jst-japan-solderless-terminals/phr-4/housing-4way-2mm/dp/3616204) (ignore the image)... but that wasn't my primary reason for posting.
I'm wondering what actual circuitry you put between the BMV and the Arduino i.e did you just hook up the RX/gnd wires and parse the serial or something better?
I was wondering about trying to do a MAX232 style circuit as the VE.direct doco seems to suggest it's regular serial (although the voltage levels don't seem to match).
Just curious as this thread is the only reference to talking to the BMV from an Ardiuno I can find.
-
G'day and sorry for my delayed response.
The BMV-600 transmits with a TTL serial signal level of 3.3V. It does not receive any data at all, or rather, don't send any data to it. It can't do anything with any data sent to it and a 5V level signal sent to it probably won't do it any good.
The Arduino can fully interpret a 3.3V level signal as a high and therefore no level shifting will be required to talk to an Arduino. I have connected the Tx of my BMV-600 directly to the Rx of the Arduino. I am pretty sure that the same goes for the BMV-700 or BMV-702.
I realise that my very early posts in this thread discussed level shifting when communication with a proper RS-232 port on a PC. I built the level shifting circuit to interface the BMV-600's 3.3V serial to RS-232 in much the same way that Victron's $100 cable would do. I needed this facility to read the data stream into the Victron software and then into a terminal in order to begin figuring out how to get the Arduino code to work.
One of my posts on the first page of this thread has the Xively code attached to the post which you may use as an example for your project if you so wish.
This project seems quite popular in your part of the world. There is a Kiwi chap who has been running a version of my code for the last few years in his home solar setup.
-
Thanks for the update. I did get it working in end (I eventually realised it was just 3.3v serial and eventually got one of my devices to read from it).
FWIW the BMV (well 700 series at least) should be possible to write to, but Victron haven't updated the documentation for it. I.e http://www.victronenergy.gr/upload/documents/VE.Direct-Protocol-(2).pdf references "hex mode" that allows doing things like updating settings (primarily I just want to do forced synchronisations as the BMV thresholds simply don't work) but Victron haven't released the hex mode documentation they reference and haven't even had the courtesy to respond to emails regarding it :(