Author Topic: Design review of a temp/timer/water-level control circuit  (Read 834 times)

0 Members and 1 Guest are viewing this topic.

Offline ShayTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: il
Design review of a temp/timer/water-level control circuit
« on: November 06, 2024, 07:49:42 pm »
Hello everyone,

I'm looking for feedback and suggestions on a circuit I recently designed. The aim is to create a front-panel interface with the following features:

Two Encoders: One for setting the oven’s operating time and the other for setting the temperature.
Two 7-Segment Displays: These will display the time and temperature.
In the back-end, the circuit will handle three primary functions:

Temperature Control: Using either phase chopping with an SSR or a bang-bang relay output with hysteresis to maintain stable temperature control.
Timer Function: A straightforward timer to control the oven operation time, with a dry contact output.
Water Level Control: Designed to manage water levels in a boiler for steam cooking (this is for a combisteamer, not a standard oven).
Please note, this isn’t the complete control system—there is a PLC responsible for the main logic. My circuit manages tasks that a basic PLC can’t handle directly.

My main area of concern is the software side, especially as I plan to implement this using an ATmega328PB. The phase-chopping portion needs to be synchronized with other events, and I’m hoping this is achievable with the chosen microcontroller.

Any feedback on the design or suggestions for improvement, particularly with respect to the software, would be greatly appreciated. I’m happy to answer any additional questions.

Thank you!
« Last Edit: November 06, 2024, 07:53:52 pm by Shay »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3982
  • Country: nl
Re: Design review of a temp/timer/water-level control circuit
« Reply #1 on: November 07, 2024, 02:47:44 pm »
I guess that TL074 is an opamp, but drawing a quad opamp as a single rectangular box is such an abomination that I closed the pdf.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7644
  • Country: ca
Re: Design review of a temp/timer/water-level control circuit
« Reply #2 on: November 07, 2024, 05:42:28 pm »
I love abominations, that's all we have lately. Quite popular. My comments/observations:

I yell at EE's all the time: "The fuse comes first". You have it in the middle so there's no coverage for a short on +UNREG feed or U4 etc. Put the fuse first at DC IN+.

The water detect circuit is better done using a quad comparator like LM339 or TS339 instead of TL074. (LM339B is the revised part)
A single supply at 5V is all you need, you do not need to generate a -5V rail for it. Just need output pullup resistors. Then D10, D16, R24, R35, R8, R22, R26 can be deleted as well as the -5V circuit U1.
The water sensor circuit is not done right - it should have an input cap used so you get no DC leakage current at the electrode. If there is iron and copper or something making -0.4V it will corrode due to D15/D19 being on all the time.
Same for probe outputs, a 0.1uF cap is used there because your square wave is never perfect 50-50 duty cycle and corrosion happens. I'd add LED's to show each electrode Water_In_1,2 status.

The drive resistor for the BCP56 is a bit too high at 10k, I would lower it to 2.2-3.3k for more base drive.
You don't need such a big fat diodes SS24 across the relay coils even BAV99 is enough.

MAX6675 is sensitive to RF. A cellphone/WiFi etc. near the thermocouple wiring will cause crazy readings. So you need RF filtering on the input: ferrite beads, caps and dedicated 2-pin terminal block for the TC. I don't like the IC, I said more  here but did not try the newer MAX31856 although it looks equally awful (note: cannot ground TC).

'328PB already has a watchdog built in. Using the external one SP706, it does not (hardware) disable the heater/boiler relays if it trips so I don't think it's any safer. Also, it nuisance trips and gets in the way during programming, you need a resistor/jumper to disable it.
The heater/boiler already should have limit switches PLC safety control and not cause a bad happening if the demand for heat/boiler relay gets say stuck on due to a failure of this board.

I don't know what "phase chopping control" is. If it's mains AC phase control, don't you need AC zero-cross coming in to the MCU?
ENC_A,B usually have low value pullup resistors and caps for ESD but you have something for the switch- it seems odd.

You need lots of PCB copper heatsinking for the 5V reg especially with two LED displays and relay loads.
Not sure what DC_IN is for voltage but using say 12V relays powered from that will offload the 5V reg.
 

Offline ShayTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: il
Re: Design review of a temp/timer/water-level control circuit
« Reply #3 on: November 08, 2024, 11:20:57 pm »
I guess that TL074 is an opamp, but drawing a quad opamp as a single rectangular box is such an abomination that I closed the pdf.
Well, I can't blame you. But this is what EASYEDA has and I still havent gotten around to create a new proper schematic symbol. Short on time. I do agree with your opinion 100%.


