Hello, I've made a program and I've got into an issue and i was wandering if i can somehow fix it.
I've made a program that recognizes people and based on them it open a solenoid lock. The problem is that when the lock is gets opened and/or closed monitor goes black for half of a second or so.
I was wandering what might be the problem and if i can fix this from happening! Thank you!
Re: Screen going black
Power?
Is your PSU able to supply enough current to ruyn the Pi, the screen, and the solenoid at the same time?
Is your PSU able to supply enough current to ruyn the Pi, the screen, and the solenoid at the same time?
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: Screen going black
I've got a PSU of 5.1V and 3A and the thing connected to the rpi are this: A 16x2 lcd screen, a fan, a USB camera, a dongle for the keyboard, the hdmi cable to the monitor, and the relay that is used for the solenoid lock to be connected. I think they should draw that much.
Re: Screen going black
how are you running the program ? loop ?hmzi1234 wrote: ↑Mon May 29, 2023 5:10 pmHello, I've made a program and I've got into an issue and i was wandering if i can somehow fix it.
I've made a program that recognizes people and based on them it open a solenoid lock. The problem is that when the lock is gets opened and/or closed monitor goes black for half of a second or so.
I was wandering what might be the problem and if i can fix this from happening! Thank you!
Re: Screen going black
its a python gui made with tkinter that has a function that runs as a loopkerry_s wrote: ↑Mon May 29, 2023 8:37 pmhow are you running the program ? loop ?hmzi1234 wrote: ↑Mon May 29, 2023 5:10 pmHello, I've made a program and I've got into an issue and i was wandering if i can somehow fix it.
I've made a program that recognizes people and based on them it open a solenoid lock. The problem is that when the lock is gets opened and/or closed monitor goes black for half of a second or so.
I was wandering what might be the problem and if i can fix this from happening! Thank you!
Re: Screen going black
That implies that the HDMI screen and the solenoid are not drawing their power from the pi. Correct?hmzi1234 wrote: ↑Mon May 29, 2023 6:01 pmI've got a PSU of 5.1V and 3A and the thing connected to the rpi are this: A 16x2 lcd screen, a fan, a USB camera, a dongle for the keyboard, the hdmi cable to the monitor, and the relay that is used for the solenoid lock to be connected. I think they should draw that much.
Some further questions:
- Which model Pi are you using?
- Which OS is it running on? Desktop or command line?
- Which screen is blanking out? The HDMI one or the character LCD?
- What sort of relay?
- How much current does its coil require?
- Do you have an anti back emf diode across the relay's coil?
- Are you driving the relay directly from one of the Pi's GPIO?
- Have you tested with the fan disconnected? Unless you live in the tropics and the Pi is under heavy load there is no real need for a fan.
- Can you share your wiring diagram and code?
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: Screen going black
1. RPi model 4b 4gb
2. RPI OS
3. The HDMI one
4. A 5v generic relay
5. I didn't find any info regarding that.
6. Don't think so, i'm not good at electronics and how they work or so.
7. Yes, i've tried using a breadboard power syupply but i dont think that is possible.
8. Yes, it's still the same problem, even tried without the camera and the 16x2 lcd screen disconnected. And also the fan is 100% needed in this because the temperature of the cpu gets to 70-80 while running the program.
9. Ill provide a code that uses only the relay connected and nothing else, but still has the same problem, blacking out the screen
2. RPI OS
3. The HDMI one
4. A 5v generic relay
5. I didn't find any info regarding that.
6. Don't think so, i'm not good at electronics and how they work or so.
7. Yes, i've tried using a breadboard power syupply but i dont think that is possible.
8. Yes, it's still the same problem, even tried without the camera and the 16x2 lcd screen disconnected. And also the fan is 100% needed in this because the temperature of the cpu gets to 70-80 while running the program.
9. Ill provide a code that uses only the relay connected and nothing else, but still has the same problem, blacking out the screen
Code: Select all
import RPi.GPIO as GPIO
from time import sleep
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.OUT)
while (True):
GPIO.output(24, 1)
sleep(1)
GPIO.output(24, 0)
sleep(1)
Re: Screen going black
After a lot of testing with a lot of different relays and different connections, I've managed to fix the issue.
The issue was somehow related to the monitor I'm using, or at least the cables i was using.
I've had the RPi connected to its own monitor, with a micro hmdi-hdmi cable and a dvi adaptor ( it's an older monitor), and I thought to try it on my PC monitor with a microHMDI-HMDI adaptor and a HDMI HDMI cable. And the problem stopped without changing the code or anything, with all the parts still conected to it.
Thanks though for your answers!
The issue was somehow related to the monitor I'm using, or at least the cables i was using.
I've had the RPi connected to its own monitor, with a micro hmdi-hdmi cable and a dvi adaptor ( it's an older monitor), and I thought to try it on my PC monitor with a microHMDI-HMDI adaptor and a HDMI HDMI cable. And the problem stopped without changing the code or anything, with all the parts still conected to it.
Thanks though for your answers!
Re: Screen going black
i think it's a common thing with loops as there's a bit of a restart/relaunch of the script.
depending on the script, most of the time it's not noticeable when the script is fast.
what's the refresh on the problem screen ?
depending on the script, most of the time it's not noticeable when the script is fast.
what's the refresh on the problem screen ?