triac firing from attiny816

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone, this is my first post here.

 

I am trying to drive a triac BT134 directly from the ATTiny816 processor. The goal is to drive the triac in Quadtrant 2 and 3. I have referred to the note by ST for negative power supply. Please see attached images of the power supply section and the drive section. The speed control pin is connecte to an ATTiny816.

 

When I switch the pcb on, I get a spark on the triac, or the resistor or transistor connecting to the triac gate blows up. Can anyone see what I am doing wrong here?

 

(ST note for reference -  https://www.st.com/content/ccc/resource/technical/document/application_note/a8/00/35/e2/62/e5/4c/14/CD00266635.pdf/files/CD00266635.pdf/jcr:content/translations/en.CD00266635.pdf )

 

I need to use non-isolated power supply and drive for cost reasons.

 

Thanks for any help.

Attachment(s): 

Last Edited: Mon. Mar 16, 2020 - 04:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks rather as if you've attached the +5v to the live side of the mains, pre rectification. And possibly to the ground as well. Check the PWR_FLAG connections.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The power flag can be ignored. This is just a Kicad thing. The circuit works perfectly if the triac gate is not connected to processor. Power supply is good, led programming works fine. Gate connection to processor blows triac.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Power flag is not a net name and is not a connection.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

YOU HAVE A VERY BAD SCHEMATIC FOR DRIVE THE TRIAC! 

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TPE, I came here for help. Care to elaborate on your comment?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you show the load connections and what GND is connected to? Power.png has no gnd marked on it.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Non-isolated power supplies are EXTREMELY dangerous!!!  If you do not have the training and skills for this, you should seek someone who does! THIS CAN KILL you or others!

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GND is connected to phase neutral.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I understand. There are several products that work on non-isolated transformerless power supplies. There are articles from ST and Microchip of these designs. It is a real fact of cost and space constraints. Please let me know the problem with the circuit. Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

manishb wrote:
GND is connected to phase neutral.

 

Thanks,

 

for completeness, how is the load connected onto your triac.png diagram?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Neutral to load to t2

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

manishb wrote:
I understand. There are several products that work on non-isolated transformerless power supplies. There are articles from ST and Microchip of these designs. It is a real fact of cost and space constraints. Please let me know the problem with the circuit. Thanks.

I'm glad you understand, but from your questions, it appears your not qualified to be around this circuit!

Sorry, but we get a lot of beginners and students, if your qualified, please state so.

 

Start by showing your complete power supply and control schematic, instead of pieces of it, including how the load is connected and what the load is?

How much current you expect your circuit will draw, (not talking about the load circuit), but the control circuit.

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your concern Jim. I know where you are coming from. It is important for good safety advice on such forums. You can consider that I am qualified.
I take extra precautions when working with mains circuits. I never directly connect to mains during design and always use a variable transformer to give me about 50v ac for testing.
I think the problem in my circuit could be that I haven’t referenced 5V directly to mains. It is currently going through the capacitor to drop current. I intend to move the reactance cap, diode, resistor to neutral and connect vdd directly to mains power.
Will test and post the results in the morning. Thanks
Load is inductive ceiling fan motor. Neutral -> Load to T2. The power supply should draw 80mA. The fam motor draws about 350mA at 230vAC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

manishb wrote:
Thank you for your concern Jim. I know where you are coming from. It is important for good safety advice on such forums. You can consider that I am qualified. I take extra precautions when working with mains circuits. I never directly connect to mains during design and always use a variable transformer to give me about 50v ac for testing. I think the problem in my circuit could be that I haven’t referenced 5V directly to mains. It is currently going through the capacitor to drop current. I intend to move the reactance cap, diode, resistor to neutral and connect vdd directly to mains power. Will test and post the results in the morning. Thanks Load is inductive ceiling fan motor. Neutral -> Load to T2. The power supply should draw 80mA. The fam motor draws about 350mA at 230vAC

All very good, thanks for the update.  I would add an isolation transformer for testing, if your auto xformer is not isolating, if nothing but to save your test equipment from accidents(a lesson learned the hard way)smiley.

The power supply draw seems high, I would think 30ma or less, but you have not shown the full circuit to us.

Good luck with your project, and keep one hand in your back pocket! angel

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Jim. There are actually 5 triacs being controlled and a BT radio. I would be happy if everything can be driven in under 70mA.

Read a lot of articles about not connecting my oscilloscope to measure mains. Found a simple solution that has worked well for me. If I just keep my neutral and phase common for the oscilloscope and the circuits, and use the 10x reduction probe, things work just fine. Of course, if you switch the ground and main probe pins, or anywhere else in the circuit if they switch over, kabooom... surprise

 

Actually a lot of forums refuse to discuss mains circuits. I just got this topic shut down at All About Circuits. I feel that it is important to also discuss mains circuits and safety factors with younger developers. There are so many products in the market that use transformerless designs these days, so study of these and a detailed understanding of AC and DC is required as a skill by any electronics engineer...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

We don't like discussing mains circuits for the very reason you've demonstrated - something went pop. Sometimes that pop can be a bit more than just the electronics getting damaged. Even flying debris cn injure your eyes. Be sure to wear eye protection.

 

 

Having made many things go pop in my lifetime, it really comes down to understanding the basics. With AC, the basic understanding is that for a 240VAC circuit, the volts are going from -320 to +320V from your point of reference. Your point of reference could be Neutral or Active - from the circuit's point of view these are effectively the same. It is only due to safety that we tie one to earth otherwise in the street transformer, the inter winding capacitance would couple 11kV onto our 240V wiring - this is not what we want. There are other safety reasons as well.

 

 

With your circuit, what is the point of reference for the triac vs the rest of the circuit? Also note between MT1 and gate of the triac, it will only allow around 2V.

 

If you want the triac to switch the active, then your circuit's point of reference (0V) has to be Active. his requires some mental gymnastics to get your mind around this. As far as your circuit is concerned, Active is 0V and neutral is going +/-320 around it.

 

Some other notes:

 

There is no fuse in your circuit - varistors explode (literally!) if grossly overloaded. Have a fuse local to limit the energy.

 

There are ics that do the power supply better than just the simple reactive dropper. These are cheaper and smaller than the X2 capacitor and usually have a regulator as well. I'll have to search out part numbers later - there is some really cheap Chinese chips.

 

Use Google to seek out schematics - what you want to do is not new. Do your research next time to avoid the common pitfalls. It staggers me that people that were born with the internet don't know how to Google. Us oldies seem to have no problems. 

 

Using an oscilloscope on mains is fraught with problems. At one job we had an isolated oscilloscope specially for this purpose. I've done the trick of disconnecting earth on a normal scope - understand that the oscilloscope itself may be live. Very dangerous. If you need to scope the microcontroller operation whilst debugging - then have the circuit using optocouplers and other isolation. Avoid having to scope live circuits where possible.

 

Also understand optocouplers aren't the magic bullet you might think they are - the ability for them to isialote also depends on the board they're installed onto. Understand creepage distance.

 

I'm playing with a project called Tasmota at the moment - there may be links to dimmers.

 

 

 

 

 

 

 

Last Edited: Tue. Mar 17, 2020 - 12:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will but take some hours to draw all power and triac driver. just google some real schema. if you do not find , I will try to draw it.

the main idea, triac must be drive with current. it seam you drive low load, than can use triac with low drive current. i guess 5mA are available.

your neutral phase must be the 5V line, than mean you must make a -5V power . 

I have make triac board over 30 year, guess 300 000 board produce. drive motor, heater , dimmer+++  

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
If you need to scope the microcontroller operation whilst debugging

Or even just ISP'ing the program in can be a hazard to your PC, use an isolated USB hub, your PC will thank you!

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Show a complete schematic of what you are doing, not a bunch of chopped up pieces

 

Draw it on one page so you can tell exactly what is connected to what.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


avrcandies wrote:

Show a complete schematic of what you are doing, not a bunch of chopped up pieces. Draw it on one page so you can tell exactly what is connected to what.

Yesterday evening I tried to piece together the OP's circuit from the posted fragment and the words. I *think* this is what he has (unnecessary components omitted)...

 

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss