Jump to content

Two shunts in series


rusty69

Featured Posts

1 minute ago, Tony Brooks said:

 

But if Nick is right, he usually is, and it is simple to tap and decode the Smartshunt output on the Pi then his way is best. I have some reservations about the decoding simplicty though.

I quite agree, if it was a semi permanant install that's exactly how I'd do it.

Link to comment
Share on other sites

24 minutes ago, nicknorman said:

Either that or break one end of the VE.direct cable ground.

Could you expand on that a bit please? Is it simply a case of removing the gnd connectio on the VE cable going from the smart shunt to the Pi?

Link to comment
Share on other sites

13 minutes ago, Tony Brooks said:

 

But if Nick is right, he usually is, and it is simple to tap and decode the Smartshunt output on the Pi then his way is best. I have some reservations about the decoding simplicty though.

Although I have not actually used it myself, as I understand it the Venus OS is a Victron thing that is used in their products such as Cerbo GX etc. So it should be fairly trivial to tell it that the VE.Direct connections are via these 2 pins on the Pi, and after that it will have the built in code to decode the parameter information

9 minutes ago, rusty69 said:

Could you expand on that a bit please? Is it simply a case of removing the gnd connectio on the VE cable going from the smart shunt to the Pi?

Yes. Just snip the wire.

16 minutes ago, Tony Brooks said:

 

No, I don't think I do misunderstand, unless you are claiming that you can not access the two large (battery) connections on a Smartshunt. If Rusty 69 knows which pin provides the Smartshunt digital output and knows what is needed to decode it on the Pi then I fully agree that that would be the easiest and probably more accurate way, but if he does not then, as he says, things get more difficult for those not fully conversant with electronic and digital practices.

There is a standard VE.Direct port on the Smartshunt. This just has 0v, 3.3v, Tx and Rx. I would be fairly sure that you can get a cable with the VE.direct plug on one end brought out to bare wires at the other end to connect to the Pi. Skipping the 0v wire and the 3.3v wire!

 

Incidentally, the 3.3v wire is useful to power an optoisolator for the Rx line because it ensures the correct voltage. That is one trouble with TTL level rs232, the TTL level might be 3.3v or 5v! So if the recipient sends the appropriate voltage, all is well in Rx land!

 

Edited by nicknorman
Link to comment
Share on other sites

5 minutes ago, nicknorman said:

There is a standard VE.Direct port on the Smartshunt. This just has 0v, 3.3v, Tx and Rx. I would be fairly sure that you can get a cable with the VE.direct plug on one end brought out to bare wires at the other end to connect to the Pi. Skipping the 0v cable!

Yes, that is what I had to do to connect the Pi to the MPPT. I assume I would do the same with the shunt (minus the gnd connection).

Link to comment
Share on other sites

4 hours ago, rusty69 said:

 

I don't think the shunt i currently have is smart enough to connect to anything, though I will have a look.

 

 

The shunt of itself is not smart.  It's nobbut a low resistance  across which to measure a voltage.  But perhaps yours has some electronics attached to it?

Link to comment
Share on other sites

Acksherly Tony Brooks had already made the point with an explanation of what to do if it has a box of 'tronics on the end.

 

N

Link to comment
Share on other sites

  • 4 weeks later...

I'm getting a bit out of my depth here. I installed my new smart shunt today, in series with the old one. I have a raspberry pi connected to a victron MPPT with a home assembled cable,with the red wire removed consisting of :


USB To RS232 TTL UART PL2303HX Converter USB to COM Module Serial Cable Adapter
s-l1600.jpg.be9899c95af8b993e0c64fa44e316810.jpg


and


ADA 3955 JST PH 4-PIN TO MALE HEADER CABLE

s-l500.jpg.11c221381f41bd292a1ca9e0d56f7934.jpg


I believe the connection is non isolated and I should instead have an isolated connection using opto isolators or some kind of 


Isolated 4 port USB to TTL UART FTDI (with the red wire connected)

hh.thumb.jpg.90e5e29b7540384f70d47930e0edc7f0.jpg

 

 

