2
\$\begingroup\$

I'm trying to build a project where I will use a microcontroller to control a heating element. From what I’ve read, it seems a TRIAC and Optotriac will be best suited for this purpose.

While I'm already familiar with building low voltage DC circuits using power supplies and breadboards, how do I safely build and test my AC voltage circuits in a breadboard-like environment? Should I hammer/glue components into a block of wood instead of a breadboard? Do I buy a dedicated AC power supply? The goal is to create a working prototype of my circuits so I can then have a PCB schematic designed.

Here is what I have researched so far:

  • Safety, safety, safety!
  • Start by practicing with LOW voltages that are safe. Consider an isolation transformer/isolation variac or something where I can practice at super-low AC voltages first
  • Protective gear such as safety gloves, safety glasses, using one hand only while keeping the other hand in your pocket
  • Use an RCD/GFCI outlet (but it is rendered useless if I use an isolation transformer)

Maybe an alternative way to phrase the question is: what is the DC breadboard equivalent for prototyping with AC mains voltage?

\$\endgroup\$
3
  • \$\begingroup\$ Prototyping with mains for powering a heater involves delivering significant power and therefore circuit dissipation is also a part of what you will be prototyping -- at some stage. When you get to that stage, later, I'd recommend using sheet metal because it is easy to cut, put holes in, bend, etc. For example, here's a 10 W zener mounted to a bent plate and then that plate mounted to the sheet base. Here's a bridge rectifier mounted to the same base plate, as well. \$\endgroup\$ Dec 19, 2023 at 3:36
  • \$\begingroup\$ An isolation transformer is a nice to have. And for prototyping at low power there are few excuses to avoid one. But when dealing with power measured in kW, they are neither small nor cheap. In a case of a novel 8 kW circuit I didn't use an isolation transformer. Could not have afforded its cost for such one-off use. You will have to make your own call. \$\endgroup\$ Dec 19, 2023 at 3:51
  • \$\begingroup\$ terminal strips inside an enclosure ... duckduckgo.com/… \$\endgroup\$
    – jsotola
    Dec 19, 2023 at 5:03

4 Answers 4

5
\$\begingroup\$

How do I safely build and test my AC voltage circuits in a breadboard-like environment

Solderless breadboards aren't made for high current, but perfboard works fine. You can always use thicker wire on it.

To minimize the risk of contact with high voltage, an important detail is that stuff should not come loose, move around, get dragged by clip leads, slip when you probe it, fall off the table, etc.

So it's a really good idea to mount your board on something stable. I have a huge heat sink pulled out of a dumpster which is great for this, but a plank also works fine. The important thing is that it's a bit heavy, does not move around, does not fall on your lap.

All the HV wires should be fastened to this support, so they don't wiggle around and break off solder joints. If there's a heavy part like a transformer or heat sink, same story, use some screws and fasten it. When you're finished you can put the whole thing on a shelf and take it back later.

When it is powered, there should always be a light on to warn you. For example a powerstrip with switch and an indicator light.

If the triac is on a heat sink, either get an isolated triac or put a silpad to isolate it, and Earth the heat sink. The bigger it is, the more likely you'll eventually put your finger on it.

Exposed mains voltage on the board is okay if you're working on it. However exposed mains voltage in the area you're not focusing on is a problem because... you're not focusing on it. So take the time to put heat shrink or electrical tape on the transformer primary connections, or stuff like that...

Use Wago 221: cheap, reliable, convenient, safe, reusable... these little things are awesome, and if you get some banana jumper wires, just cut off one of the banana jacks and you can put the wire in the wago too. It's a good idea to get banana jacks with insulating shrouds.

enter image description here

When probing, if the probe slips you can get a short and ruin the circuit. When that happens stuff gets vaporized (even more if charged capacitors are involved), so you need safety glasses.

It's hard to hold the probes while tweaking the multimeter or scope. So a pair of wire grippers for your multimeter really helps. What I do is power down, solder a few leftover resistor legs on the test points, then grab them with the wire grippers, and power back on.

If you build anything with a microcontroller, use an isolated supply and opto triac. Capacitor dropper supplies are meant to save costs on high volume manufacturing. But for hobby stuff it makes no sense because it's dangerous, you can't probe it with a scope, the micro will be at mains potential, the USB programming interface will have to be isolated, etc. It's just not worth it to save the small cost of a PCB mount isolated AC-DC converter.

When working on the low voltage part of the circuit, it's a safer to tape something insulating on the high voltage part, for example a sheet of photocopy transparent.

And always put a bleeder resistor on your high voltage caps.

