I fried a Raspberry Pis and I have no idea why. Please help me understand.

dl324

Joined Mar 30, 2015
16,897
The purpose of the transistor is to allow a low (ground) signal into the Raspberry Pi pin when the switch in the diagram closes the circuit.
You have the base grounded, so the transistor can only be turned on with a negative voltage on the emitter. You didn't label the pin the emitter is connected to, but it still can't work because the Pi can't generate a negative voltage on any output (and then there wouldn't be an input to the Pi).
1581872395257.png
 

BobaMosfet

Joined Jul 1, 2009
2,112
My apologies for the drawing! I'm sure there are much better ways to show a circuit but I'm not familiar with any them.

By fried I meant the Raspberry Pi is no longer working (nothing appears on the screen when I connect it to a monitor and it gets very hot very quickly). There was no smoke.

Regarding the pin numbers on the 5 VDC relay, I just put them there to show which pins connect when the relay is active and not active. The sig pin is the signal pin, what I use to activate or deactivate the relay.
What documentation comes with your buck/boost converters? Does it require you to set a dipswitch or something so that it knows what input power is? (AC or DC)?
 

Thread Starter

carlosc

Joined Feb 2, 2018
24
What documentation comes with your buck/boost converters? Does it require you to set a dipswitch or something so that it knows what input power is? (AC or DC)?
No documentation. The input is AC, the output is DC and there is a potentiometer you use to regular what you want the DC output to be.
 

Thread Starter

carlosc

Joined Feb 2, 2018
24
You have the base grounded, so the transistor can only be turned on with a negative voltage on the emitter. You didn't label the pin the emitter is connected to, but it still can't work because the Pi can't generate a negative voltage on any output (and then there wouldn't be an input to the Pi).
View attachment 199223
The base is grounded and when the voltage in the collector is higher than in the base, the transistor allows current to flow, meaning the emitter is now ground. That translates to a "low" in the GPIO pin which I can detect with if GPIO.input(18) == GPIO.LOW: do something... (where 18 is the BCM pin number).
 

dl324

Joined Mar 30, 2015
16,897
The base is grounded and when the voltage in the collector is higher than in the base, the transistor allows current to flow, meaning the emitter is now ground.
That isn't how a transistor works. The CB junction is reverse biased; it can never become forward biased because the transistor can't turn on.

To turn on a transistor, you need to forward bias the BE junction. If you operate in saturation mode, the CB junction will become forward biased. But the BE junction always needs to be forward biased to turn it on; unless you operate in inverted mode which isn't done very often because you don't have much current gain.
 

Thread Starter

carlosc

Joined Feb 2, 2018
24
One more thing I discovered...

Because of how things are wired, it will be the case that the ground wire coming out of the DC side of the bottom buck converter will be connected to the DC ground of the top buck converter (which is always on) and the one of the wires on the AC side of the bottom buck converter will be connected to what I am considering the AC neutral wire and this makes the bottom buck converter stay on, as if the AC voltage is somehow inducing current and making the buck converter output DC voltage. I measured the AC voltage going into the buck converter when it was supposed to be off and I got around 3.5 volts AC. I tried adding a resistor between the DC ground of the bottom buck converter and the DC ground out of the top converter and that made things work as expected. I am not an electrical engineer so if anyone can shed some light on why this would happen that would be awesome.

Thanks!
 
Please refer to the picture attached.

When the switch closes the circuit, the buck converter at the bottom of the image turns on (as expected) and the code I have running in the Raspberry Pi detects a low signal going into the Raspberry Pi pin the transistor's emitter is connected to (also as expected). Now here's where things get really confusing for me...

When the switch opens the circuit, I expect the buck converter at the bottom of the image to turn off, but it doesn't! Can someone explain why?

To try to figure things out, I disconnected both wires going into the Raspberry Pi and then reconnected the wire going from the transistor's emitter back into the pin it was connected to in the Raspberry Pi. The screen went dark and now the Raspberry Pi seems to be fried. I have zero clue why this happened!

Here's what I am trying to do: When the switch closes the circuit, I want the buck converter at the bottom of the image to turn on so I can detect that the circuit was closed in the Raspberry Pi code. When the switch opens the circuit, I want the buck converter to turn off so I can detect that the circuit is open in the Raspberry Pi code.

I didn't have anything connected to the 24 VAC relay and I did not a signal wire connected to the 5 VDC relay when this happened (those components are in the image just so you guys can see the whole thing as I have it).

Any help here is greatly appreciated. I am going nuts trying to understand this and can't :-(
First of all, a Raspberry Pi can stop working without any obvious reason. My first one stopped working over night when I had it running some servers 24/7, nothing connected to any GPIO pins just the ethernet cable to communicate with the Raspberry Pi from my main computer so there was no reason for it to stop working but it died one night never to wake up again.
I did go to the store where I bought it and after they checked it I got my money fully payed back, I bought the newest version immediately because I didn't want to wait on an answer what happened to the old one because I knew it wasn't my fault.

Another thing is that the new Raspberry Pi bricked one of my USB drives and made it read-only which I couldn't get formatted with any recommended software, my Windows 10 PC didn't recognize it anymore and I've tried every possible way to regain access to the partition but nothing worked so I had to give up and get a new one.