I need to connect the smart shunt to the pi with a similar homemade cable as I'm far too mean to pay for the victron cable(s).


Can anyone advise please, preferably with words of less than two syllables what I need to do and buy? I know Nick said to just remove the GND wire but I may not have explained that I had made up the cable.

 

I'm beginning to wish i'd stayed with LA batteries.

Link to comment
Share on other sites

1 hour ago, rusty69 said:

I'm getting a bit out of my depth here. I installed my new smart shunt today, in series with the old one. I have a raspberry pi connected to a victron MPPT with a home assembled cable,with the red wire removed consisting of :


USB To RS232 TTL UART PL2303HX Converter USB to COM Module Serial Cable Adapter
s-l1600.jpg.be9899c95af8b993e0c64fa44e316810.jpg


and


ADA 3955 JST PH 4-PIN TO MALE HEADER CABLE

s-l500.jpg.11c221381f41bd292a1ca9e0d56f7934.jpg


I believe the connection is non isolated and I should instead have an isolated connection using opto isolators or some kind of 


Isolated 4 port USB to TTL UART FTDI (with the red wire connected)

hh.thumb.jpg.90e5e29b7540384f70d47930e0edc7f0.jpg

 

 

I need to connect the smart shunt to the pi with a similar homemade cable as I'm far too mean to pay for the victron cable(s).


Can anyone advise please, preferably with words of less than two syllables what I need to do and buy? I know Nick said to just remove the GND wire but I may not have explained that I had made up the cable.

 

I'm beginning to wish i'd stayed with LA batteries.


I am not familiar with the Venus OS but I would be surprised if it couldn’t access the built in UART on the Pi. So I would connect the JST header cables directly to the Pi UART pins, rather than going via USB. You just need to connect the Tx and Rx from the JST (middle 2 wires IIRC) to the GPIO pins on the Pi that can also be UART, ie pins 8 (GPIO 14) and 10 (GPIO 15).  8 is  Tx and 10 is Rx. Remember that you need to connect Rx on the Smartshunt to Tx on the Pi and vice versa.

Link to comment
Share on other sites

5 hours ago, nicknorman said:


I am not familiar with the Venus OS but I would be surprised if it couldn’t access the built in UART on the Pi. So I would connect the JST header cables directly to the Pi UART pins, rather than going via USB. You just need to connect the Tx and Rx from the JST (middle 2 wires IIRC) to the GPIO pins on the Pi that can also be UART, ie pins 8 (GPIO 14) and 10 (GPIO 15).  8 is  Tx and 10 is Rx. Remember that you need to connect Rx on the Smartshunt to Tx on the Pi and vice versa.

Standby for more questions. 

 

1. I assume that as I have 2 devices I will need to locate 2 sets of UART pins on the Pi GPIO? I think it's a raspberry pi 3, which possibly limits me to two .

 

2.That I will need to modify a. Txt file on the SD card to enable the pins. 

 

3. If I do this instead of connecting by USB, will the cables then be opto isolated, alleviating any ground loop problems previously discussed, or do I have to add in the opto isolators and additional circuitry separately? 

 

4.What the hell are opto isolators anyway, why do I need them and where do I get some? 

 

5. If I am limited to two UARTS, that I can't add further devices without upgrading to a pi4, which I think has 6 (maybe 5 usable) UARTS.Or use a USB device as above. 

 

6. Why the hell am I awake at 4am and not asleep? 

 

7. Reserved for future silly questions. 

 

8.Reserved for future silly questions.

 

9.Reserved for future silly questions.

 

10. I think I going to paint the boat today instead, it's much easier to understand. 

 

Thanks Nick, as you can see, I'm well out of my depth. 

Edited by rusty69
Add a bit
Link to comment
Share on other sites

5 hours ago, rusty69 said:

Standby for more questions. 

 

1. I assume that as I have 2 devices I will need to locate 2 sets of UART pins on the Pi GPIO? I think it's a raspberry pi 3, which possibly limits me to two .

 

2.That I will need to modify a. Txt file on the SD card to enable the pins. 

 

3. If I do this instead of connecting by USB, will the cables then be opto isolated, alleviating any ground loop problems previously discussed, or do I have to add in the opto isolators and additional circuitry separately? 

 

4.What the hell are opto isolators anyway, why do I need them and where do I get some? 

 

5. If I am limited to two UARTS, that I can't add further devices without upgrading to a pi4, which I think has 6 (maybe 5 usable) UARTS.Or use a USB device as above. 

 

6. Why the hell am I awake at 4am and not asleep? 

 

7. Reserved for future silly questions. 

 

8.Reserved for future silly questions.

 

9.Reserved for future silly questions.

 

10. I think I going to paint the boat today instead, it's much easier to understand. 

 

Thanks Nick, as you can see, I'm well out of my depth. 


Bear in mind I am not that familiar with Pis or Venus OS…

1/  You could connect a device either by USB or direct to the GPIO pins set to be UARTs. Or both. What I am not clear about is whether the OS uses a hardware UART to operate a USB serial device such as the PL2303 or whether it’s done in software. But anyway, if you have 2 devices and 2 UARTS you are sorted.

 

2/ I have zero experience of Venus OS but I would have thought there would be some configuration / setup interface that allows you to configure elements of the Pi via some user friendly interface.

 

3/ No, USB to serial does not normally include optoisolation.

 

4/ An optoisolator consists of a led and a phototransistor. The led flashes on and off, this light is picked up by the phototransistor which turns on and off. But there is no electrical connection so the two sides can be at completely different voltages. You need one for each direction - Tx and Rx.

 

IMO you don’t need them because the difference in the nominal ground voltages will be a maximum of around 50 mV. So by simply disconnecting the ground lead you avoid current flowing in that circuit. The effect of 50mV on the data signal of 0v or 3.3v will be nothing.

 

5/ Probably. Depends on whether the USB driver software invokes a UART.

 

6/ try singing lullabys to yourself.

Edited by nicknorman
Link to comment
Share on other sites

10 minutes ago, nicknorman said:


Bear in mind I am not that familiar with Pis or Venus OS…

1/  You could connect a device either by USB or direct to the GPIO pins set to be UARTs. Or both. What I am not clear about is whether the OS uses a hardware UART to operate a USB serial device such as the PL2303 or whether it’s done in software. But anyway, if you have 2 devices and 2 UARTS you are sorted.

 

2/ I have zero experience of Venus OS but I would have thought there would be some configuration / setup interface that allows you to configure elements of the Pi via some user friendly interface.

 

3/ No, USB to serial does not normally include optoisolation.

 

4/ An optoisolator consists of a led and a phototransistor. The led flashes on and off, this light is picked up by the phototransistor which turns on and off. But there is no electrical connection so the two sides can be at completely different voltages. You need one for each direction - Tx and Rx.

 

IMO you don’t need them because the difference in the nominal ground voltages will be a maximum of around 50 mV. So by simply disconnecting the ground lead you avoid current flowing in that circuit. The effect of 50mV on the data signal of 0v or 3.3v will be nothing.

 

5/ Probably. Depends on whether the USB driver software invokes a UART.

 

6/ try singing lullabys to yourself.

 

Thanks very much.

 

 

Link to comment
Share on other sites

I’ve just done a bit of research, I seems that the GPIO UART is used for the console io and so your best bet would be to use another USB to TTL serial PL2303 and VE.Direct cable thingies. Just avoid connecting the ground wire at the VE.Direct port end.

Edited by nicknorman
Link to comment
Share on other sites

3 minutes ago, nicknorman said:

I’ve just done a bit of research, I seems that the GPIO UART is used for the console io and so your best bet would be to use another USB to serial PL2303 and VE.Direct cable thingies. Just avoid connecting the ground wire at the VE.Direct port end.

Cheers.

 

Just so I am sure. Do I need any of the ground wires connected, or is it just the additional devices that I add that the wire needs to be removed? It will likely amount to more than two by the time I am done, so I will need some kind of USB hub, as I think the Pi only has one.

Link to comment
Share on other sites

28 minutes ago, rusty69 said:

Cheers.

 