\$\endgroup\$
3
  • \$\begingroup\$ Sorry I'm new to Stack Exchange, and I don't believe I'm allowed to tell you how grateful I am for your detailed reply, so I won't. Instead, a few follow up questions: 1) Heat Shrink: is any random heatshrink (e.g. off Amazon) typically okay, or do I need to be particularly concerned about the quality/rating of the heat shrink when dealing with mains voltage? 2) Are there any inexpensive devices (under $200ish?) to test my circuit at a lower AC voltage first? I am wondering if it might be worth doing that before diving straight into mains level voltage. \$\endgroup\$ Dec 19, 2023 at 20:45
  • \$\begingroup\$ 3) My assumption was if I end up doing high volume manufacturing, and since I will have other components requiring various DC voltages as well, I would have to use an AC to DC converter and regulator to power the MCU. Then, an opto-triac + TRIAC to control the heating element. Am I understanding correctly that for manufacturing, I might consider using a capacitor dropper supply to replace the AC to DC converter? But I would still want a regulator before the MCU, and an opto-triac +TRIAC to allow the MCU to control the heating element? Or am I adding unnecessary components? \$\endgroup\$ Dec 19, 2023 at 20:49
  • 1
    \$\begingroup\$ If you make a triac circuit, you can test it with low voltage AC... For example with a mains to 24VAC transformer. But don't worry, triacs tend to just work. If your microcontroller is connected to some user interface like buttons, I'd recommend using an inexpensive isolated AC-DC converter. With a capacitor dropper, everything is connected to mains, including your "user interface"... Amazon heat shrink feels thinner than the brand stuff but it's fine for prototypes. \$\endgroup\$
    – bobflux
    Dec 19, 2023 at 20:52
2
\$\begingroup\$

Your list of precautions is a good start. Also, be sure that your Variac/Isolation transformer box is fused properly. Don't rely on your house circuit breaker.

There are plenty of standard circuits using opto-triacs and power triacs so you should be able to solder the line voltage portion onto a perfboard. You shouldn't need to do a lot of experimentation.

Use a perfboard without pads, so there won't be any mystery hot pads on the top. For 120 VAC, use 0.1 inch spacing wherever you can. At the triac you won't be able to maintain this, but don't go any closer than the triac leads. I've never wired a home project for 230 VAC, so I can't give advice for that.

As soon as you get the line portion working, enclose it in a box with a connector for the opto-isolated control input. Then you can continue to use a solderless breadboard for your remaining circuits. If the box is metal, be sure to ground it to earth.

Be sure to keep your line voltage away from your MCU. Your MCU will likely be connected to a PC during development. If the line voltage gets onto the MCU, it could get into your PC and you may have a spectacular fail.

Edit: Opto-triac manufactures often put recommended standard circuit diagrams in the datasheet, here is one for a resistive load. If your load is inductive, there are alternate schematics.

Put the line voltage circuit in a box (blue square). If it is a metal box, then ground it to earth with the third prong in the plug.

enter image description here

Modified version of this: https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/911/MOC3009-12.pdf

\$\endgroup\$
5
  • \$\begingroup\$ Do you have guidance for a safe separation for the clearances to use between the line voltage portion when using perfboard? In TRIAC driver circuit - MOC3021 there is a picture of someone using perfboard for line voltages and one of the comments on the question was suggesting the clearances were insufficient (without being specific). And did you recently create a FAQ question about perfboard best practice, which could be updated to include considerations if line voltages are used? \$\endgroup\$ Dec 19, 2023 at 9:47
  • 1
    \$\begingroup\$ @ChesterGillon - I added a clearance recommendation here. The best practices post is mostly for beginners who shouldn't be wiring line/mains. \$\endgroup\$
    – Mattman944
    Dec 19, 2023 at 13:37
  • \$\begingroup\$ 1) When you're referring to standard circuits using opto-triacs, are you referring to off the shelf modules like this? 2) Regarding ensuring the variac is fused properly, is that a matter of picking a reliable device or is there a manual inspection you're suggesting I perform? For example, I'm seeing variacs like this on Amazon.. \$\endgroup\$ Dec 19, 2023 at 20:56
  • \$\begingroup\$ If you buy a Variac box with a plug and outlet it should have a fuse. If you buy a bare Variac and put it in a box, then add a fuse. \$\endgroup\$
    – Mattman944
    Dec 19, 2023 at 22:45
  • \$\begingroup\$ Regarding standard circuit, I was referring to the schematics provided by the opto-triac vendor. I will add a picture to my answer. \$\endgroup\$
    – Mattman944
    Dec 19, 2023 at 22:47
0
\$\begingroup\$

If you can isolate the AC side eg using a solid state relay then you can put all the mains voltage equipment into an enclosure and play with the low voltage side in relative safety. You might like to start off with a low voltage heater running at low power to demonstrate that your control system is working before moving to a higher power setup.

\$\endgroup\$
2
  • \$\begingroup\$ I will consider using a solid state relay just for testing as you mentioned. The motivation for using a Triac + Optotriac is to build a circuit as close to the final manufacturable prototype as possible. When you suggest starting off with a low voltage heater: are you referring to a DC heater or an AC heating element? If the latter (preferred), any suggestions on how I could supply low AC voltage to get comfortable working with AC voltage at a safe level? \$\endgroup\$ Dec 19, 2023 at 20:13
  • \$\begingroup\$ Certainly, use a transformer. With let’s say a 230 to 12V tray can switch on either the primary (230V) or secondary (12V). You might start with a 12V heater and switch then move to a 12V heater and 239V switch, then finally 230V for everything. Be sure every stage to know that’s ‘safe’ and ‘unsafe’ and treat them accordingly. \$\endgroup\$
    – Frog
    Dec 20, 2023 at 9:22
0
\$\begingroup\$

There are diy transformer kits from eBay or Amazon for building a small one to any voltage value that may be used on the breadboard. You can also use screwdriver chargers. You have not indicated whether control will be by on-time, temperature sensing, or cycle chopping. It is when this aspect of the MCU circuitry has been satisfactorily tested that I think you have to bother about the mains section, which may not even be necessary to isolate but connected by triac drivers and triacs. As you will need triacs to drive any relays, they may be used directly.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.