element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum is arduino reliable for industrial environment for industrial application?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 52 replies
  • Answers 25 answers
  • Subscribers 397 subscribers
  • Views 7999 views
  • Users 0 members are here
  • dil
Related

is arduino reliable for industrial environment for industrial application?

Former Member
Former Member over 11 years ago

hi all,

i have used arduino uno to make datalogger for industy.i used sd card,rtc,lcd and some basic ic in my circuit.plz do rply.is it reliable to use arduino in industry?

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 9 years ago +6 suggested
    Hello everyone, my name is Daren. I am an Engineer and Arduino software developer. This is the question I started asking when I had clients that needed specialized automation systems for industrial applications…
  • dougw
    dougw over 11 years ago in reply to mcb1 +3 suggested
    I hate to contradict, but can't leave people with an incorrect impression of the ATmega328. This chip does have a watchdog timer and it even has a programming lock for software security. The watchdog can…
  • Robert Peter Oakes
    Robert Peter Oakes over 11 years ago +2 suggested
    Agree with Michael Arduino is an echo system to allow rapid development and education without having to get out the soldering Iron for instance, the boards in general lack the protection circuits often…
Parents
  • Former Member
    0 Former Member over 9 years ago

    Hello everyone, my name is Daren. I am an Engineer and Arduino software developer.

    This is the question I started asking when I had clients that needed specialized automation systems for industrial applications. I liked the Arduino IDE and had my eyes set on the Due but had no idea what I was getting myself in to. Before I begin to share my experiences and attempt to answer the question of Arduino’s suitability within a large industrial control environment, I should first preface my answer with some insight about the hardware.

     

    Firstly, the Arduino Due is the only board that even comes close to being useful for industrial applications; at least for the main control board. The Uno and Mega are fine for collecting sensor data from remote areas and sending the readings/thresholds to a more capable board via Ethernet for the main logical processing. The primary reason is that the Due is Arm Core 32-bit and doesn’t have the global variable restriction like the Mega for example. The Mega can only have around 200 or so declared variables before it won’t compile which is ridiculously tiny; compared to the Due which can have thousands of variables, only restriction being the flash memory itself. The Due doesn’t have a global variable memory allocation limit like the Mega. That introduces a HUGE increase in software capability that blows the Mega away; the Mega is also very laggy with big sketches even if well written. The Due can handle more than 15,000 lines of code without even breaking a sweat and tops out at somewhere around 26,000 lines and handles an AMAZING 54 interrupts compared to a measly 6 on the Mega which is perfect for complex systems.  If your automation system has 26,000 lines of code I hope its mopping the floor too. There are also more powerful Arduino IDE compatible microcontrollers made by Texas Interments and Intel but I don’t have any experience with those and the Due so far has been more than powerful enough.

     

    Another thing worth mentioning is that the Due has no user programmable EEPROM, which makes it seemingly useless for industrial applications, right? Wrong, use the SD card to save all variable states in a prudent interval or under certain conditions and then load all the variables back from the SD upon boot-up. A guy named Alex Shu (http://overskill.alexshu.com/saving-loading-settings-on-sd-card-with-arduino/) made a wonderful example how to very easily and effectively store and recall variables from/to the SD card and its way more simple and effective than using an EEPROM and can have 4GB+ of data.

     

    And lastly, in a big factory often sensor inputs or control outputs will not be close enough to the microcontroller to be effective and usually even a Due will not have enough GPIOs to accommodate a complex environment. So we have resolved this by using Ethernet shields to transmit encoded data to and from all the Due’s, Mega’s and Uno’s throughout the environment. So you can use as many microcontrollers as you need to accommodate your specific needs. We use Telnet servers and clients on the various boards to send the encoded signals between the remote Arduinos and main Arduino(s). Would you believe that Arduino can run multiple telnet server at the same time? It CAN, we used a Telnet server (port 23) on the main board to interface with it, look at logs, start stop machines, etc. and use other ports like 22 on a second Telnet server running on the SAME board to be used only for sending / receiving encoded signals between the networked microcontrollers. This is amazing, you can have many Arduino’s even thousands of feet away (over fiber optic or wireless bridge) from each other sending and receiving signals and threshold data in <10ms intervals before things start to breakdown due to buffer overflow. 10ms intervals is more than low enough for nearly all applications. We have ran at least 4 Telnet servers on a single Due with no problem. I can Telnet into the Due, send commands to the Due that will then trigger a relay on another Arduino over yet another Telnet connection. We have done all of this in large factories with more than 100 IOs spread across 5+ Arduinos, no problem. The important thing to note is that Ethernet or TCP/IP is not going to be susceptible to noise and interference on long sensor runs in the same manner that a GPIO circuit would be. If anyone wants to know how to use Telnet in this manner, let me know. I'm happy to help.

     

    Moving on, the most predominant issue with using Arduino for industrial applications will be interference and likewise inaccurate readings or erroneous pin input signals. You may find in a complex environment that if powering the microcontroller with your laptop everything is fine, then when you power it with an external power supply everything is not fine, and or when your relays trigger something with high current your readings will suddenly become erratic. This leads me to my main point which is that Arduino by itself is neither appropriate nor inappropriate for industrial applications; it is simply a microcontroller, a CPU stamped on to a piece of PCB with conductors leading to and from it. Its incoherent to assert that Arduino by itself inherently is or is not appropriate for industrial applications. That being said, in my professional opinion some Arduinos are of excellent quality and reliability, excellent thermal characteristics an tolerance (40c is not even close to being an issue) and its totally up to all the supporting terminals, components and electronics that determine its industrial worthiness; and of course the manner in which the software is written. But the platform itself I don’t believe is inherently unsuitable for the purpose industrial applications; it’s just a CPU that runs embeded C with IO pins. Sure there are more professional solutions but the price of doing it with Arduino is attractive, the reliability can be obtained, the Arduino IDE has its advantages, the available sensors to choose from is immense and the supporting community is awesome. It is the amalgam of rapid prototyping and production readiness.

     

    Additionally there are purpose built Arduino IDE compatible industrial PLC boards that are what they say, end of discussion.

    http://www.e-gizmo.com/KIT/PLC64.html

    https://industruino.com/page/home

     

    But, to pursue implementation of a general purpose board a multi-channel Opto isolator board is highly recommended for IOs on the microcontrollers that have sensor input to your environment.

     

    Like this:

    http://www.ebay.com/itm/8-channel-Opto-Isolator-board-5-24VDC-in-3-3-5VDC-out-Industrial-FRC-Arduino-/131874890430

    or this:

    http://www.ebay.com/itm/311520477631

     

    In my experience I have never gotten Arduino to work properly when not powered by a USB cable from a computer unless I isolated the input power from the utility power. Every time I used a regular 220v to 12v switching power supply or wall type transformer sensors were always flaky or didnt work at all. If your sensor reading are erratic, there is interference coming from your power source.

     

    • Use a standard inductive type transformer (like 230v AC to 24v AC)
      • This is to isolate the AC circuit and eliminate noise from contaminating IO signals on the microcontroller.
      • It should physically not be less than 1 meter from the microcontroller.
      • Preferably ground the transformer casing and input neutral line to copper grounding rod or if in USA run to ground.
    • Then use a bridge rectifier with a capacitor (like 50v DC 2200 µf or greater)
      • This is to convert the AC to DC. Rectifiers still output AC without a capacitor.
      • 5pcs 10A 1000V Metal Case Bridge Rectifier Sep KBPC1010 New | eBay
      • 10 Pcs 2200uF 2200MFD 50V Electrolytic Capacitor 105 Degrees USA Free Shipping | eBay
      • This is superior to using wall type AC to DC transformer.
    • Then use a DC to DC step down voltage regulator or DC to DC buck-booster to achieve the correct voltage.
      • This is to conform and regulate the 24v DC to 6-11v DC needed for Arduino regulated input.
      • I’ve found that a Due runs most reliable @ 11v DC if you use the Tip&Ring regulated input.
      • http://www.ebay.com/itm/311552007557 this is an adjustable 5 Amp step down regulator bucker. Use this to feed a breadboard regulator @ 7v (750-1000ma Max) or use two of them to drive the Due and Breadboard combined circuit @ 3.3v and 5v @ 5000ma respectively.
      • Remember to connect all 3.3v and 5v grounds together.

     

    • Alternatively you can power the Arduino Due directly by feeding the breadboard power regulator output directly to the unregulated 3.3v and 5v pins on the Due. This is better for certain applications because the breadboard power supplies are quite powerful (can run 40+ closed relays) and simplify the wiring and everything will using a common circuit and you wont have any resistance from feeding the system from two dissimilar regulators (which can cause the on-board regulators to overheat). Meaning to say that power is only applied from one source; from the breadboard power regulator to all devices and the Arduino via the 5v and or 3.3v pins. Use multiple breadboard power regulators if needed. Preferably measure the current coming out of the power regulator to the breadboard to see if your getting close to one amp, if so add additional breadboard power regulators.
      • http://www.ebay.com/itm/MB102-Breadboard-Power-Supply-Module-3-3V-5V-For-Arduino-Solderless-Breadboard-/261951177988  .75 Amp
      • http://www.ebay.com/itm/MB102-Breadboard-Power-Supply-Module-3-3V-5V-1A-for-Arduino-Raspberry-Pi-/182085149923 This one is very nice, 1Amp from USA.
      • Alternatively, you could skip the inductive transformer, rectifier, capacitor, and step down and just use an isolated bucker like this: http://www.ebay.com/itm/DC-5V-1A-AC-to-DC-Power-Module-Supply-Buck-Converter-LED-Bare-Plate-Isolation-5W-/400896507245 with this you could only power the Arduino itself and breadboard but you couldn’t drive a breadboard regulated power module because it needs at least 7v DC to work I’ve found and you’d also be limited to 1 Amp @ 5v. this wouldn’t work good for Due because you need both 5v for sensors etc. and 3.3v for GPIO circuits. Specifically then this would work fine for Due: http://www.ebay.com/itm/12V-1A-5V-1A-Dual-Isolation-AC-DC-Power-Supply-Buck-Converter-Step-Down-Module-/122020902277 it has both 3.3v and 5v dual power isolation but your limited to 1 Amp. That’s probably fine for most applications unless you have more than 40 relays etc.

     

     

    Don’t underestimate this, power and noise caused %99 of all problems we encountered during our research and development. Not only that but some sensors will fail to operate correctly with even the slightest drop in voltage which will occur if you only use power provided by the Arduino itself and have more than only couple things plugged in. The Arduino power regulator put out only something like 140ma and the Due’s CPU itself consumes most of it.

     

    • Use ONLY Opto coupled relays for output and use those relays to control bigger relays that control the actual motor, solenoid, contactor etc.
    • Even with an Opto coupled relay, large solenoid coils can make Arduino do funny things. The inrush current feeding the solenoid coil creates an electric field going through relay that not even an opto coupled relay can protect the microcontroller from, always use an opto coupled relay that then connects to yet another relay located physically away from the microcontroller that will control devices with high inrush current or for ANY 110v/220v device.
    • Always use 22 gauge SOLID core wire or larger for sensors. It is highly not recommended to use 26 gauge Ethernet cable, or 26/24 stranded wire for sensors
    • Remember that long wires are like antenna, use shielded cable 24+ gauge wire for long runs.
    • With proper cable and software filtering you should have no problem going 100 ft or more to read signals feeding INPUT_PULLUP pins with excellent reliability. For extremely noisy environments use single or double opto couplers and for long runs. To be honest, we have long runs in noisy environments and have no issues even without input opto couplers but wiring makes that difference, withstanding certain situation will always require one or more opto couplers on a giver circuit.
    • Also consider using RS-485 Arduino adapters for your long runs or noise problematic circuits.
    • Use standoffs to keep the Arduino from touching the backboard its mounted to.  1/4" PE tubing cut into short pieces works great for standoffs. Use on top and bottom and sandwich the Arduino in between the two cut pieces of tubing.
    • For very noisy signals use long debounce thresholds, like 1000-2000ms

     

    Another thing that is absolutely critical for using Arduino in industrial applications is software signal filtering and debouncing. Look at the example below:

     

    NEVER use the “delay” command except for ultrasound (which uses delayMicros). Always use millis()

     

      if (digitalRead(button6) == LOW) {

        if (button6ReadingPrep == true) {

    button6LastDebounceTime = millis();

    button6ReadingPrep = false;

        }

        if (millis() - button6LastDebounceTime > buttonDebounceDelay) {

          button6State = true;

        }

      } else {

    button6ReadingPrep = true;

      }

     

    Then if this is a toggle scenario you can further filter out bogus readings by an additional %50 by disabling that input until the opposing input has been toggled.  Like this:

     

    If (button6Toggle == true) {

      if (digitalRead(button6) == LOW) {

        if (button6ReadingPrep == true) {

    button6LastDebounceTime = millis();

    button6ReadingPrep = false;

        }

        if (millis() - button6LastDebounceTime > buttonDebounceDelay) {

          button6State = true;

          button6Toggle = false;

        }

      } else {

    button6ReadingPrep = true;

      }

    }

     

    Then if the next stage reaches it condition the “button6Toggle” becomes "true". This is also a way to reduce CPU usage and bogging by terminating unneeded comparisons. Use subroutines often and use the "return" command whenever a process finishes before the end of the loop. contrary to what some developers suggest, the return command is unquestionably beneficial for use in Embedded C on CPU limited hardware. Contrary to what some people claim, Arduino is neither C nor C++; it is embedded C which is its own thing. Traditional rules of C dont always apply nor are always prudent. Microcontroller programming is it's own world and thats why it has it's own language.

     

    Another note, would be to make sensors achieve a quorum of consistency with its readings given a margin before action is taken. Like this:

     

    tankSystemPermeateUltraSoundDuration = pulseIn(tankSystemConfigPermeateEchoPin, HIGH);

    tankSystemPermeateUltraSoundDistance = tankSystemPermeateUltraSoundDuration / tankSystemConfigPermeateEchoValue;

          if (tankSystemPermeateUltraSoundDistanceCount == 0) {

    tankSystemPermeateUltraSoundDistanceFilter = tankSystemPermeateUltraSoundDistance;

          }

          if (tankSystemPermeateUltraSoundDistance == tankSystemPermeateUltraSoundDistanceFilter || tankSystemPermeateUltraSoundDistance + 1 == tankSystemPermeateUltraSoundDistanceFilter || tankSystemPermeateUltraSoundDistance - 1 == tankSystemPermeateUltraSoundDistanceFilter) {

    tankSystemPermeateUltraSoundDistanceCount += 1;

          } else {

    tankSystemPermeateUltraSoundDistanceCount = 0;

          }

          if (tankSystemPermeateUltraSoundDistanceCount == 3) {

    tankSystemPermeateUltraSoundDistanceFinal = tankSystemPermeateUltraSoundDistanceFilter;

    tankSystemPermeateUltraSoundDistanceCount = 0;

          }

    tankSystemPermeateUltraSoundReadingStep2 = true;

    tankSystemPermeateUltraSoundReadingStep3 = false;

        }

     

    Basically here, the “tankSystemPermeateUltraSoundDistanceFinal” is result of 3 consistent readings that were within at least 1cm of each other.

     

    Another word of advice from experience, use waterproof enclosures to seal your microcontrollers and connect your microcontroller box to another input output wiring enclosure. I live in the Philippines and its always hot, wet and damp, very dirty power and fluctuation; everything gets pushed to the extreme here.

     

    I recommend using 66M1-50 (66-Block) punch down blocks for input and output connection and connect the two enclosures together using RJ-21 cable/connectors. That will allow you to quickly detach the microcontroller box from the wiring box for service.

    http://www.ebay.com/itm/25-pair-Telco-Cable-Cat-3-PBX-KSU-RJ21-AMP-connectors-M-F-6Ft-/121812808381

     

    These are the best enclosures. Made by Gewiss, they can be partially unscrewed and then swung open, very convenient. You can easily drill holes for buttons and displays.

    http://www.ebay.com/itm/PLASTIC-ENCLOSURE-TERMINAL-BOX-ADAPTABLE-GEWISS-GW44209-300X220X120MM-/262494746306

     

    Use bullet terminals to easily detach enclosure from power sources.

     

                    If your looking for the Pro way to do this, DON’T use a breadboard, that always has the potential to be flakey. Buy your own female/male Dupont terminals and a crimp tool so you can make your own connections from Arduino pins using your own 22 gauge wire with dupont terminal and then punch the the other end into a 66 block, then screw all the ground leads to a common ground screw terminal using fork/spade terminals. This insures that all input ground leads are solidly connected to ground, that all inputs/outputs easily are reroutable via the 66 block and that you have 22 gauge wire all the way from Arduino to the sensor, switch, whatever. Those dupont wires are such crap, 28gauge wire and the pins are flaky. If you follow this suggestion you can have 100+ IOs and not get bogus readings and if you have expensive pumps, motors or critical safety sensors you'll have wiring you can depend on. Always write your software so safety/critical switches are configured in a NORMALLY CLOSED configuration, that way if you have a wiring failure you can check the sensor before the system even starts.

     

    In closing, we have automated factories that have more than 100 IOs with sensors more than 40m away. Arduino is reliable and serves us well. Embedded C language is very well suited for automation and we have been very pleased with the results. Our sketches are in excess of 14,000 lines of code. As a core I recommend Due or grater, be careful how you write your code, make as few concurrent comparisons as needed and if you need to have many concurrent elapsed time counters, use a common global timer and use comparators to compare start times and ending/current times. I have written a very simple global timer/comparator, I know time calculations can be tricky so just ask if you need it.

     

    I'm sure I’m forgetting some things but I hope this helps. If anyone has any questions or needs help feel frees to ask. If you have a specific environment you need help creating I can give you general guidance. I know how to make Arduino rock soiled for industrial applications and I'm willing to share that with anybody in need. And of course, if anyone has learned cool things please feel free to share aswell. If anyone knows about RS-485 interfacing for example, id love to learn more about that…

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • marek.buriak
    0 marek.buriak over 9 years ago in reply to Former Member

    Hello Daren,

     

    thanks for some useful information. Great to see Due being used in such installations. I am planning on using it for my home automation and I got a few questions if you don't mind answering them.

    1. A switch on a long wire. So let's say you have Due on one side of the room and a switch quite a few meters away. You mention that you usually just use a shielded 24+awg wire. Is that directly connected to Due pin with internal pullup on? I am guessing that normally the line is pulled down to GND (normally closed circuit) and when switch is pressed, circuit opens and the line is pulled up to 3.3V. Is that how you connect it? A long wire can cause significant voltage drop so could not it happen that if the circuit is closed the voltage on input will not drop below the threshold (2V) due to voltage drop on that long wire and the pin will stay high? Also are you not afraid that a voltage spike (I guess it can happen even though the cable is shielded) will damage Due's input pin?I guess I would at least go with something like this at a minimum if connecting directly. But considering optocouplers are much more safe I'll probably go with them for inputs and outputs.

     

    2. I must say I got a bit lost when reading about different options for powering Due and sensors. So I'll ask this way. What's the best way of powering Due and external sensors from the noise perspective? Is it better to be powered from the same source or from different ones? I am planning on using Mean Well 230V/5V (like PS-05-5 (5W) or PS-15-5 (15W)) to power Due via usb connector. So Due will be powered via on-board 3.3V regulator. Now, some sensors are 3.3V, some are 5V. Considering Due's regulator would probably not be able to power all 3.3V sensors, I guess I need a dedicated regulator for them (a linear one, like AMS1117 3.3V). That should hopefully also help with noise that Due and sensors put back onto their power lines. 5V sensors would be powered directly from the Mean Well supply and I am not really sure about that. Mean Well supply is a switching one (albeit it should be a quality one). I fear that the switched output will cause erratic readings from the 5V sensors. Would I be better off starting with let's say a 7V power supply, feeding that to DC power input of Due (which has it's own 5V switching and 3.3V linear regulator) and also to a 5V linear regulator for powering 5V sensors. Output of that 5V linear regulator would also be used for powering a 3.3V linear regulator for 3.3V sensors. Thoughts? image

    Btw. "Alternatively you can power the Arduino Due directly by feeding the breadboard power regulator output directly to the unregulated 3.3v and 5v pins on the Due.". According to documentation, "Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.". Just sayin'.

     

    3. From reading I get you connect Due via Dupont connectors. Do you find it reliable? I mean they must be wobbly at least a bit. The best thing would be to solder the wires directly to Due's pins but it's fiddly and makes Due not really replaceable. So I think the second best thing is to make a shield that uses pin headers. Pins on those are a bit thicker than dupont pins (so hopefully a better connection) and the shield won't wobble (it's also used as a way to connect arduino in products like this).

     

    Marek

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • marek.buriak
    0 marek.buriak over 9 years ago in reply to Former Member

    Hello Daren,

     

    thanks for some useful information. Great to see Due being used in such installations. I am planning on using it for my home automation and I got a few questions if you don't mind answering them.

    1. A switch on a long wire. So let's say you have Due on one side of the room and a switch quite a few meters away. You mention that you usually just use a shielded 24+awg wire. Is that directly connected to Due pin with internal pullup on? I am guessing that normally the line is pulled down to GND (normally closed circuit) and when switch is pressed, circuit opens and the line is pulled up to 3.3V. Is that how you connect it? A long wire can cause significant voltage drop so could not it happen that if the circuit is closed the voltage on input will not drop below the threshold (2V) due to voltage drop on that long wire and the pin will stay high? Also are you not afraid that a voltage spike (I guess it can happen even though the cable is shielded) will damage Due's input pin?I guess I would at least go with something like this at a minimum if connecting directly. But considering optocouplers are much more safe I'll probably go with them for inputs and outputs.

     

    2. I must say I got a bit lost when reading about different options for powering Due and sensors. So I'll ask this way. What's the best way of powering Due and external sensors from the noise perspective? Is it better to be powered from the same source or from different ones? I am planning on using Mean Well 230V/5V (like PS-05-5 (5W) or PS-15-5 (15W)) to power Due via usb connector. So Due will be powered via on-board 3.3V regulator. Now, some sensors are 3.3V, some are 5V. Considering Due's regulator would probably not be able to power all 3.3V sensors, I guess I need a dedicated regulator for them (a linear one, like AMS1117 3.3V). That should hopefully also help with noise that Due and sensors put back onto their power lines. 5V sensors would be powered directly from the Mean Well supply and I am not really sure about that. Mean Well supply is a switching one (albeit it should be a quality one). I fear that the switched output will cause erratic readings from the 5V sensors. Would I be better off starting with let's say a 7V power supply, feeding that to DC power input of Due (which has it's own 5V switching and 3.3V linear regulator) and also to a 5V linear regulator for powering 5V sensors. Output of that 5V linear regulator would also be used for powering a 3.3V linear regulator for 3.3V sensors. Thoughts? image

    Btw. "Alternatively you can power the Arduino Due directly by feeding the breadboard power regulator output directly to the unregulated 3.3v and 5v pins on the Due.". According to documentation, "Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.". Just sayin'.

     

    3. From reading I get you connect Due via Dupont connectors. Do you find it reliable? I mean they must be wobbly at least a bit. The best thing would be to solder the wires directly to Due's pins but it's fiddly and makes Due not really replaceable. So I think the second best thing is to make a shield that uses pin headers. Pins on those are a bit thicker than dupont pins (so hopefully a better connection) and the shield won't wobble (it's also used as a way to connect arduino in products like this).

     

    Marek

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • michaelkellett
    0 michaelkellett over 9 years ago in reply to marek.buriak

    The solution in your link would not be reliable.

    Typical micro-controller pins require to be pulled down to less than 20% of the supply to register a low input or above 80% to register  a high.

    To achieve this:

    Change the pull up resistor to 10k and keep the input resistor at 1k.

    The 10uF cap across the switch is too large and may shorten the life of the switch (this will depend on the switch of course - if using small pcb button type switches replace it with a 1uF 50V (or greater) ceramic capacitor which can be wired either way round.

    The 20M input resistor is far too big(so the micro pin will be susceptible to interference and leakage currents)  - the diodes will limit the input voltage even under fault conditions to less than 2V above or below the supply rails - you need to limit the current into the micro's input protection diodes to less than 1mA so that 20M could be 2k and you would be no less protected. I would use 10k which means that the micro input 'sees' source resistance of 20k (switch open) and 10.9k (switch closed).

    The ferrite ring is often helpful - put both wires though the same one.

     

    Although opto-couplers can be helpful the LED in them can still be damaged by transients and might even be energized by RF picked up in long wires. They are much tougher than a typical micro-controller input. The disadvantage is that they need power on the input side and unless you use isolated supplies for this you lose quite  alot of the advantage. For home automation I don't think you need optos.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • marek.buriak
    0 marek.buriak over 9 years ago in reply to michaelkellett

    Thanks for your comments Michael. The switch will be a normal wall switch that you use to switch 230V lights in regular home installations (home automation has to be reversible) so I won't be using a capacitor on the switch end. 20M resistor is inside the microcontroller so you can't do much about it image I guess it's just for illustration. I still feel I need to protect Arduino Due as my main controller a bit more, it's always easier to replace an opto than the whole board. I plan on using isolated power supplies, 12V (or 24V) on the switch side, 5V/3.3V on the controller side. I think 3.3V is too low voltage to be used on long wires as a pull-up voltage. Anyhow, I came up with this circuit, feel free to comment on it. I will probably include a ferrite ring as well.

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 9 years ago in reply to marek.buriak

    I would use 4k7 rather than 47k for R2, and make sure the opto-coupler transfer ratio is greater than 20%.

     

    If D1 and D2 are transient absorber type devices they will be much more effective than normal zener diodes.

     

    I doubt that the micro really has a 20M resistor inside but as an input the leakage current is quite low.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • marek.buriak
    0 marek.buriak over 9 years ago in reply to michaelkellett

    Thanks for your input Michael. D1, D2 were meant to be some Schottky diodes but I can specifically look for transient absorber ones.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube