1
\$\begingroup\$

I recently acquired an Arduino Uno R3 board. 4 ways to power it are as follows (link):

  1. USB port
  2. DC jack port
  3. VIN/GND combo
  4. 3.3V/5V/GND combo

However, lots of schematic online leave out this important part as it is essential as the board appears to requires its own power source. Take for example this project (Arduino light dimmer circuit)

For this project, we can see an Arduino Uno hooked up to a power sources via a DC barrel jack (screencapped and circled in black), however, this is not represented in the circuit diagram

diag

But the schematic showed, it left out details as to how the Arduino got its power. Arduino board power could come from a 9V cell, Transformer/less Power Supply hooked up to the same mains that power the device-to-be-controlled, or a separate low voltage DC source (such as a different power socket, PPoE RJ-45 port or solar panel)

enter image description here

Given that the 5V/GND PINs could serve as power input, I as a novice would think that op-amp in the diagram was the power source for Arduino. Here's another pic I saved a while back from an unknown source:

source unknown

Full context of circuit:

enter image description here

Here shows mains power stepped down via a resistor and rectified to power an EL817 Photocoupler. Again, its connected between 5V/GND so is a switch for the Uno or a power supply? It's unlikely that such a device can turn light energy into electricity for power source. So how to explain this?

Can we assume projects online involving this model of Arduino ALWAYS need a stable power source to function even if its not shown in the project schematic?

\$\endgroup\$
0

2 Answers 2

0
\$\begingroup\$

The connections to mains live and neutral, in every instance, are used to sense mains voltage, or to power the lamps only.

None of those circuits show the power supply for the Arduino itself. In all cases the Arduino would require another, different power source, which is not shown.

The elements labelled "optocoupler" have no electrical path between the LED and transistor, isolating the two sides from each other. They are used to transfer signal information, not power, while remaining completely electrically isolated. None of the optocouplers are being used to power the Arduino here.

The 5V pin of the Arduino is a supply potential derived either from USB, or produced by the Arduino's on-board regulator, from power supplied via the barrel-jack input. This power source is not shown in any diagram here. All of these circuits require a separate DC voltage supply for the Arduino.

The LM393 comparator (not op-amp) is being powered via its pins 4 and 8, which are connected to the Arduino's own 0V and +5V supplies. It is "borrowing" the Arduino's own 5V supply. The comparator circuitry is dangerous, deriving its input signals directly from mains, and while this arrangement works, it provides no isolation, and causes all nodes of the rest of the circuit to have a huge potential relative to you/neutral/earth. A failed input resistor could be lethal to anyone touching the system. On top of that you should never, under any circmustances, connect such a design lacking mains isolation to any other system, including USB.

The rectifier bridge + opto-coupler solution (your 3rd and 4th images) is a far superior solution for sensing mains voltage, since it isolates the Arduino from the mains supply. Again, that opto-coupler is not providing the 5V supply for the Arduino, rather +5V from the Arduino's own supply is used to power the opto-coupler's "receiver-side" transistor. The 47kΩ resistors limit LED current to a level the LED can tolerate, but that current is constrained to the mains-rectifier-LED loop, and does not contribute to 5V power for the Arduino.

\$\endgroup\$
2
  • \$\begingroup\$ If there is an absolute need to tap on the mains supply to power the Arduino and a transformerless solution is chosen due to compactness, then maybe other safety measures could be included like fuses and preventing contact with any conductive non isolated paths could be implemented? Ib case of fault, debugging or data acquisition using a PC (shouldn't be much of an issue due to wireless tech), a procedure to switch to battery supply could also be done? Any other safety suggestion? \$\endgroup\$ Commented Feb 19 at 5:31
  • \$\begingroup\$ Sure, as long as there's no chance that the user can come into contact with any part of the circuit, then go ahead. The potential differences involved will require careful circuit layout to prevent arcing, though. \$\endgroup\$ Commented Feb 19 at 5:38
0
\$\begingroup\$

Yes, it is assumed that every circuit board that needs power is powered from somewhere.

Includes Arduinos. They do not work without a supply.

The dimmer projects that involve unisolated connections to mains voltage such as the LM393 circuit you show are dangerous. Please don't try these circuits as you might end up dead or fry your computer.

The optoisolator is not a supply for Arduino. It simply senses the mains AC waveform to know when to drive the triac.

\$\endgroup\$
6
  • \$\begingroup\$ Yes, be extremely careful with dimmer projects, the part of the cirquit that is connected to mains (thyristor, zero-crossing detector) should be properly isolated from the control part (arduino). The scematic with LM393 is bad. Really safe design should have 2 optocouplers - one is for zero-crossing detection (LED at mains part, phototransistor to Arduino), second is for thyristor control (LED to Arduino, phototransistor to the thyristor gate). And your last schematic is only a zero-crossing detector, not a supply. \$\endgroup\$ Commented Feb 18 at 18:23
  • \$\begingroup\$ @Alex That's basically what I said. Did you intend to post that as an answer instead of comment? \$\endgroup\$ Commented Feb 18 at 18:29
  • \$\begingroup\$ No, I just wanted to explain what's exactly wrong in LM393 circuit - lack of the second optocoupler (because, for sure, 200k resistors are not a sufficient isolation from mains voltage). \$\endgroup\$ Commented Feb 18 at 18:59
  • \$\begingroup\$ I would like to take the opportunity to ask how does connecting it to the 5V/GND pins of the Uno benefits in generating the waveform? \$\endgroup\$ Commented Feb 19 at 0:27
  • \$\begingroup\$ And putting it through a bridge rectifier creates a double half-wave \$\endgroup\$ Commented Feb 19 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.