Author Topic: Can someone help me review this schematic?  (Read 6386 times)

0 Members and 1 Guest are viewing this topic.

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Can someone help me review this schematic?
« on: July 05, 2020, 08:52:26 am »
I am a beginner and I have got few questions with the first project I am attempting. I am trying to build a reliable timer circuit with three timing options. The use case is very similar to a microwave oven i.e., the circuit should check if the doors are closed, three timing options that can be selected with the buttons, start, stop and pause options for the timer.

I first thought of using a 556 timer(restricting to only two timing options) with a relay. But I also needed a display(lcd displays, not 7 segment leds) and it was not possible to interface a display with the 556 timer.

Another option was to go with a microcontroller like arduino which is easy to work with but I'm sure about the reliability. And they also cost more.

I was searching online and found this circuit for a microwave oven controller. I'm thinking to modify this to my needs than trying to build it from scratch. I have few questions:

1) I am not able to find AT89C52, what else can I replace it with? Will any 8-bit 8051 do fine?

2) I just need to control one relay and 5 input switches. Can I just leave the other ones floating?

3) This circuit is designed to work with high power components while my total power usage will be around 80W, do I need to re-calculate for the resistors and capacitors?

4) Do I need a resistor in series with the C5 10u cap?

Thanks

EDIT: Forgot to add the image

« Last Edit: July 05, 2020, 10:09:04 am by redgear »
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #1 on: July 05, 2020, 01:28:22 pm »
In your position I would be tempted to use an Arduino Nano or Uno board. Plenty of shields (what they call add on boards) LCD, relay etc. and plenty of examples as well as a simple free development and programming environment. Forget the schematic you have it will only confuse issues. The forums are very active as well.
 
The following users thanked this post: redgear

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Can someone help me review this schematic?
« Reply #2 on: July 05, 2020, 01:58:39 pm »
"I just need to control one relay and 5 input switches."

Plus 6 MCU outputs for sending characters to the LCD ?

If that's all you need your circuit would be much simpler than that one.
.  That took much longer than I thought it would.
 
The following users thanked this post: redgear

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 788
  • Country: us
Re: Can someone help me review this schematic?
« Reply #3 on: July 05, 2020, 06:47:03 pm »
Quote
Another option was to go with a microcontroller like arduino which is easy to work with but I'm sure about the reliability. And they also cost more.

Did you mean to say “not sure about the reliability”? And then define the cost. They cost more than what? Various Arduino AVR based clones can purchased for less than $5 with zero effort and they are just as reliable as any other mass produced electronic device. In most circumstances, I’d say far more reliable than a one off strip board cobbled together prototype, especially so for one built by someone inexperienced.

You also have to consider programming the microprocessor. You don’t just buy an 8051 based part and go to town, what compiler? How to you get the code into the part? The edit-compile-upload cycle has a time cost and don’t overlook it. If this is your first rodeo, stick with Arduino platform, it will greatly improve you chances of success.  It’s difficult to give further advice until until we know what your experience level is, both from a hardware and software point of view.
 
The following users thanked this post: redgear

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: Can someone help me review this schematic?
« Reply #4 on: July 05, 2020, 09:04:38 pm »

1) I am not able to find AT89C52, what else can I replace it with? Will any 8-bit 8051 do fine?


No, depending on version it may not have any ROM, it may be old EPROM type, it may have only 4k flash instead of 8k, it could be one time programmable ...

Try AT89S52 instead of 89C52, that version is still commonly available and can be programmed in-system (unlike the 'C' series which needs an external programmer that you insert the chip into).

But for a new project I would rather use an AVR (= Arduino) than 8051 series, it is *much* easier to program for.
« Last Edit: July 05, 2020, 09:20:20 pm by janoc »
 
The following users thanked this post: redgear

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1063
  • Country: us
Re: Can someone help me review this schematic?
« Reply #5 on: July 05, 2020, 09:39:43 pm »
Unless you are familiar with the 8051 and have the programming hardware, I agree with the Arduino suggestion.  It is much easy to get going and doesn't need anything more than USB cable to program it. The Nano is perfect for what you want.