Just that you know that in some rare cases things can happen that break your Raspberry Pi without you even near it or actively using it at the time it stops working all together.

  1. However in your case I think you made a couple fatal mistakes, if you really connected everything as you pointed out according to your drawing you are working with a too high voltage on the GPIO pins, Raspberry Pi isn't 5 volt tolerant and as far as I can see there was a higher than 3.3 volt signal going into the GPIO pin.
  2. Another reason that could have fried your Raspberry Pi is that you switched the relay directly from the GPIO pins which will generate a very high voltage whenever you switch off any kind of inductive load. NEVER ever try to drive any kind of inductive load directly from the GPIO pins, you should have used the ULN2003A chip to interface with the relay to protect your Raspberry Pi.
  3. When you're working with voltages above 3.3 volt you need to use a bi-directional level shifter that will shift the voltage up to 5 volt and shift the voltage down to a safe 3.3 volt so you can communicate between your Raspberry Pi and the external device.
  4. And the last thing that may could have happened is that all devices that are directly connected to your Raspberry Pi GPIO pins must have a common ground, and when you started tinkering with your circuit you didn't turn off your Raspberry Pi and disconnect the power plug or the rest of your circuit causing something to be live at the wrong moment that will blow up your Raspberry Pi.

You can try and see if it's something covered by the warranty and get your money back or get a replacement without costing you anything.

I hope this is helpful to you and I wish you success.

Best regards,
Ricardo Penders
 

BobaMosfet

Joined Jul 1, 2009
2,112
No documentation. The input is AC, the output is DC and there is a potentiometer you use to regular what you want the DC output to be.
The reason I asked was because the seller information says it will take both:

1582050493699.png

How do you tell it which is being input, or is it separate inputs or smart enough to tell which on its own?

Secondly, the 2N2222 is a NPN BJT, which means it only works with a positive voltage on the base relative to the emitter. And you need to learn how to draw a schematic- the below is crap. Don't say you don't know how- learn. We did. Frankly, your mix-matching of AC/DC opens a *lot* of doors about how you can get too much current to too many places in this because you don't know enough.

1582050601512.png

I'm wondering if you even looked at a 2N2222 datasheet, and whether you actually understand BJTs, and what's going on in an A/C environment... You're easily exceeding the current rating for the BJT in at least 2 possibilities, and in either case, your GPIO pin on the Raspberry will get fried.

Start here:

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3
 

Thread Starter

carlosc

Joined Feb 2, 2018
24
The reason I asked was because the seller information says it will take both:

View attachment 199364

How do you tell it which is being input, or is it separate inputs or smart enough to tell which on its own?

Secondly, the 2N2222 is a NPN BJT, which means it only works with a positive voltage on the base relative to the emitter. And you need to learn how to draw a schematic- the below is crap. Don't say you don't know how- learn. We did. Frankly, your mix-matching of AC/DC opens a *lot* of doors about how you can get too much current to too many places in this because you don't know enough.

View attachment 199365

I'm wondering if you even looked at a 2N2222 datasheet, and whether you actually understand BJTs, and what's going on in an A/C environment... You're easily exceeding the current rating for the BJT in at least 2 possibilities, and in either case, your GPIO pin on the Raspberry will get fried.

Start here:

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3
Hey, you made me realize that in addition to my drawing being bad, it also had a mistake. I had labeled the transistor pins wrong. Please see the picture attached. That's how I actually have things wired.

As for the buck converter, it is smart enough to tell if you are feeding it AC or DC. Given the new diagram, do you see anything else wrong and have any suggestions for improvement? I have a few books on electronics and have been slowly going through them. I will look into the book you suggested. Thanks!
 

Attachments

AlbertHall

Joined Jun 4, 2014
12,346
Hey, you made me realize that in addition to my drawing being bad, it also had a mistake. I had labeled the transistor pins wrong. Please see the picture attached. That's how I actually have things wired.
The transistor is still not doing anything useful. The pi could directly monitor the AC/DC converter , with a resistive divider if the pi inputs need less than 5V.
 

dl324

Joined Mar 30, 2015
16,897
Hey, you made me realize that in addition to my drawing being bad, it also had a mistake. I had labeled the transistor pins wrong. Please see the picture attached. That's how I actually have things wired.
clipimage.jpg
What is it that you're trying to do?
 

Thread Starter

carlosc

Joined Feb 2, 2018
24
Putting aside my main problem for a moment, please refer to the picture attached.

When I turn on the 24 VAC power source, the buck converter on the bottom also turns on and outputs 3.3 VDC. This behavior is totally unexpected and I don't understand why it's happening. Can someone explain?
 

Attachments

Thread Starter

carlosc

Joined Feb 2, 2018
24
Continuing the above, please refer to the picture attached.

I added a diode between the negative output of the bottom buck converter and the negative output of the top buck converter and things started working as I expected them to (when the switch closes the circuit the bottom buck converter turns on and when the switch opens the circuit the bottom buck converter turns off). However, I have no idea why! Why is the diode helping?

As for frying the Raspberry Pi, you can see in the picture what I was doing and the amperage that was going to the Raspberry Pi. I added a 1M diode between the positive output of the bottom buck converter and the GPIO pin and the amperage I am getting now is in the milliamp range (~16). To be honest, I have not connected this to my other Raspberry Pi yet because I want to make sure I won't fry it as well.

What do you guys think of this?
 

Attachments

AlbertHall

Joined Jun 4, 2014
12,346
Because the buck converters are not isolated. There is some connection between the input terminals and the output terminals. Probably via the diodes in the input bridge to the negative output terminal. That might also be relevant to why the pi fried.
 
Top