question: single board computer hooked to raspberry pi with usb serial adapter - Page 1
Forum section: electronics / beginners

author: tlovie
author_rank: Contributor
timestamp: June 19, 2022, 01:13:56 am
content: I have a Z80 single board computer that has a 5V switching power supply and a standard serial port (RS-232) that uses MAX232 charge pumps to get the higher voltage for serial communications. I have it connected to a raspberry pi with a USB-serial port adapter. The raspberry pi also has a switching power supply, and both are plugged into the same power bar. I did some investigating, and the USB-serial adapter does not have a connection from the USB ground to the DB-9 connector shield - the resistance is 4-5Mohm. So these 2 devices do not seem to be electrically connected.The Z80 has a reset button, but I wanted to control that with a GPIO output from the raspberry pi, and since the Z80 is 5V and the GPIO of the raspberry is 3.3V, I will need some kind of level shifter. I think that I understand what kind of circuit I will build for that, but my question is that since I wasn't planning on using an Opto-isolator in my circuit, I would need to tie the grounds together.So before I built anything, I decided to hook an ammeter between the ground of the Z80 and the ground of the Raspberry Pi. The current on the ammeter seems to vary from about 5mA to 20mA - just bouncing around. Should I be concerned about this? or would it be acceptable to just tie the grounds together? Why would there be a net current flowing here?Thanks,Tom.

author: Kyle_from_somewhere
author_rank: Regular Contributor
timestamp: June 19, 2022, 02:42:00 am
content: Ground on a 9 pin serial port is usually pin 5

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 19, 2022, 03:11:20 am
content: The RS-232 connector shield is just a protective shield that is typically connected on only one end. The actual ground or 0V is atpin 5.In other words, the RS-232 connector shield is not supposed to be the common ground between the Z80 and your 'Pi; pin 5 on the DE-9 connector is.Because you use different power supplies on the two SBCs (yes, Pi is also an SBC), they might not have a common ground at all.Personally, I'd use a cheap (~ $10) ADuM3170-based USB isolator (at Full Speed or 12 Mbit/s) off eBay or similar between the Pi and the USB-Serial adapter, and either an optoisolator (a logic output optocoupler) or a digital isolator for the reset button (depending on what you have access to).The optoisolator is your best bet, if its LED will ON only when reset is applied (for example, connecting the output of the optoisolator to the gate of a suitable P-channel MOSFET, in parallel with a momentary-ON reset tactile button). You'll only need a suitable current-limiting resistor on the LED side, although you could add a capacitor and a resistor as a low-pass filter to ensure short reset pulses will be ignored.But I'm just a hobbyist dabbling in SBCs myself, not an EE.

author: ledtester
author_rank: Super Contributor
timestamp: June 19, 2022, 03:22:28 am
content: At this point, without doing more analysis of the power supplies involved, the optocoupler is a worry-free solution.Another worry-free solution is to power both systems using the same power supply.

author: tlovie
author_rank: Contributor
timestamp: June 22, 2022, 06:32:40 pm
content: Thanks to all who responded, I've opted for the solution eliminating one of the power supplies and using the same power supply for both. That only involved making a suitable cable that would do the job.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 22, 2022, 07:43:12 pm
content: If you find you need even more current, I like the Meanwell class II (no protective earth; output fully isolated) power supplies.For example, theRPS-45-5 can provide 8A (8000 mA) continuously at 5V, with the 5V line adjustable from 4.75V to 5.5V or so. (I have an Odroid HC-1 SBC, which takes +5 VDC power, and has a SATA connector for old spinny-disk HDD drives. Peak current draw can reach 6A at spin-up, and I like to add some USB stuff like a microcontroller and a display.)There are also DIN rail ones, likeHDR-30-5 andHDR-60-5, that can be easier to incorporate into a project box. I've looked at these for my Odroid HC-1 server project box, but haven't used one yet.