I love abominations, that's all we have lately. Quite popular. My comments/observations:

I yell at EE's all the time: "The fuse comes first". You have it in the middle so there's no coverage for a short on +UNREG feed or U4 etc. Put the fuse first at DC IN+.

The water detect circuit is better done using a quad comparator like LM339 or TS339 instead of TL074. (LM339B is the revised part)
A single supply at 5V is all you need, you do not need to generate a -5V rail for it. Just need output pullup resistors. Then D10, D16, R24, R35, R8, R22, R26 can be deleted as well as the -5V circuit U1.
The water sensor circuit is not done right - it should have an input cap used so you get no DC leakage current at the electrode. If there is iron and copper or something making -0.4V it will corrode due to D15/D19 being on all the time.
Same for probe outputs, a 0.1uF cap is used there because your square wave is never perfect 50-50 duty cycle and corrosion happens. I'd add LED's to show each electrode Water_In_1,2 status.

The drive resistor for the BCP56 is a bit too high at 10k, I would lower it to 2.2-3.3k for more base drive.
You don't need such a big fat diodes SS24 across the relay coils even BAV99 is enough.

MAX6675 is sensitive to RF. A cellphone/WiFi etc. near the thermocouple wiring will cause crazy readings. So you need RF filtering on the input: ferrite beads, caps and dedicated 2-pin terminal block for the TC. I don't like the IC, I said more  here but did not try the newer MAX31856 although it looks equally awful (note: cannot ground TC).

'328PB already has a watchdog built in. Using the external one SP706, it does not (hardware) disable the heater/boiler relays if it trips so I don't think it's any safer. Also, it nuisance trips and gets in the way during programming, you need a resistor/jumper to disable it.
The heater/boiler already should have limit switches PLC safety control and not cause a bad happening if the demand for heat/boiler relay gets say stuck on due to a failure of this board.

I don't know what "phase chopping control" is. If it's mains AC phase control, don't you need AC zero-cross coming in to the MCU?
ENC_A,B usually have low value pullup resistors and caps for ESD but you have something for the switch- it seems odd.

You need lots of PCB copper heatsinking for the 5V reg especially with two LED displays and relay loads.
Not sure what DC_IN is for voltage but using say 12V relays powered from that will offload the 5V reg.

Thank you floobydust for your super helpful comment.
1. Your opinion on the fuse sounds very logical. I have indeed fixed it.
2. Water level detector - basically utilize ac coupling capacitor to remove all DC and replace the osciliator and detector itself with a quad comp which reduces the risk of electrolysis and saves bom. Will re-design it according to your notes very soon.
3. Altough BCP56 has decent gain of 200 at 100C I have reduced the base resistor per your suggestion in order to increase base drive to not be on the limit.
4. The choice of SS24 is because I have a large reel of them already on hand.
5. I will research and improve the filtering on the input of the TC ics. Kinds shitty that they dont specifiy a typical "industrial" application as it is common to use thermocouples on industrial stuff.
6. I have removed the watchdog and maybe I will use the built-in. Yes there is another layer of protection.
7. By phase chopng control I mean providing one cycle of the sine wave, than waiting for another cycle, than turning it on, to get 50% power, kinda like PWM.
The SSR which would be utilized have a circuit inside them to only switch ON at 0 cross and switch OFF at 0 cross. So I dont think I need to detect for 0 cross, as the SSR will do it
8. Fixed the encoder wiring as you noted
9. The UNREG is about 24V and I plan to design a 4 layer board with a power plane so heatsinking should be OK but 24V relays cost about the same so its a good idea to change them to 24V one.

I will make the changes and update here. Thank you very much for your help.
 

Offline jwet

  • Frequent Contributor
  • **
  • Posts: 625
  • Country: us
Re: Design review of a temp/timer/water-level control circuit
« Reply #4 on: November 08, 2024, 11:58:39 pm »
A couple more constructive comments-

Consider using a small switching converter vs. a linear- dropping 19+ volts across a linear is rough- you can get a module that's almost as simple as a linear.

Fuse should be upstream of the linear...

