I am working on home vertical growing project.
I am using:
- Power supply 12V 20A (https://www.aliexpress.com/item/32983648084.html?spm=a2g0s.90423220.127.116.11af34c4d5hRuZn)
- Voltage regulator L7805CV (https://datasheet.octopart.com/L7805CV-STMicroelectronics-datasheet-7264666.pdf)
- 4-channel relay module (https://www.handsontec.com/dataspecs/4Ch-relay.pdf)
- Arduino 2560 Mega
Below is my wiring diagram (it is not the nicest, but I don’t know what programs are you using for better drawings). There is not shown, but those “INx” signals from relay module are connected to arduino digital pins. In total there will be 6 relay modules.
At first I was supplying 3 modules with only 1 L7805CV, but when I tried controlling modules only one relay clicked, but the leds were lit up for all of them but they were dimed. At this point there was no Arduino connected I was using only one wire and connecting it to 5V or GND, controlling one relay at a time.
So I thought it was problem with power supplying, and added one L7805CV for each relay module. And now sometimes they “click”, sometimes they don’t and sometimes they are “clicking” like crazy while control signal is not changing. And sometimes there are some wired buzzing sounds.
Are there any suggestions?
- 1The link for the power supply does not work. Is the jumper on the relay board removed or connected? Either way the relays should not be randomly clicking, no matter what. – Justme Nov 5 at 8:47
- (1) The spec of 15-20mA driving current is WRONG. Actually your Arduino/Rpi GPIO pin needs only around 5mA to drive each channel’s optocoupler (EL817C), but then you need 50 mA to 70mA to switch on blue Songle relay switch (not the module, see Part C of my answer to the following referred Q&A) (2) Ref: electronics.stackexchange.com/questions/505318/…, (3) L7805 series regulator is not a good choice. I would recommend a switching PSU module, such as the cheapy L2596 module, – tlfong01 Nov 5 at 9:11
- 1@Justme Jumper is removed. – ves_el Nov 5 at 10:53
- 1@tlfong01 I will check your answer. Is L7805 not good because of the voltage drop on it? I have a plan to change it in the future for some other switching regulator, probably L2596 as you suggested. I just had some L7805 laying around so I can start testing other parts of the system. – ves_el Nov 5 at 10:57
- 1Did you applied heatsink for 7805? It has internal thermal protection. From 12V to 5V, 1A , 7W should be dissipated. Without heatsink it can dissipate 0.35W or less, depends on environment. – user263983 Nov 5 at 12:54
- 1@user263983 Thanks for pointing that out. There are no heatsinks applied at the moment. This is just for quick testing purposes and I am going to change L7805 for a switching power supply as was sudgested by tlfong01. – ves_el Nov 5 at 14:28
- 1@tlfong01 Thanks for your comment it is realy helpful for understanding how these modules work. I maneged to fix my problem with capacitors, but will definetly go for switching power supply in the future. – ves_el Nov 5 at 14:29
- @ves_el, yes, L7805 and other series voltage regulators, comparing to switching ones, generate too much heat, so are environmental unfriendly. – tlfong01 Nov 6 at 9:21
- And about Arduino 2560 Mega: it is as old school as 7805. if you have not yet invested a lot of time in Arduino/C++, I would suggest newbies to start with Pico/microPython. – tlfong01 Nov 6 at 9:25
- 1@tlfong01 I haven’t invested lots of time in Arduino, but I am looking forward for embedded C programming instead of Pico/microPython. – ves_el yesterday
- @ves_el, I see. So your longer term goal is into embedded C programming. If you would like to let me know your reasons for that, I might give my reasons to change your mind. – tlfong01 yesterday
- 1@tlfong01, I would be more than happy to hear your reasons. My plan was to learn embedded C as I am looking at more advanced sensor design. I’m currently studying electrical engineering and in the moment I am drifting towards ASIC design and FPGA programing. Nevertheless, I think that learning embedded C is not a bad idea as I saw at an internship in a company that is producing encoders and all their software is written in C. – ves_el 18 hours ago
- Ha, your original question seems to be degenerating into a couple of not too related areas. (1) I agree ASIC and FPGA do use specific tools and also C which is a basic tool. Your target company making encoders (rotary encoders?) might be using ASIC/FPGA tools and C. So to conclude, learning C is a good strategy for short term and no harm for long term. (2) Arduino 2560 Mega is perhaps very good to make 3D printer, but very bad for learning C. / to continue, … – tlfong01 17 mins ago
- (3) The Rpi4B, CM4, RpiZ2W, and Pico suite for sure is a much better way to go EE pro, in the long term. Of course ESP32 and STM32 (yes, for C) are also good starting offs. (4) Rpi Pico, in my opinion, is indeed the best for newbies to go Pro. (5) I forgot to mention that Pcio has both the C SDK and python SDK, and both are freshly developed in UK Cambridge, by the top pros. (6) For Pico, you can find docs to write ARM macro assembly routine to make the time critical parts of your C program run much faster. / to continue, … – tlfong01 10 mins ago
- (7) MicroPython is much expressive that C. They can do low level / register level tricks and for rapid prototyping are usually many times quicker than using C. (8) Your original question in vertical growing is in the area of system/device integration, so not embedded stuff at all. So I am diverting from your original question.(9) In short, Pico C is the best for you. – tlfong01 6 mins ago Edit
You haven’t drawn any capacitors on your diagram. A 7805 needs them on the input and output, as shown in the data sheet. Without them, the output of the regulator can be unstable.ShareCiteEditFollowFlaganswered Nov 5 at 10:30Simon B12.7k11 gold badge2020 silver badges3535 bronze badges
- 1Thanks for the heads up, I will add them and report how it went. – ves_el Nov 5 at 10:59
- 1I added capacitors to input and output of L7805 and now relays are acting normal. Regulator unstabiliti explains why relays were clicking randomly. – ves_el Nov 5 at 14:24
- 1So that is he issue. 50 mA you can get without overheating. Also relay coil 5V you may feed from 12V with resistor in series. – user263983 Nov 5 at 16:59