Second, I'd skip the 16x2 LCD and opt for something a little more modern unless you are going for a retro look - ILI9341 based LCDs are pretty cheap and easy to use.  You get color and, if you want, font support to make a much nicer looking display. Tons of code available for it.

As to the relay - you will need to properly size it for application.  I would derate the mfr's specs (especially current) by 50%.  There are a lot of garbage relays out there.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #6 on: July 07, 2020, 08:09:38 am »
In your position I would be tempted to use an Arduino Nano or Uno board. Plenty of shields (what they call add on boards) LCD, relay etc. and plenty of examples as well as a simple free development and programming environment. Forget the schematic you have it will only confuse issues. The forums are very active as well.
"I just need to control one relay and 5 input switches."

Plus 6 MCU outputs for sending characters to the LCD ?

If that's all you need your circuit would be much simpler than that one.
Did you mean to say “not sure about the reliability”? And then define the cost. They cost more than what? Various Arduino AVR based clones can purchased for less than $5 with zero effort and they are just as reliable as any other mass produced electronic device. In most circumstances, I’d say far more reliable than a one off strip board cobbled together prototype, especially so for one built by someone inexperienced.

You also have to consider programming the microprocessor. You don’t just buy an 8051 based part and go to town, what compiler? How to you get the code into the part? The edit-compile-upload cycle has a time cost and don’t overlook it. If this is your first rodeo, stick with Arduino platform, it will greatly improve you chances of success.  It’s difficult to give further advice until until we know what your experience level is, both from a hardware and software point of view.
No, depending on version it may not have any ROM, it may be old EPROM type, it may have only 4k flash instead of 8k, it could be one time programmable ...

Try AT89S52 instead of 89C52, that version is still commonly available and can be programmed in-system (unlike the 'C' series which needs an external programmer that you insert the chip into).

But for a new project I would rather use an AVR (= Arduino) than 8051 series, it is *much* easier to program for.
Unless you are familiar with the 8051 and have the programming hardware, I agree with the Arduino suggestion.  It is much easy to get going and doesn't need anything more than USB cable to program it. The Nano is perfect for what you want.

Second, I'd skip the 16x2 LCD and opt for something a little more modern unless you are going for a retro look - ILI9341 based LCDs are pretty cheap and easy to use.  You get color and, if you want, font support to make a much nicer looking display. Tons of code available for it.

As to the relay - you will need to properly size it for application.  I would derate the mfr's specs (especially current) by 50%.  There are a lot of garbage relays out there.

Thank You for everyone that replied. I am considering a arduino at this point. But still, I will have to work on the rest of the circuit, stepping down the mains to 5v, hooking up tactile switches to the arduino and detecting key press, I will quickly design it and post it here for review.

I am rn only confused about making the start button work only when the door is closed. Like, if its pressed with the door open, the timer should not start.

Thank you all again.
 

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #7 on: July 07, 2020, 08:48:53 am »
All my components, except for the microcontroller will use direct mains voltage. I am planning to run the mains voltage with a fuse and filter caps directly to the components.
For the microcontroller I have two options, stepping down the main voltage and using voltage regulator like 7805 or using a CC-CV Flyback Controller like UCC28740. Ti has a nice reference design that I can use. Which one would you guys recommend?
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #8 on: July 07, 2020, 10:10:34 am »
I wouldn't use mains except when essential for safety purposes, you want to make the board as safe as possible to work on. You can use say 12v relays which can be switched by a transistor and the arduino to control any voltage including mains. Your switches will need to interface with the arduino, so just use the same supply as the arduino. Makes everything much safer for working on.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #9 on: July 07, 2020, 10:26:36 am »
I wouldn't use mains except when essential for safety purposes, you want to make the board as safe as possible to work on. You can use say 12v relays which can be switched by a transistor and the arduino to control any voltage including mains. Your switches will need to interface with the arduino, so just use the same supply as the arduino. Makes everything much safer for working on.