Relay drivers- add a pull down before or after the base resistor and reduce value.  AVR's wake up with the port pins tristated, nice to disable all with hardware during power up/wd overlow, etc.  Better yet, consider something like ULN2003, 25 cent parts that included 7 driver circuits with all the R's and clamp diodes.  They take 30v (see below).  In narrow SO16.

Consider using 24v relays from your unreg supply.   24v relays are cheaper, more available and won't load down your logic supply.  The overall power will be the same, the 24v relays have higher resistance.

Since you're using a MEGA328A micro, consider adding or supporting Arduino download.  Its pretty simple might be a nice long term thing for others.  There isn't much to it hardware wise- ac coupled reset and ??.  Bootloader in firmware.  Keep the ICSP, much better overall.

Make provision to disable watchdog with a single jumper.  You can't debug with a WD timer- pain.  When you get to final design, you could make a it a cut trace type jumper, etc but during development, make it easy.

All I see right off.  Do a board layout and have it made quickly.  Beat it up and plan to spin it before the final.  You'll do this anyway for some dumb error (no offense).  This way your first real board will be clean.  Good luck.
« Last Edit: November 09, 2024, 12:12:47 am by jwet »
 

Offline ShayTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: il
Re: Design review of a temp/timer/water-level control circuit
« Reply #5 on: November 18, 2024, 07:50:19 pm »
Okay, I have managed to update the schematic according to your wonderful suggestions.
I hope the ADS1220, with the filtering I implemented, will be reliable enough.

I would like to know if there is anything else that comes to mind.
« Last Edit: December 01, 2024, 10:28:38 pm by Shay »
 

Offline ShayTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: il
Re: Design review of a temp/timer/water-level control circuit
« Reply #6 on: December 01, 2024, 10:29:14 pm »
PCB is almost done
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7644
  • Country: ca
Re: Design review of a temp/timer/water-level control circuit
« Reply #7 on: December 02, 2024, 12:11:16 am »
My thoughts so far:
The NUP2105L CANBUS protection diodes clamp high at 30V so I think they are no use - the A/D will be dead by then.
Why is the ADS1220 not running off 5V? The MCU is 5V. The LED display will make a noisy 5V though. I would filter AVDD.
I'd use 10nF on the encoders including the pushbutton switch. I don't think you can combine both encoders A and B signals, one will always have a contact closed. If you are short on I/O perhaps the serial for the two displays could be combined on one bus.

LED resistors are way too low R13, R14, R9, R19 etc. 500R for 24V makes smoke. I use 10-20k.
Comparator oscillator - R25 seems to be in the wrong spot, it should pullup the comparator's output pin and 10k is too high for two wet electrodes. I would use 1-2k2.
Like I keep saying the 7805 is going to roast powering two LED displays.
 

Offline ShayTopic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: il
Re: Design review of a temp/timer/water-level control circuit
« Reply #8 on: December 02, 2024, 07:29:09 pm »
My thoughts so far:
The NUP2105L CANBUS protection diodes clamp high at 30V so I think they are no use - the A/D will be dead by then.
Why is the ADS1220 not running off 5V? The MCU is 5V. The LED display will make a noisy 5V though. I would filter AVDD.
I'd use 10nF on the encoders including the pushbutton switch. I don't think you can combine both encoders A and B signals, one will always have a contact closed. If you are short on I/O perhaps the serial for the two displays could be combined on one bus.

LED resistors are way too low R13, R14, R9, R19 etc. 500R for 24V makes smoke. I use 10-20k.
Comparator oscillator - R25 seems to be in the wrong spot, it should pullup the comparator's output pin and 10k is too high for two wet electrodes. I would use 1-2k2.
Like I keep saying the 7805 is going to roast powering two LED displays.

Thanks for your wonderful replies.

- I replaced the CANBUS protection diodes with a 5V type TVS.

- The ADS1220 is now running on the 5V bus. I had a different IC before that required 3V3 max, and I think I didn't notice that the ADS1220 can be powered from 5V just fine. It also saves a 3V3 regulator!

- I have added the contact noise bypassing capacitors you recommend, and you are right that two encoders in parallel won't work well; a good catch. I fixed it.

- Increased led resistors

- Indeed, I forgot a pull-up on the open collector comp, won't work without it :)

- The 7805 would disspate about 5-6W maximum, which is indeed quite toasty, so I replaced it with one of those all-in-one DC/DC module. I also added some input ovp with a beefy tvs I have on hand.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf