Any evident failures/better ways?? - Page 1
Forum section: electronics / beginners

author: jemarro12
author_rank: Contributor
timestamp: June 21, 2024, 09:56:33 pm
content: Hello everybody, i´m developing my first pcb to control a carWash machine. Is there any evident failure in this design?? Attach Kicad Schematic. Thanks!!

author: xvr
author_rank: Frequent Contributor
timestamp: June 22, 2024, 09:18:16 pm
content: First one - common wire for all relay should be connected to +12V (not to GND)Next - if buttons will be installed NOT at PCB itself (but on some external pannel and wired by lobg wire) some kind of ESD protection for all inputs very desirable.Also I didn't see any indicators (except duplicate of relay state), some kind of LED/LCD/OLED may be helpful.

author: BeBuLamar
author_rank: Super Contributor
timestamp: June 22, 2024, 09:48:46 pm
content: Are you doing this to control a real car wash machine or just an exercise?

author: BillyO
author_rank: Super Contributor
timestamp: June 22, 2024, 11:00:25 pm
content: I would insert opto-couplers between the microcontroller and the relay driver so that the MCU can be completely isolated. Those relays will be making a lot of electrical noise and bouncing teh ground like a basket ball.

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 12:33:16 pm
content: Thanks to every of you guys who expend your time in a really noob project like this...Yes, this is gonna be installed in a real car wash machine (I hope). My grandpa runs and old car wash in the village and the old PIC relay boards which run the machine are getting down.I'm changing from GND to +12V for common pin of ULN2803A and it seems to work on breadboard.Related to ESD input protection in GPIO, yes, there gonna be 4 buttons connected with 500mm cable long from the PCB to the front panel. Which type of rad protection do you recommend??I'm implementing these changes and I'll share new kicad, this is my first PCB and assume many mistakes are gonna be made...

author: xvr
author_rank: Frequent Contributor
timestamp: June 23, 2024, 01:24:02 pm
content: For ESD protection you can take a look here -https://www.st.com/resource/en/application_note/an5612-esd-protection-of-stm32-mcus-and-mpus-stmicroelectronics.pdfPage 13

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 03:09:00 pm
content: Following your suggestions here is implementation of photocouplers between MCU and ULN2803A, also implemented RELAY STATE LEDS in this section.Attach pic.R21, R22, R23, R24 are pull down resistors for the ULN2803A, with these i hope only 0 / 1 digital states will be present.R17, R18, R19, R20 are series resistor to drive low current orange LEDs from 3.3V.

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 03:26:19 pm
content: Is this implementation of ESD protection proper for a push button??If i understand correctly C5 and R15 conforms a RC filter (10k/0.1uF) to debounce the input signal, R14 is just a pull up resistor to maintain logic 1 when no SW6 pressed. Is R25 value correct?? Which is its inteneded use??Thanks!!

author: xvr
author_rank: Frequent Contributor
timestamp: June 23, 2024, 03:43:33 pm
content: R25 value is correct - it limit inrush current when ESD protection will be activated (by TVS), because TVS limit input surge voltage, but it still much more than allowed MCU input .RC net parallel to button intended to reduce EMI influence to button input

author: BillyO
author_rank: Super Contributor
timestamp: June 23, 2024, 03:55:14 pm
content: Quote from: jemarro12 on June 23, 2024, 03:26:19 pmNo, they are there to increase noise immunity. The de-bounce is done in your software.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 23, 2024, 03:59:38 pm
content: If you're going to use external relays I'd definitely research how to properly control relays. Eg: how to deal with back-emf and what possible driving circuitry is out there. Smart high side switches for example.I'd also recommend reading up on IEC 60204 for machine safety, it's not a complicated standard. It's just a long list of (hopefully obvious) things you should think about when building machines.If the buttons are external I'd recommend reading up on iec 61131 for the minimal amount of current required to register activation.Some switch contact platings require a minimum voltage/current and you want to avoid noise registering as an input.This also looks like something you can utilize an Arduino opta for, completely eliminating the need for custom hardware. But that may not fit your needs.

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 04:24:52 pm
content: For now with the addition of PC847 photocoupler as shown in last pics and ULN2803A as darlington array i think it´s enough to drive relays safely. Am i Wrong??Related to the input side i´ve some ESD protection as some of you suggested.This is how it looks with the changes you suggested, i´ve added connector for external switches and 1000mA polyfuse.

author: BillyO
author_rank: Super Contributor
timestamp: June 23, 2024, 04:29:38 pm
content: As long as the continuous current draw of the relays is under 500mA this should be fine.Since this is going into an industrial setting it would not hurt to read those safety standards though. You don't want anything unfortunate to happen.I'd also like to add that you should probably not use the same 12V supply for the relays as you do for teh rest of the circuit.

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 04:43:30 pm
content: I use 12VDC only to drive relay coils, using step-down LM2596S-5 I get 5V to feed MCU and the rest of the circuit.What do you mean about using same supply for all the circuit?Relating to the MCU, do you think ESP32-S3-DEVKIT is a strong option (10euro with Stepdown and usb circuitry built-in) to run a non-critical application 24/7?

author: BillyO
author_rank: Super Contributor
timestamp: June 23, 2024, 04:49:54 pm
content: You have 12V supplying the LM2596S-5. That 12V should not be the same as the 12V for the relays. The relays will produce a lot of electrical noise with very high frequency components. If you use the same supply, that noise will make it through the regulator and into the lower voltage supplies.You could do this with almost any MCU that has enough I/O. It's not going to be very compute intensive.BTW, where are you getting the 3.3V?Also, note that the PC847 cannot be used as a high side switch. You need a resistor from Vcc to the collector and the emitter goes to ground. Then you take the output from between the resistor and the collector. Have a look at the test circuit in the datasheet.

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 05:23:44 pm
content: I´m confused about 12V noise, how can i isolate that noise? Two different AC/DC power supplies it´s not an option.I want only one 12VDC source and then all isolation related made on board.Now i´m implemeting basic level shifter to read 4x5VDC inputs from electronic coin wallet and process them as 4 digital inputs more to drive the relays.Basic machine, 4 DIN from coin wallet, 4 DIN from HMI Frontpanel, 4DOUT to relays.Do you think i should implement ESD protection as done with user push button, also with signals from external coin wallet??

author: BillyO
author_rank: Super Contributor
timestamp: June 23, 2024, 06:07:03 pm
content: I don't know what an "external coin wallet" is.For noise suppression you could try a fairly large (1mH) choke followed by a fairly large capacitor (1000uF).Also, you still need to rationalize your opto-isolation configuration. See below.(Updated)

author: jemarro12
author_rank: Contributor
timestamp: June 23, 2024, 07:14:58 pm
content: How coul I calculate R3 value in your example??I'm also going to study adding that cap and coil.

author: BillyO
author_rank: Super Contributor
timestamp: June 23, 2024, 07:51:57 pm
content: Assuming you are using red LEDs and you are still going to use 220 ohms for them, then:less than about 20*(3.3-0.7)/((3.3-1.7)/220) = 52/(1.6/220) = 7,150 ohms, so 5K will work fine.

author: VinzC
author_rank: Frequent Contributor
timestamp: June 24, 2024, 01:53:43 pm
content: Since you're using only 4 outputs from the darlington stage (ULN2803), I'd suggest a ULN2003 instead. Its specifications are identical for the most part and you'll be wasting one output less (it has 7 outputs instead of 8 ). There may also be a slight difference in cost. Besides both are pin-compatible (align the smaller socket down relative to the larger one).However:Quote from: jemarro12 on June 23, 2024, 03:09:00 pm(referring to the schematic) I wouldn't parallel those darlingtons. Since there's no way to actually balance the current across transistor pairs, a more viable solution is to find a buffer with larger capabilities... that is only if you need more than 500mA per channel.