I've created a circuit where a GPIO output of a microcontroller (PIC12F683) is used to turn on/off a darlington transistor (ULN2803A) which in turn turns on/off a power relay. I do not want to use two separate power supplies and the voltage requirements are the same so power to ICs and load is coming from the same source.
When I have a load connected to the power relay (a Raspberry PI and powered USB hub), the microcontroller seems to be immediately resetting when the relay is turned on. My theory is that the initial power draw from the Raspberry PI and powered USB hub causes a temporary voltage drop and a reset of the microcontroller.
The microcontroller only resets when I have a load attached to the relay. Switching on the relay without a load attached works fine.
I'm using a 5V power supply rated for 5 amps. I think 5 amps should be plenty for normal running conditions, but maybe the initial power draw of the relay, Raspberry Pi, and USB hub is too much.
Without adding a separate power source for the Raspberry Pi and USB hub, I'm thinking I might be able to add a capacity to eliminate the voltage drop to the ICs. I'm not sure if this would work though, where to put the capacitor, or what size capacitor to use. If I add a capacitor, I'm also wondering if I should add a diode to prevent the capacitor from being drained by power draw from the relay, Raspberry Pi and USB hub.
Here's a picture of my circuit diagram: https://www.dropbox.com/s/zs3ydg33k7aitx7/0524151144.jpg?dl=0
Any ideas or suggestions would be appreciated. Thanks!
When I have a load connected to the power relay (a Raspberry PI and powered USB hub), the microcontroller seems to be immediately resetting when the relay is turned on. My theory is that the initial power draw from the Raspberry PI and powered USB hub causes a temporary voltage drop and a reset of the microcontroller.
The microcontroller only resets when I have a load attached to the relay. Switching on the relay without a load attached works fine.
I'm using a 5V power supply rated for 5 amps. I think 5 amps should be plenty for normal running conditions, but maybe the initial power draw of the relay, Raspberry Pi, and USB hub is too much.
Without adding a separate power source for the Raspberry Pi and USB hub, I'm thinking I might be able to add a capacity to eliminate the voltage drop to the ICs. I'm not sure if this would work though, where to put the capacitor, or what size capacitor to use. If I add a capacitor, I'm also wondering if I should add a diode to prevent the capacitor from being drained by power draw from the relay, Raspberry Pi and USB hub.
Here's a picture of my circuit diagram: https://www.dropbox.com/s/zs3ydg33k7aitx7/0524151144.jpg?dl=0
Any ideas or suggestions would be appreciated. Thanks!