I’m working on a hobby project, and thus the requirements are a little fluid - but would anyone mind taking a look at the photo of the prototype and telling me everything I’m doing completely wrong, horrible and idiotic?
The task is simple. Use an Arduino to open and close the 2 water values.
I tried to label the image, but if anyone has any questions, I’m pretty technical, just not an EE so this is all new.
It does operate as expected. Which is a small win that it works at all. A good example though is:
The TX2 and TX3 pins are directly firing a 12v relay trigger. Do I need caps, resistors, a diode between the Arduino and the relay?
My 5v Arduino must have a mixed ground with my 12v mains power, so I can fire the relay with the Arduino trigger…is this the best way to do that, is it safe for the board?
Alrighty the blue painters tape is a nice touch, interesting. Let's consider this is a first attempt. The beginning of this section has a little advice as to flyback diodes and why you need them, you may want to give that a read. Yes, you want flyback diodes across your relay coils. Lacking flyback protection bad things happen to your uC.
Next I don't get the 12 volt relay coils being directly driven? A link to the relays would help as I don't know the relay coil current?
Thanks for the response! I’ll go check out the fly back diodes and their reasoning. You mention to install them across the relay coil…I wouldn’t have guessed that, but I’ll keep that in mind.
The relay is a Crouzet MUR3
I had them available, so I used them. There’s probably a much better item to use.
When I mention I was directly driving them, it’s probably a bad way to describe it. The relay has many “modes” or programs that can be used. I’m using program / function B. The relay stays energized, and is closed or opened using a trigger. You can see the trigger wires (dark blue) to the breadboard, and then continuing (yellow) to the relay trigger post.
The 12v for the relay to energize, and to fire and pass through comes from a 12v power supply separate from the Arduino.
Well alrighty. I was just curious about the relay coil voltage and current. Here is what goes on with the relay coil and why you need a flyback diode. When a DC coil is energized lines of magnetic flux travel outward. When power is removed the field collapses rapidly resulting in an inductive kick, a high voltage well exceeding the normal coil voltage. This inductive kick as commonly called goes right back to the source.
I would just put a few 1N4002 common diodes across the relays and depending on reading up on them they may not be needed since you are just triggering the relays. The data sheet provides a much better understanding so always include links to parts.
Many thanks Ron, I’m adding it to my reading material. One last question…
So I’m looking at the MUR3 data sheet (linked above), what specification tells me the possibility or protection against fly back or inductive kick? Is it normally listed and something I should look for?
Sitting here glassy eyed looking at the data sheet and can't find what I am looking for. I can tell you there is no need for a flyback diode. These as you know are just a timing relay. You provide a trigger and the relay energizes for your preset time interval. I can't find the trigger data? Everything else is in there? Maybe I am just tired.
Hey Red, that’s a really good question. I tried to get a definitive answer on whether or not I should just run the Arduino on their 12v supply, or that wouldn’t be good for the board in the long run. The specs say it’s within the allowed range, but I didn’t know if that was maybe like “You can do it, for like 19 seconds as you watch the board melt it’s face, but it’ll work awesome for those 19 seconds”
Do you know any reason I shouldn’t power it directly from the 12v supply? I have these little modules that I recently thought of. They are for taking 12v and outputting 5 volts (for usb charging purposes). Would it be recommended to adapt the 12v down, or unnecessary?
It really depends on the specification of the small power adapter unit you are using. A lot of those breadboard type adapters are not great quality, and you need to be a bit careful with the "claimed" spec versus reality... having said that they are pretty cheap, so if you cook one it's probably not the end of the world.
They often have linear voltage regulators that need to dissipate the drop (input to output) in power as heat... so the more current you draw the more heat you get. 12 - 5 = 7v * whatever current.
Ahh, that’s a really good point red_car, it seems reasonable that I would possibly harm the power supply board before I’d hurt the Arduino.
So, if I monitored the temperature closely, I should know rather quickly whether it was able to dissipate enough heat, or if the heat is going to continue to cooking levels. Is your guess close to standard PC component heat death? Maybe 80c to 100c and cool it or loose it?
I have a few of those power supply boards, maybe I’ll just test it out and go to the cooking level and get some data. Even though they’re really really cheap, I live in the Caribbean on a yacht, and the island I’m currently offshore from has no chance of having an Arduino Power supply PCB. Best I could hope for would be a wall adapter that put out 5 volts (which would probably work too?)
If it's too hot to touch I'd look for alternatives. If you have a multi-meter you could check the current draw of the Mega... then you'd know for sure how many watts you need to dissipate.
A really good option... they can normally supply significantly more than you will need for the Arduino.
Beware that 12 volt supply says 12 volts at the rated current for the supply. With no load or very light load, the voltage may be 15-18 volts. Measure the no-load voltage to see if it is safe for your Arduino.
I personally wouldn't recommend it. I've used a PC power supply at 12.01 volts and the regulator gets hot every time, regardless of load so I stopped doing it. 7 volts is what I stick to for the regulated supply, but usually just do 5v externally regulated on the 5v pin.
That’s kinda what my gut was telling me, which is why it’s connected as is above in the photo.
This particular Arduino is modified to be part of a kids toy robot, so it has space for two LiPo batteries at 3.7 volts each connected in series. Then manual stated that anywhere from 5 volts to 12 volts could be used.
Long story short, when connecting to 12 volts through the battery terminals (to make sure I was utilizing the voltage converter), it took all of about 15 seconds for a component at the edge of the board (I’m guessing the voltage converter) - to get pretty freaking hot. I didn’t stay the course to find out what the outcome would be. Immediately removed from power and all is fine. Maybe that’s normal, maybe I’m paranoid but no mater what, heat isn’t good for electronics in almost all cases.
So…I have a couple of these laying around from other projects:
I’m wondering if I’m better off with something like this? Because I live on a boat, we have 12 volt power all over the place, so we can step it down pretty easily, AC power at 120/240 isn’t a problem either though, and I have transformers that take 240 (230?) and output 5 volts, and dont become even the slightest bit warm. So I’m pretty sure they’re made by elves and are powered by unicorn dust….
Thats correct, it has 3.3v and 5v output on both sides of the board to connect to the breadboard power rails, sounds like you're familiar with this board. Thanks for jumping into the topic.
Is there any difference plugging the 12v into the PSB (power supply board) vs the Arduino, other than possibly melting a cheap component rather than a more expensive one?
I really don't know the specs on the PSB at all. I received them in a kit for something else and have repurposed them.