article

Rob Duthie avatar image
Rob Duthie posted

Victron Raspi HAT

Hi All

Progress on the the Raspi HAT code name is called the Stetson as it does not follow the Raspi HAT

protocols, so i named it the Stetson due to space constraints in the PCB design with all the relays and plugs and sockets required etc.

It has the following inputs and outputs canbus PSU etc. All has being tested and confirmed working OK to date. as of version on Venus Ver 2.60. release and 2.66 candidate. All OK, For Later Version >2.66 there are issues that not all works as it used to. Update some progress with new version >2.66 to 2.80.19

As in Bold all working again except the VE direct I2C ports USB is OK.

2x Temperature using the the LM335 devices: Working OK on Ver 2.80.24 Added 4 temps

3x Tanks resistive: Working OK on Ver 2.80.24 Added 4 tanks

5x Digital Hi ports all isolated with pulse counting etc: Working OK on Ver 2.80.24

1x Canbus port Working: OK on Ver 2.80.24 on USB and SPI ports

2x VE Direct ports: Not sorted yet with software USB OK but

6x relays outputs: Working OK on Ver 2.80.24

1x PSU from 10 to 55vDC to be upgraded to higher voltage 75vDC

Attached schematic for you information.

Options for the future: buzzer indicator, code is there just need some time to redirect the code to the right GPIO pins to make it work.

The PCB design is almost complete, it will mount in a din rail enclosure and a main 40 pin ribbon cable will connect between the Raspi and the Stetson. Updated PCB files with VE direct ports.

Update 20/10/2021 Schematic updated to full 6x relays on board and new PSU module and the 4x Tank and 4x Temp sensor inputs. Digital input circuit change, PCB is done, BOM done.

Victron Raspi Hat.pdf

Victron Raspi Stetson.pdf

Regards

Rob D

NZ

Victron Raspi Hat.pdf

Victron Raspi Stetson.pdf


Raspberry Pi
156 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mark avatar image Mark commented ·

Thanks Rob.


1 Like 1 ·
s-exley avatar image s-exley Mark commented ·

Hi Mark,

I've sent you an email, if there's anything I can do to help, let me know.

Cheers
Simon

0 Likes 0 ·
Vincent Royer avatar image Vincent Royer commented ·

Looks awesome. Can I make some suggestions?


- 2 x CAN, isolated, like the Octo-GX, using RJ-45 connectors, or a board-mounted dip for termination resistor


- Ideally a whole other isolated CAN that can be a different speed (for can-bms and can-xxx at the same time)

- ve-direct ports that dont peel off the board when you look at them wrong like the ones on Octo-GX

- PSU with a +12V output as well for integration w/ the relays

- smd LEDs on the board at each input / relay output to show state

- if you can put all connections on one edge, otherwise it doubles the size of the install

- don't use spring connectors, use screw types and oversize them


0 Likes 0 ·
Rob Duthie avatar image Rob Duthie Vincent Royer commented ·

Hi Vincent

Answers in bold

- 2 x CAN, isolated, like the Octo-GX, using RJ-45 connectors, or a board-mounted dip for termination resistor. I will look into a dual isolated depends if another interrupt is required or not. I have already a 120 ohm jumper on board. I am using hard wired screw header connector

- Ideally a whole other isolated CAN that can be a different speed (for can-bms and can-xxx at the same time) as above, i have testing the canbus with a pylon US2000 with the USB port and direct canbus port both work OK, it will need some extra code to add the can0 and can1 ports? so far it is bullet proof with just can0 running.

- ve-direct ports that dont peel off the board when you look at them wrong like the ones on Octo-GX:Only have one serial port to work with for the VE direct port i will add a isolated serial port to suit RJ45 connector OK or screw terminal?

- PSU with a +12V output as well for integration w/ the relays: Can be added means another DC to DC converter PSU has to added to what current are you looking at 1Amp?

- smd LEDs on the board at each input / relay output to show state: Yes i was thinking about that and now will add into the design.