Thanks,
I would have to use the mains. The Arduino and switches run 5v(stepped down and regulated from mains) and the components would be connected to the mains with a fuse and a relay that is controlled by the Arduino. What do you think?
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #10 on: July 07, 2020, 10:54:12 am »
See if you can sketch out your idea on a piece of paper and then upload a photo. You only need to use rectangles for such things as the arduino. Don't worry about it being rough or incomplete, it is a starting point which can be built upon.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #11 on: July 07, 2020, 02:27:33 pm »
Here is a simple block diagram of what I have in mind. Looking forward for your suggestions.
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #12 on: July 07, 2020, 03:18:21 pm »
Yes, that looks pretty good, and nicely drawn. You will need some sort of supply to drive the relay coil, you can use the 5v regulated, but 5v relay coils tend to draw a bit of corrent. What I tend to do is provide an unregulated 12v supply (what your transformer, bridge rectifier and caps provide). The transformer can have a 9v or 10v RMS secondary, when rectified and filtered will produce around 12v dc (with large enough caps). That can also be used to power your 5v regulator. Also 12v relays are plentiful because of cars. To drive the relay coils use a suitable transistor, and a flyback diode across the coil to reduce spikes.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #13 on: July 07, 2020, 03:27:23 pm »
Yes, that looks pretty good, and nicely drawn. You will need some sort of supply to drive the relay coil, you can use the 5v regulated, but 5v relay coils tend to draw a bit of corrent. What I tend to do is provide an unregulated 12v supply (what your transformer, bridge rectifier and caps provide). The transformer can have a 9v or 10v RMS secondary, when rectified and filtered will produce around 12v dc (with large enough caps). That can also be used to power your 5v regulator. Also 12v relays are plentiful because of cars. To drive the relay coils use a suitable transistor, and a flyback diode across the coil to reduce spikes.
Thanks! I will make the changes and post a schematic.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: Can someone help me review this schematic?
« Reply #14 on: July 07, 2020, 04:24:10 pm »

a small 5-15 VA 12v transformer + bridge rectifier + smoothing cap or a small 12v dc power supply.
A 7805 / LM317 / whatever linear regulator to produce 5v for the microcontroller and the LCD display.
ULN2003A  (darlington transistor array) or something similar to turn the relays on and off  (you can connect the microcontroller directly to this, instead of having resistor and npn transistor for each relay ... you have 7 transistor+resistor pairs inside a dip chip)
Some diodes for each relay (for voltage spike protection when relays turns off)

momentary buttons with resistor on each one to limit current, put all buttons on a port and maybe set interrupt on change ... when a button is pressed an interrupt is triggered and you have your value.  (or just constantly poll the buttons which would be useful for debouncing purposes)

For extra fun, you may want to experiment with capacitive touch like you see on lots of devices .. see for example https://www.digikey.com/product-detail/en/microchip-technology/CAP1206-1-SL/CAP1206-1-SL-ND/5886099
whole category here:  https://www.digikey.com/products/en/integrated-circuits-ics/interface-sensor-capacitive-touch/560/page/2?k=capacitive%20touch&quantity=50&stock=1&ColumnSort=1000011&pkeyword=capacitive%20touch

For example
 
The following users thanked this post: redgear

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #15 on: July 08, 2020, 01:28:34 am »
Here is a rough schemaric of what I was talking about:  :)

 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #16 on: July 08, 2020, 01:44:52 pm »

ULN2003A  (darlington transistor array) or something similar to turn the relays on and off  (you can connect the microcontroller directly to this, instead of having resistor and npn transistor for each relay ... you have 7 transistor+resistor pairs inside a dip chip)
Some diodes for each relay (for voltage spike protection when relays turns off)
Thank you for suggesting this, looks great!
Quote
momentary buttons with resistor on each one to limit current, put all buttons on a port and maybe set interrupt on change ... when a button is pressed an interrupt is triggered and you have your value.  (or just constantly poll the buttons which would be useful for debouncing purposes)

For extra fun, you may want to experiment with capacitive touch like you see on lots of devices .. see for example https://www.digikey.com/product-detail/en/microchip-technology/CAP1206-1-SL/CAP1206-1-SL-ND/5886099
whole category here:  https://www.digikey.com/products/en/integrated-circuits-ics/interface-sensor-capacitive-touch/560/page/2?k=capacitive%20touch&quantity=50&stock=1&ColumnSort=1000011&pkeyword=capacitive%20touch

For example
Wow, This is cool. Btw, connecting all buttons on single port won't work for me. Cos, i'm planning to include both reset and pause.

Here is a rough schemaric of what I was talking about:  :)


