microcontrollers  - Page 1
Forum section: electronics / beginners

author: mkube396
author_rank: Regular Contributor
timestamp: January 09, 2020, 05:15:04 pm
content: At my Work we have a tester it has 4 24v air solenoid to control 1 air actuator and to pressurizer and vent vales under test for leaks.I have took it upon myself to rip out the old mortised system and replace it with a micro controller to make it more reliable and safer. But i want to build it on a bread bored first.Now i am guessing a triac transistor to switch the 24 Volts AC on the air solenoid will work fine but will i have trouble with the 3.3v or do i need 5v? can i drive the triac right from the outputs of the micro controller?i was thinking of using a STM32 micro controller do they make software that can simulate the controller so i can practice programming it?the process ishit start peddlethe tester then clamps the Valvepressurizes the valvehold under presser for 10 secwhen getting a single from the peddle will continue to next step.Vent pressureunclamp valve.

author: rstofer
author_rank: Super Contributor
timestamp: January 09, 2020, 05:23:22 pm
content: From Google search 'microcontroller triac'https://www.st.com/content/ccc/resource/technical/document/application_note/ce/e4/e4/c5/d3/bf/4c/c7/CD00003868.pdf/files/CD00003868.pdf/jcr:content/translations/en.CD00003868.pdfYou don't need anything remotely resembling an STM32F <whatever>, an Arduino would be a much easier board to use for beginners. You could ultimately use an Arduino Nano plugged into a daughter card if you wished OR you could program the DIP chip on the UNO board and just use the chip itself in your final design.Simulation is not a big feature of uCs. Program and try is the more common approach.Read that paper closely, you may need a 5V Arduino and the 28 pin DIP version of the UNO is, I believe, 5V.You need to study up on optoisolators. There is a tendency to want to tie the input switches and output triacs directly to pins. That doesn't often turn out well in industrial applications.

author: grumpydoc
author_rank: Super Contributor
timestamp: January 09, 2020, 05:39:11 pm
content: Hate to pour cold water on this project but...What happens when your device malfunctions and holds the production line up, what happens if your device malfunctions and someone is injured?In the right circumstances this sort of project could cover you with glory.In the wrong circumstances (somewhat more likely) you will be out of a job and on the wrong end of an expensive lawsuit.

author: mkube396
author_rank: Regular Contributor
timestamp: January 09, 2020, 05:53:08 pm
content: Quote from: grumpydoc on January 09, 2020, 05:39:11 pmThat is nothing i need to worry about right now it don't have an E -Stop as it is and it is malfunctioning right now.. i'm not going to sue my self

author: mkube396
author_rank: Regular Contributor
timestamp: January 09, 2020, 06:03:56 pm
content: Quote from: rstofer on January 09, 2020, 05:23:22 pmI have use optoisolators in my radio projects still have a Big Bag of them i used them to keep RF out of the Computer when using Digital modes.so i am thinking i can use the optoisolator off the micro controller in to a 2n2222 then in to a triacs unless the optoisolator i have can do the work by there self. ill have to fined the data sheet on the optoisolator i have.Yeah that's why i am bread boarding all of this and going to run all of it though its tests before it gets installed..

author: rstofer
author_rank: Super Contributor
timestamp: January 09, 2020, 06:06:27 pm
content: The right way to do the job is with an industrial rated Programmable Logic Controller (PLC). All inputs and outputs will be appropriate for the application and since outputs are usually relays (variations do exist), driving the solenoids directly is really easy. Yes, this is the way to do the job.OTOH, once you know the states (read up on state machines and C switch() statements) required for the operation (and you seem to have a start above but consider how to handle possible invalid situations), you can code that transition table in a C switch() statement. Arduino provides delay functions if these help.HOWEVER:There are hundreds of PLCs, I searched for a 24VAC PLC and came up with this at Newarkhttps://www.newark.com/crouzet-automation/88974044/controller-plc-8-i-p-4-o-p-24vac/dp/64R1068The programming software is cheap (in comparison)https://www.newark.com/crouzet-automation/88970111/millenium-3-software-cd-rom/dp/76M8857?MER=sy-me-pd-mi-acceThere is a cable to connect the PC is pricey but not outrageoushttps://www.newark.com/crouzet-automation/88970109/usb-programming-cable/dp/86K0477?MER=sy-me-pd-mi-acceHere's the thing, learning C or PLC programming takes about the same amount of time so it's a toss-up. The difference will come up when spending hours to design the hardware and get a PCB laid out. My time is $100/hour (not that anybody paid me that) so it doesn't take much time designing custom stuff before it is just better to buy fully qualified equipment and be done with it.Yes, the Arduino will be a learning experience and is well worth the time/expense. Actually applying it is not likely to be as successful as you might hope. I would definitely go with the PLC and learn to program in both environments.Using ladder logic as your PLC design scheme means the system is almost portable to ANY PLC. I would say EVERY but, somewhere, there will be a PLC that doesn't take ladder logic. I have never seen one, I have never even read about one, but that doesn't mean one doesn't exist. The thing about ladder logic is that it is as portable as it gets.

author: mkube396
author_rank: Regular Contributor
timestamp: January 09, 2020, 06:35:14 pm
content: I want to say away from PLC controls because i want to be able to do other projects with them at home with the micro controllers.I stress this is equipment I or the boss only use for off line testing.when i was in School and i have used PLC controllers there sweet and where easy to program. but i just want to lean how to do this.I can even skip the triac and run it off 12v Relays to switch on the solenoid.. I do have a few TO-220 Switch transistors.

author: grumpydoc
author_rank: Super Contributor
timestamp: January 09, 2020, 08:01:04 pm
content: Quote from: mkube396 on January 09, 2020, 05:53:08 pmOK, sounds like it is your call.An Arduino and relay board is probably the easiest approach.