- if you can put all connections on one edge, otherwise it doubles the size of the install: I have used a dual edge Din rail enclosure to keep the PCB small, enclosure 125x90mm. other wise i will have to use a lot longer enclosure, due the size on the connectors i am using, i could use micro connectors, but is tight for the larger wires sizes there are trade offs.

- don't use spring connectors, use screw types and oversize them: I have used plug and header socket with spring terminals as standard. which take the larger wire sizes. These are duel in line to save space for the Analog and DIO ports the relays are screw terminal header plugs.

0 Likes 0 ·
Vincent Royer avatar image Vincent Royer Rob Duthie commented ·

Why screw connectors for CAN? you should stay with the Victron standard of RJ45. It eliminates user headaches figuring out their own can cables. Also, when you connect it to Victron equipment, you will have to cut an RJ45, leaving you with tiny 26AWG wires which won't reliably connect to your screw terminals. Use RJ45!

For Ve-direct maybe the best way is to implement direct serial input, its 5V ttl iirc, so you'll have to level shift it. But I wouldn't omit it entirely from your design.

For the 12V out, you don't need a lot of current, 1A is fine, but something with built in flyback so we can hook it up to a bigger contactor. Some designs offer the ability to switch the relay COM to a 12V source (I prefer a separate output). Can use it to drive a bigger status LED or even a small fan.

For the terminals, I've never used a spring terminal I didn't wish was a screw terminal instead. There just doesn't seem to be a situation where they are better.


Are you using one of those little white Din-rail RPi cases by phoenix contact?


0 Likes 0 ·
Rob Duthie avatar image Rob Duthie Vincent Royer commented ·

Why screw connectors for CAN? you should stay with the Victron standard of RJ45. It eliminates user headaches figuring out their own can cables. Also, when you connect it to Victron equipment, you will have to cut an RJ45, leaving you with tiny 26AWG wires which won't reliably connect to your screw terminals.Use RJ45! I use boot laces with no problems There are other applications for other lithium BMS battery connections that don't use RG45 connectors i will consider it. Have to consider BYD and Pylontech and other manufactures as well plus the other DIY user of Tesla and Nissan leaf batteries etc.

For Ve-direct maybe the best way is to implement direct serial input, its 5V ttl iirc, so you'll have to level shift it. But I wouldn't omit it entirely from your design. : Done, levels shifted and isolated. Needs to be tested i am using pins 8,10 on the the raspi GPIO which are the UART.

For the 12V out, you don't need a lot of current, 1A is fine, but something with built in flyback so we can hook it up to a bigger contactor. Some designs offer the ability to switch the relay COM to a 12V source (I prefer a separate output). Can use it to drive a bigger status LED or even a small fan. Done easy to add just more cost and will have to use a larger PCB and Din rail enclosure.

For the terminals, I've never used a spring terminal I didn't wish was a screw terminal instead. There just doesn't seem to be a situation where they are better. Had no issue to date with spring terminals, they are used only on the Analog and digital inputs, due to space constraints etc.


Are you using one of those little white Din-rail RPi cases by phoenix contact?

No, too expensive i am using a Chinese version with a tinted grey clear top Note: With the changes required the design of the PCB has blown out. So will have to upgrade the enclosure to the next size up. 150x90mm.

Regards

Rob D

NZ


0 Likes 0 ·
gc50 avatar image gc50 Rob Duthie commented ·

Hi Rob

Where can I get one of these boards

I am in Motueka NZ

Been looking for a canbus port for the Venus RPI

Which has been running on VRM for 7 years now

Want to connect my 150/70 Ve.Can MPPT

Cheers

Gil



0 Likes 0 ·
ofernander avatar image ofernander Rob Duthie commented ·

Did this ever get produced or finalized? I'd love to buy one or obtain the files so I can have a few made for myself.

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie ofernander commented ·

Hi

Send me email address raduthie@gmail.com

0 Likes 0 ·
nebulight avatar image nebulight commented ·

Awesome! Sign me up!

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie commented ·

Hi All

Note: Updated Schematic file with all the extras included.

VE direct port x1

Can bus port x1

LED relay indicators x4

Extra 12 V independent PSU for use with relay outputs if required.


Regards
Rob D

NZVictron Raspi Hat.pdf

0 Likes 0 ·
nzmikec avatar image nzmikec Rob Duthie commented ·

Looks awesome! Im keen to build one of these up. @Rob Duthie have you had PCB's built? Do you plan on selling a kit or sharing the greber files? JLBPCB have a build service ive used in the past, not sure if they will have the chips in your design tho.

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie nzmikec commented ·

Hi

Yes i will be sharing, and selling the main PCB and din rail mounted enclosure all the parts are common nothing odd ball.

Just finalization of the PCB design.

I use Altium for PCB work, so i work in pcbdoc file format.


Regards

Rob D

NZ

1 Like 1 ·
Rob Duthie avatar image Rob Duthie commented ·

Hi

Updated schematic due small change in on of the spi ports select port CS1 not being assigned to the correct device.

Victron Raspi Hat.pdf

Regards

Rob D

NZ

0 Likes 0 ·
victron-raspi-hat.pdf (947.3 KiB)
laurenceh avatar image laurenceh Rob Duthie commented ·

Rob
do you know the answer to my separate thread about getting dbus-adc directory for the Rpi I have a card with the chip on ( and driver I think) but need this directory to get Venus os to recognise it.

Thanks

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie laurenceh commented ·

Hi Laurence

Have you installed the updated file dbus-adc into /opt/victronenergy folder

Then runs these commands to activate, this is all that is required to make the ADC to work.

install dbus-adc file into /opt/victronenergy/ // (install via Bitvise the file ( dbus-adc )
chmod 755 /opt/victronenergy/dbus-adc/start-adc.sh
chmod 755 /opt/victronenergy/dbus-adc/dbus-adc
chmod 755 /opt/victronenergy/dbus-adc/service/run
chmod 755 /opt/victronenergy/dbus-adc/log/run (need to add a folder called log and a file called run inside it) if missing?
touch /var/log/dbus-adc (sets time stamp of the file or created one)
ln -s /opt/victronenergy/dbus-adc/service /service/dbus-adc


Regards

Rob D

NZ

0 Likes 0 ·
laurenceh avatar image laurenceh Rob Duthie commented ·

Rob

I know I need to do these things what is puzzling me is where to find the dbus-adc files required, so explicitly :

What do I download from where?
if they are part of larger image how do I extract the files required?

Thanks

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie laurenceh commented ·

Hi

You have the mcp3208-overlay.dtb installed in the over lays folder file?

https://github.com/aaronsb/victronvenussupport/blob/master/mcp3208-overlay.dtb


The file ADC dbus file wont upload to this site, can be found here.

https://www.dropbox.com/sh/gd80g2u048ls0h3/AAAeY2HSD05qb1W3CkBS64dva?dl=0


0 Likes 0 ·
laurenceh avatar image laurenceh Rob Duthie commented ·

Excellent and thanks.

I’m out today should be able to try tonight.

0 Likes 0 ·
laurenceh avatar image laurenceh laurenceh commented ·

Rob

all installed and worked fine need to:

1) do some hardware tests tomorrow

2) contact my tank sender supplier about feasibility of using voltages from the senders I am currently using as inputs

3) learning how to edit the pages screens.

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie laurenceh commented ·

Hi

That,s good to hear.

The tank senders are resistive loads not voltage output as such.

The tank senders are 0-180 ohms or 240-30 ohms.

The page screens can be set from the tank setup menu to be as fuel, oil water, sewage etc.


Regards

Rob D

NZ

0 Likes 0 ·
rvoosterhout avatar image rvoosterhout Rob Duthie commented ·

I have another question about this. I uploaded the dbus-adc folder using Bitvise and ran the commands.

I have a question about the following command:

chmod 755 /opt/victronenergy/dbus-adc/log/run                         
(need to add a folder called log and a file called run inside it) if 
missing?

I noticed that the dbus-adc folder in drobox, has the log folder and run file inside the /dbus-adc/service folder. Do I still need to copy the log folder to the dbus-adc folder so that the command above actually works? Or do I need to change the command to:

chmod 755 /opt/victronenergy/dbus-adc/service/log/run

My 2nd question is that I also uploaded the mcp3208-overlay.dtb file to the /u-boot/overlays folder, do I need to change anything there or is that all I need to do?

Question #3, do I need to change anything to the config.txt inside the /u-boot folder?

0 Likes 0 ·
rvoosterhout avatar image rvoosterhout rvoosterhout commented ·

Figured it out already. I needed to add the following line to my config.txt

dtoverlay=mcp3208:spi0-0-present

Now my fuelsensor shows up. The only thing is that when my sensor is completely full, it shows disconected. Could I change the ohm values somewhere? I measured my sensor and it has 2oHm when empty and 177 when full, so not exactly 0 - 180 ohm.

0 Likes 0 ·
Mark avatar image Mark rvoosterhout commented ·

Hi mate, depending what build/firmware your running you can adjust it in the tank setup page just select custom and add your values

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie Mark commented ·

Hi

I will work only in the latest Ver in later sesries 2.60.xx, 2.60.23 works perfectly

The 2.54 ver will not work being taken out again.

0 Likes 0 ·
fgs-pantera avatar image fgs-pantera Rob Duthie commented ·

Hi @Rob Duthie , followed your link to download dbus-adc files but seems the link is not longer valid.

"The file ADC dbus file wont upload to this site, can be found here.

https://www.dropbox.com/sh/gd80g2u048ls0h3/AAAeY2HSD05qb1W3CkBS64dva?dl=0 "

Could you help me access those?


Thanks!

0 Likes 0 ·
mihair avatar image mihair commented ·

Hi Rob,


May I suggest not using SI8422 plus MCP2551? They are not so reliable parts in ICS environment. Instead please use ISO1050 from TI

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie mihair commented ·

Hi

The ICS stands for industry control systems? more robust device.

What is wrong with the MCP2551 device? this is what i have used and have no problems to date connecting to a Pylon tech BMS systems etc.

So you saying to use just the one combined chip with isolation and canbus, which would make sense and one less part to wire up etc.

OK i will take your advise, re do the schematics and PCB, and up load later.


Regards

Rob D

NZ

0 Likes 0 ·
mihair avatar image mihair Rob Duthie commented ·

Nothing's wrong with MCP2551 itself but your implementation has the can converter as last device on the bus, after the isolator. In case of voltage spikes it could be easily damaged or communication perturbed


From the ISO1050 doc:

"

As a CAN transceiver, the device provides differential

transmit capability to the bus and differential receive

capability to a CAN controller at signaling rates up to

1 megabit per second (Mbps). The device is designed

for operation in especially harsh environments, and it

features cross-wire, overvoltage and loss of ground

protection from –27 V to 40 V and overtemperature

shutdown, as well as –12-V to 12-V common-mode

range

"

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie mihair commented ·

Hi

Yes taken note on this now, thanks.

0 Likes 0 ·
pau1phi11ips avatar image pau1phi11ips commented ·

Sounds awesome, gonna be better than the CC GX at this rate!

0 Likes 0 ·
rvoosterhout avatar image rvoosterhout commented ·

Hi Rob,

This looks amazing! Do you have any updates on the Stetson? I would love to use this, but I have no experience with PCB ordering.


Rick

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie rvoosterhout commented ·

Hi Rick

Nealy done just a couple more ground planes to do, then i will post the PCB file for open source here.

Regards

Rob D

NZ

0 Likes 0 ·
Mark avatar image Mark Rob Duthie commented ·

Hi Rob

Cant wait.

0 Likes 0 ·
nebulight avatar image nebulight Rob Duthie commented ·

Awesome news!

0 Likes 0 ·
rvoosterhout avatar image rvoosterhout rvoosterhout commented ·

Awesome Rob, i'm looking forward to it!

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie rvoosterhout commented ·

Hi All

Just an update on the stetson, we could have up to 6 output relays if required (Mark UK) has tested it to 8 but some GPIO clashed with the canbus control, but i need to confirm as i am running out of space to to fit them all, unless i upgrade the PCB design and case i had in mind to use, as the case was a din rail mount type with a cover 150x90x45 etc.

As per photo attached.

OK updated PCB and Schematic to have 2x extra relays they are named Aux 1 & 2 as they control a 12v external relay coil only, due space constants etc. They have a indicator LED each and an output current of 500mA max.

Confirmed we have 6x relay outputs all working OK now. An you can name as required via WinSCP. If some one wants the files just email me and i will send the required files to make the 6 relays work, just a matter of copy and paste into the Venus folders.


Victron Raspi Stetson.pdfVictron Raspi Hat.pdf

0 Likes 0 ·
captain-nemo avatar image captain-nemo commented ·

Very nice initiative! I assume te RPI is powered via the Stetson board, I know on RPI there is a fuse to protect against overvoltage etc. located at the micro USB connector on the RPI, powering over the RPI header bypasses this fuse. Would this be useful to add a fuse on the stetson on the 5v pin that powers the RPI?

Oh, and what about gps? Is it possible to add another hat fo GPS or would USB GPS be the only option?

Cheers,

Menno

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie captain-nemo commented ·

Hi Captain Nemo

Thanks for the feed back, looking at extra power protection etc. I do have over voltage protection built in, and a USB port which can be feed to the raspi directly etc. As the unit has dc to dc power regulators converters, external fusing is required as like the CCGX units have done.

Also there is a 12v 1amp feed output for the external relays coils etc.

The GPS works already by plugging in a USB GPS receiver type # BU-353S4 and these work very well with no issues to date.

Updated files below.


Regards

Rob D

NZ

Victron Raspi Hat.pdfVictron Raspi Stetson.pdf

0 Likes 0 ·
captain-nemo avatar image captain-nemo Rob Duthie commented ·

Hi rob,

Thanks for the feedback!
what would be the next step to make this board? Is it ready to use or does it need more testing? If it needs testing, can I help? For pcb making a gerber file would do, but soldering Smd it not my strongest suit. I know some local pcb companies that I used for making pcb’s for my company. Silk screen etc are also needed in this case.

Please advice on what I can do.

Br

Menno

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie captain-nemo commented ·

Hi

The PCB you can make your self if required once i release the Gerber files etc.

Hand soldering will be slow and time consuming etc. The PCB will have all the silk screens in place etc.

So just going threw final checks and BOM etc now.

Regards

Rob D

NZ

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie commented ·

Hi

Their have being some changes we have now 6x relay outputs and added a USB port for power only. And a 12v external supply for relay coils to use.

Victron Raspi Stetson.pdfVictron Raspi Hat.pdf

0 Likes 0 ·
captain-nemo avatar image captain-nemo Rob Duthie commented ·

Looks ok to me, don't see any issues.

0 Likes 0 ·
dennis-brok avatar image dennis-brok Rob Duthie commented ·

all i need is the parts list and the gerber file and ill test this

ig you sell a kit anywhere send me the link and ill order it

thanks for youre input and work in making this

i have the victron bmv 712 the 100/30 mppt smartsolar the 12/12-30 amp dc to dc charger and a raspberry pi3 b+ with the 7 inch touch screen running venus i want to add 2 tank (drinking and grey water) with temperature and lvl and a remote start for my generator maybe a extra temp sensor and then look at what more i can add on


thanks again

dennis

0 Likes 0 ·
dennis-brok avatar image dennis-brok Rob Duthie commented ·

will we be able to buy a kit for this somewhere ?


0 Likes 0 ·
Rob Duthie avatar image Rob Duthie dennis-brok commented ·

Hi

I can supply the basic PCB ready to mount in a basic case the files will be open sorce so you can get them made your self

0 Likes 0 ·
dennis-brok avatar image dennis-brok Rob Duthie commented ·

so just to be clear

this will add 6 output relais

2 temp inputs

3 tank inputs

2x Digital Hi ports all isolated with pulse counting

3x Digital Low ports all isolated with pulse counting

1x canbus portand

and a psu input


this sounds amazing if this would work with the rapberry pi3 running victron venus

cant wait to build or get one


but where to get it


greetings


dennis (holland)


0 Likes 0 ·
Rob Duthie avatar image Rob Duthie dennis-brok commented ·

Hi

Yes correct. it has being tested up to 8 relays but it was taking away some of the comms ports so i have not persuaded that idea.

0 Likes 0 ·
dennis-brok avatar image dennis-brok Rob Duthie commented ·

give me a price and a parts list and i will order some from you

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie dennis-brok commented ·

Hi Dennis

I am doing the BOM now and checking the Gerber and PBC.DOC files for Alitium now.

Then i will submit them here.


Victron Raspi Hat.pdf

Victron Raspi Stetson.pdf

Victron Raspi Hat BOM - Copy.xls.pdf rename to .xls to open the BOM


This file is the PCB file down load it and rename to PcbDoc as used by Altium to open it in Alitium designer.

Victron Raspi Stetson - .pdf

If you want the gerber files send me your email for the files.


Victron Raspi Stetson PcbDoc .pdf

I will sent up drop link for the files.

I done a design rule check and it has passed ok, i will update the BOM with more details later with all the component type required.

Regards

Rob D

NZ

0 Likes 0 ·
jack2006 avatar image jack2006 Rob Duthie commented ·

Hi Rob,

Brilliant project! just what I was looking for. Couple of questions would it be possible for you to email me the Altium files, I am still using the old Protel 99se here in the UK, don't know if you can export for backward compatibility? email is:- jturner@haiden.co.uk.

Also amonst the other Victron equipment I intend to use this with I have a 24V/25A charger that I can only communicate with using the Victron Mk2 interface to the chargers RJ45 VeBus. Wondered if you had any info on the coms, voltages etc for that so perhaps I could integrate into your design?

Thanks,

John

0 Likes 0 ·
hermes avatar image hermes Rob Duthie commented ·

Hi, please is it still possible to download the gerber file? My email is hermes127social@protonmail.com

Thank you so much

Best Regards

0 Likes 0 ·
hector avatar image hector Rob Duthie commented ·

Hello rob!

Thank you so much for your work !! It looks very well executed.

I am trying to connect an MCP and a couple of sensors to the raspberry and this is just what I was looking for. I have no problems with pcb production or smd mounting.

Could you send me the files to produce the pcb?

Thank you very much again for your time.

0 Likes 0 ·
Rob Duthie avatar image Rob Duthie hector commented ·

Hi

Need email address to send files to.

0 Likes 0 ·
hector avatar image hector Rob Duthie commented ·
0 Likes 0 ·
Fraser Stewart avatar image Fraser Stewart Rob Duthie commented ·

Hi rob.

Let me start by saying thankyou for doing this. Im busy building for my setup on a ship.

And working with friend who teaches electronics workshop and is a software engineer. He is making it for his camper. Together we would like to use your board for part of the workshop. Can you please send me the files.


Fraseramsterdam at gmail.com

All the best


0 Likes 0 ·
jambomiller avatar image jambomiller Rob Duthie commented ·

Hi Rob,

Can you please send the files to jambomiller01@gmail.com ?


Thanks,

K.

0 Likes 0 ·
s-exley avatar image s-exley Rob Duthie commented ·

Hi Rob,
Any chance you could send me the gerber files too, s.exley@qub.ac.uk
Thanks
Simon

0 Likes 0 ·
jayy169 avatar image jayy169 Rob Duthie commented ·

Hi


Is it possible to get the gerber files sent over to joel@smarterconsulting.wales

Thanks!

0 Likes 0 ·
sprollonis avatar image sprollonis jayy169 commented ·

Hi,
would it be possible to share your Gerber-Files with me - cece1@web.de
Thanks

Sprollonis

0 Likes 0 ·
Show more comments

Article

Contributors

Robduthie contributed to this article

Related Articles