Just so I am sure. Do I need any of the ground wires connected, or is it just the additional devices that I add that the wire needs to be removed? It will likely amount to more than two by the time I am done, so I will need some kind of USB hub, as I think the Pi only has one.

I thought the Pi3 had four USB ports. The big problem with USB on raspberry pi is that they can source only a limited current for connected USB devices, so it would depend what else you have plugged in to the USB ports and how much juice they use. If you find yourself overloading them and the pi browning out and glitching, then a hub is the way to go. As with most things pi related, some hubs work, others not so much, so I'd look at what has been found to be compatible before buying.

Opto isolation would be the way to go to be sure you aren't going to have noise, or voltage problems with the serial connections. It would completely redefine the voltage levels on each side, power, ground and the two signal, with hopefully only signal photons jumping the gap. If you are using an opto isolator break out board, I'd trace the PCB ground connections to see if they go from one side to the other, before deciding which ground wires to connect, even look at datasheet for the isolator IC being used. I'd want the uart cables shielded and the shield connected to ground at one end, or the other, but not both. I've not done anything on trying to connect a pi to Victron kit, or used the Venus OS though, so this is me just going from other stuff.

Something like this for a suitable opto-isolator. Two channels, so good for the uart Tx and Rx lines. Doesn't invert the logic from one end to the other and good for 9600 baud. Out of stock at Pimoroni at the moment, but available elsewhere?

Link to comment
Share on other sites

4 hours ago, Jen-in-Wellies said:

I thought the Pi3 had four USB ports. The big problem with USB on raspberry pi is that they can source only a limited current for connected USB devices, so it would depend what else you have plugged in to the USB ports and how much juice they use. If you find yourself overloading them and the pi browning out and glitching, then a hub is the way to go. As with most things pi related, some hubs work, others not so much, so I'd look at what has been found to be compatible before buying.

Opto isolation would be the way to go to be sure you aren't going to have noise, or voltage problems with the serial connections. It would completely redefine the voltage levels on each side, power, ground and the two signal, with hopefully only signal photons jumping the gap. If you are using an opto isolator break out board, I'd trace the PCB ground connections to see if they go from one side to the other, before deciding which ground wires to connect, even look at datasheet for the isolator IC being used. I'd want the uart cables shielded and the shield connected to ground at one end, or the other, but not both. I've not done anything on trying to connect a pi to Victron kit, or used the Venus OS though, so this is me just going from other stuff.

Yes, it is 4. I just checked. Not sure why I thought it was only one.

 

I had been eyeing up this, which talks about being isolated, but I'm far from certain it's what I need.

 

https://www.amazon.co.uk/Waveshare-USB-RS232-485-TTL/dp/B07L2VLY5D

 

 

ETA

 

Or Maybe this:

 

https://www.amazon.co.uk/Waveshare-Industrial-Switchable-Protections-Compatible/dp/B0BRN9QNY2/ref=sr_1_3?

Edited by rusty69
Link to comment
Share on other sites

6 minutes ago, rusty69 said:

I had been eyeing up this, which talks about being isolated, but I'm far from certain it's what I need.

 

https://www.amazon.co.uk/Waveshare-USB-RS232-485-TTL/dp/B07L2VLY5D

Looks like a proper job solution to your problem, at a price. If you want to guarantee you won't see weird issues. One of the reviews says this:

Quote

Amazing that for this price you get true isolation. i.e. avoids problems with ground loops / ground level shifts between devices. I opened the case and looked at the circuit board, it has a DC-DC isolator for the power as well as the expected isolation barrier for the signals. The board had a very clear cut-out / clearance trench where the isolation is from the USB side over to the serial connector side. (the serial connectors RS-232/RS-485 are not isolated from each other, but that is fine since it is only intended to use one of those at a time. The point is that this is a USB host to serial adaptor, so the USB/PC is isolated.)
Besides that, the FTDI USB/serial port chipset is pretty easy to install in Windows (Microsoft recognizes and automatically downloads driver.) So far all 3 interfaces (RS-232, RS-485, TTL, all worked well for me.) I expect to use TTL for devices like Raspberry Pi that doesn't bother with transceivers.

 

  • Greenie 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.