Thanks a lot for the circuit:)

I m planning 0.1uF caps for C1 and C2 and a cap 470uF cap C0 before C1. And instead of transistors for relays, as mariush suggested I'm going for ULN2003A. For the voltage reg I have UA78M.

Let me know what you guys think.


Thanks again :)
« Last Edit: July 08, 2020, 02:03:36 pm by redgear »
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #17 on: July 09, 2020, 01:06:12 am »
The cap C1, (C0+C1) has to be large enough that at full load i.e. max current out of 5v and all relays on, that the voltage never drops below about 8v. This is so the relays stay on, and the regulator doesn't drop out of regulation. There is a simple formula: C1 = (i*dt)/(Vmax - 8v). For 240v/50Hz, dt = 10ms.
The use of the ULN2003a is an excellent idea, just stay within the packages total current and power limitations. The built in diodes make life a bit easier also. :)
 
The following users thanked this post: redgear

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: Can someone help me review this schematic?
« Reply #18 on: July 09, 2020, 04:43:24 am »
Probably a simpler formula to use to approximate capacitance :  C  =  Current (Amps)  / [ 2 x AC Frequency x ( Vdc peak - Vdc min) ]

So if you have a 9v AC transformer, after rectification it will be 9 x 1.414 - 2 x voltage drop on diode of bridge rectifier  = 12.7- 2 x 0.8v = 11.1v peak dc voltage ... but can be higher if you use low voltage drop diodes like let's say 1n5818 (~ 0.3v at 0.1A, 0.5v at 1A) instead of a bridge rectifier.

Let's say you need 25mA for each relay, and you have 4 relays ... that's 100mA ... your micro and lcd will use another 10-20mA ... let's round it up to 125mA  and let's say you're in a 60Hz mains country

So if you want at least 10v all the time :   C  =  0.125 / [ 2 x 60 x (11v - 10v) ]  = 0.125 / 120 = 0.00104166 Farads or 1041 uF  ... so I'd use at least 1200uF 16v rated capacitor.

It would make sense to use a 12v AC transformer ... after rectification and drop of around 1.6...2v (if you use a generic cheap bridge rectifier) you'll have a peak voltage of around 15v.
Most relays should be perfectly fine with this high voltage, but if you're paranoid you can simply add a couple diodes in series to drop voltage by some amount (ex 1n400x diodes will drop 0.7v per diode) and get it closer to 12v ...

What you add in cost for diodes, you potentially save in using smaller capacitor ... C =  0.125 / 120 x (15v - 10v) = 125 / 600  = ~ 208uF

 
The following users thanked this post: redgear

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #19 on: July 09, 2020, 06:32:10 am »

So if you have a 9v AC transformer, after rectification it will be 9 x 1.414 - 2 x voltage drop on diode of bridge rectifier  = 12.7- 2 x 0.8v = 11.1v peak dc voltage ... but can be higher if you use low voltage drop diodes like let's say 1n5818 (~ 0.3v at 0.1A, 0.5v at 1A) instead of a bridge rectifier.


Nice formula. I would only say that the voltage regulation on small transformers can easily be +20%. So a no or light load your on 12v RMS can easily become 18-19v. Needs to be kept in mind, for both 5v regulator dissipation and possibly excessive voltage across the relays. Depends on a few things to do with the transformer.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #20 on: July 09, 2020, 06:37:52 am »
The cap C1, (C0+C1) has to be large enough that at full load i.e. max current out of 5v and all relays on, that the voltage never drops below about 8v. This is so the relays stay on, and the regulator doesn't drop out of regulation. There is a simple formula: C1 = (i*dt)/(Vmax - 8v). For 240v/50Hz, dt = 10ms.
The use of the ULN2003a is an excellent idea, just stay within the packages total current and power limitations. The built in diodes make life a bit easier also. :)

Probably a simpler formula to use to approximate capacitance :  C  =  Current (Amps)  / [ 2 x AC Frequency x ( Vdc peak - Vdc min) ]

So if you have a 9v AC transformer, after rectification it will be 9 x 1.414 - 2 x voltage drop on diode of bridge rectifier  = 12.7- 2 x 0.8v = 11.1v peak dc voltage ... but can be higher if you use low voltage drop diodes like let's say 1n5818 (~ 0.3v at 0.1A, 0.5v at 1A) instead of a bridge rectifier.

Let's say you need 25mA for each relay, and you have 4 relays ... that's 100mA ... your micro and lcd will use another 10-20mA ... let's round it up to 125mA  and let's say you're in a 60Hz mains country

So if you want at least 10v all the time :   C  =  0.125 / [ 2 x 60 x (11v - 10v) ]  = 0.125 / 120 = 0.00104166 Farads or 1041 uF  ... so I'd use at least 1200uF 16v rated capacitor.

It would make sense to use a 12v AC transformer ... after rectification and drop of around 1.6...2v (if you use a generic cheap bridge rectifier) you'll have a peak voltage of around 15v.
Most relays should be perfectly fine with this high voltage, but if you're paranoid you can simply add a couple diodes in series to drop voltage by some amount (ex 1n400x diodes will drop 0.7v per diode) and get it closer to 12v ...

What you add in cost for diodes, you potentially save in using smaller capacitor ... C =  0.125 / 120 x (15v - 10v) = 125 / 600  = ~ 208uF



Thank you both :)

Won't the 9v transformer be a better design choice? Since I will be using a Linear Regulator, 9v would mean less energy is wasted as heat.
As for the diodes I'm considering the S1M diodes for the bridge rectifier and 1N4148 as protection diodes for the relays.

My device has a EM ballast, I'm concerned if the LCD Display will output gibberish when they are turned on, is there a way to filter it? Would filter caps be a good idea? How do I calculate the capacitance required?

Looking forward for what you guys have to suggest. :)


 

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #21 on: July 09, 2020, 06:41:09 am »
I would only say that the voltage regulation on small transformers can easily be +20%. So a no or light load your on 12v RMS can easily become 18-19v. Needs to be kept in mind, for both 5v regulator dissipation and possibly excessive voltage across the relays. Depends on a few things to do with the transformer.

Thank you. So, it would be better to have two regulators in parallel or a vol. reg. with a higher power rating, correct?
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #22 on: July 09, 2020, 06:59:02 am »
I would still go with my original suggestion (the relays don't need a voltage regulator), but the actual currents and transformer are important, like any electronic circuit, just be aware of it. The transformer should have a voltage regulation figure which gives you the difference between no load and full load. A 10v RMS secondary would be good, but I really haven't seen any, but 9v is more common and should do, all things considered. You just need to make an informed decision based on what is available, you can calculate the voltage readily enough. Then choose your relays and see what their minimum pull in voltage is. I looked up one:
https://docs.rs-online.com/4354/0900766b8139785f.pdf
and the minimum pull in voltage is 9v for a 12v coil and drop out voltage is 0.6v.  :)
« Last Edit: July 09, 2020, 07:06:27 am by moffy »
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Can someone help me review this schematic?
« Reply #23 on: July 09, 2020, 07:28:48 am »
I would still go with my original suggestion (the relays don't need a voltage regulator), but the actual currents and transformer are important, like any electronic circuit, just be aware of it. The transformer should have a voltage regulation figure which gives you the difference between no load and full load. A 10v RMS secondary would be good, but I really haven't seen any, but 9v is more common and should do, all things considered. You just need to make an informed decision based on what is available, you can calculate the voltage readily enough. Then choose your relays and see what their minimum pull in voltage is. I looked up one:
https://docs.rs-online.com/4354/0900766b8139785f.pdf
and the minimum pull in voltage is 9v for a 12v coil and drop out voltage is 0.6v.  :)
Thanks. 9,10,12v RMS is available. Have to do some readings before I choose one. Do you have any brand suggestions?
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2221
  • Country: au
Re: Can someone help me review this schematic?
« Reply #24 on: July 09, 2020, 07:36:11 am »
Sorry, I don't but if you choose a reputable supplier you tend to get decent honest components. Also good components will have detailed data sheets. Not Chinese though, they can be all over the place, you often have to derate  a component by at least 50%.

P.S. I don't mind buying Arduino boards from Ebay etc. because they are an open standard.
« Last Edit: July 09, 2020, 08:55:34 am by moffy »
 
The following users thanked this post: redgear


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf