ebook img

Arduino Stack Exchange: Questions and Answers PDF

761 Pages·2016·15.54 MB·English
by  Duckett
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Arduino Stack Exchange: Questions and Answers

Table of Contents About this book Arduino Uno (85 questions) Programming (37 questions) Serial (36 questions) C++ (21 questions) Sensors (19 questions) Pins (15 questions) Uploading (14 questions) Library (14 questions) Timers (13 questions) Power (12 questions) ATMega328 (12 questions) Compile (11 questions) Shields (11 questions) Arduino Mega (11 questions) Arduino Ide (10 questions) Interrupt (10 questions) LED (9 questions) PWM (9 questions) C (9 questions) Avrdude (9 questions) Battery (8 questions) IDE (8 questions) Motor (8 questions) Voltage Level (8 questions) Attiny (8 questions) Arduino Yun (7 questions) Safety (7 questions) Arduino Nano (7 questions) AnalogRead (7 questions) LCD (6 questions) Arduino DUE (6 questions) Sketch (6 questions) Hardware (6 questions) Bootloader (5 questions) Time (5 questions) Software (5 questions) I2c (5 questions) Button (5 questions) Memory Usage (5 questions) Linux (4 questions) Clones (4 questions) Variables (4 questions) Flash (4 questions) EEPROM (4 questions) Sram (3 questions) Arduino Uno SMD (3 questions) Temperature Sensor (3 questions) PROGMEM (3 questions) Electricity (3 questions) GSM (3 questions) Emulation (2 questions) Enclosure (2 questions) Tcpip (2 questions) Oscillator Clock (2 questions) IR (2 questions) Web Service (1 question) Project (1 question) RFID (1 question) Osx (1 question) Copyright About this book This book has been divided into categories where each question belongs to one or more categories. The categories are listed based on how many questions they have; the question appears in the most popular category. Everything is linked internally, so when browsing a category you can easily flip through the questions contained within it. Where possible links within questions and answers link to appropriate places within in the book. If a link doesn't link to within the book, then it gets a special icon, like this . Arduino Uno Questions Q: Is an Arduino capable of running 24/7? Tags: arduino-uno (Next Q) I'm making a simple Arduino web server and I want to keep it turned on all the time. So it must endure to stay working continuously. I'm using an Arduino Uno with a Ethernet Shield. It's powered with a simple outlet power supply 5V @ 1A. My Questions: Will I have any problems leaving the Arduino turned on all the time? Is there some other Arduino board better recommended for this? Are there any precautions that I need to heed regarding this? Tags: arduino-uno (Next Q) User: butzke Answer by sachleen You shouldn't have any issues keeping it on all the time, however, some thing to consider is any counters you may have, like the use of millis(). From the Arduino docs on millis : This number will overflow (go back to zero), after approximately 50 days. So for projects that are on for long periods of time, you may not see an issue immediately but something like this could pop up and cause errors down the road. Answer by matthew-g. A couple of things to keep in mind (outside of @Sachleen's mention of Milli's): Like any electronics, heat can be disruptive. The microcontroller itself isn't likely going to be a huge issue from the perspective of heat, but other components like the power supply might cause issues. If your code uses EEPROMWrite , be aware that the EEPROM is only rated for something in the neighbourhood of 100,000 writes. Answer by thedoctor Keep in mind that the flash and EEPROM have limited lifetimes (about 10,000 read/write cycles) so if you're doing a lot of reading and writing to those, they may become corrupted. In a test I did, an external EEPROM took about 3 days to start becoming corrupted. Tags: arduino-uno (Next Q) Q: How to pause Arduino for 1 millisecond through MATLAB? Tags: arduino-uno (Prev Q) (Next Q) I have been able to connect MATLAB to my Uno with this line of code: a = arduino('COM4'); through this package: Matlab support package for Arduino . Right now, MATLAB is my main script that will synchronize all the components [like the Arduino]. I am able to send pulses to my stepper-motor just by using: void loop() { digitalWrite(2, HIGH); delay(1); digitalWrite(2, LOW); delay(1); } This works fine, and will make the motor move about once every 2 milliseconds. My problem is that I cannot find a way to produce this same delay through MATLAB's interface. I do know that MATLAB has a pause() function, but when I set up a loop in MATLAB like this: a = arduino('COM4'); for m = 1:400 a.digitalWrite(2, 1); pause(0.001); a.digitalWrite(2, 0); pause(0.001); end Each step takes WAY longer - about 200 milliseconds each. What are other options for creating the pause between digital High / Low being sent to the Arduino? It would be nice if I could control the outcome from Matlab, through Arduino. Tags: arduino-uno (Prev Q) (Next Q) User: radical-fanatic Answer by mpflaga The increased in observed delay is due to the time it takes to send the command from MATLAB to the Arduino have its code execute the requested command. In your case the a.digitalWrite. So actual time between pulses using MATLAB's delay is 0.001 pause plus the time of baud rate times the packet size and decoding then execution. I would recommend not pursuing this solution of the MATLAB controlling the timing of Step Motors, remotely. As this latent coupling will be a frustrating limitation. Noting that for step motors the timing can not afford such latent execution. Hence all the 3D printers and many CNC with Step Motors use Arduino's which get G-Code (motor move commands with destinations) and the Real-time firmware handles the stepping, within tolerances. I would suggest using something like grbl firmware with step motor shield and then have the MATLAB send the needed G-code. Where there are others with much more features but tailored to 3d Printing. grbl is simpler and straight to the point of moving motors. Tags: arduino-uno (Prev Q) (Next Q) Q: How do I figure out if my board is approaching end of life? Tags: arduino-uno (Prev Q) (Next Q), safety (Next Q) I have a uno that I have been using for 3 years now. I will be using it again in a rather critical project in which failure on the part of the board could be rather expensive and dangerous. So, I would like to be sure that the board is not approaching end of life or going to fail anytime soon. Is there any reliable way to figure out how long the board will function without failing or reduction in performance? Tags: arduino-uno (Prev Q) (Next Q), safety (Next Q) User: asheeshr Answer by connor-wolf Unfortunately, there isn't much way to really determine "wear" in the context of solid-state electronics. Probably the things that are most likely to fail are the electrolytic capacitors and the connectors. First, if you're using an ATmega CPU for something that could possibly injure someone CONTACT ATMEL AND TALK ABOUT SAFETY PRECAUTIONS. The ATmega CPU used in most of the arduino models is not rated for use in such situations. In EVERY datasheet: Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Now, realistically, this is probably mostly lawyer repellent, but you should still take appropriate precautions. Really, while there isn't anything on a common arduino board that really wears out except the connectors, why are you trying to save $30 at a potential huge cost? Just buy a new board. I'd also strongly reccomend you chose a board with a SMT ATmega328P, since that removes the IC socket contacts from the list of concerns. If possible, also remove the pin-headers, and solder wires to the board directly. Try to minimize connectors, since they are frequent points of failure. Answer by asheeshr One of the sections of the Arduino that is likely to become unreliable over time is its memory. There are three pools of memory in the microcontroller used on avr-based Arduino boards: Flash memory (program space), is where the Arduino sketch is stored. SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs. EEPROM is memory space that programmers can use to store long-term information. The memory is one part of the board that can be checked and verified, and thus evaluated for reliability/health. A very basic way to check memory would be to write a certain 8-bit pattern (byte character) over every address in the memory and then read the value present from every address. If the value that was written matches the value that is read, then that specific 8 bit block in memory is functioning correctly at the present moment. Wear in ROM memory usually occurs in a blockwise pattern i.e. n*8-bit blocks become degraded over time. So, for a 2K byte ROM chip, the health of the chip can be estimated by writing and reading from every byte on the chip, and calculating the percentage of correctly functioning blocks. If the percentage of failed blocks is significant (15%-20%), that means that the memory is likely to fail soon. The test code can be written using separate methods for each of the memory sections. SRAM Any variables declared statically or dynamically are allocated on the SRAM. So, Any variables declared statically or dynamically are allocated on the SRAM. So, we could declare a large character array (~2000) and fill every element with 255 (all bits 1). Then, we could attempt to read each of those elements and see if the value being read is indeed 255. EEPROM The EEPROM can be manipulated using the EEPROM library . The library provides functions to read and write from specific locations in the EEPROM. So, all memory addresses can be tested by simply looping over the entire memory space. This operation will require 500 writes and reads. Depending on the board usage, EEPROM is most likely to fail first but is not critical to board operation. Flash Data can be stored on the flash memory using the PROGMEM directive. Similar to SRAM, a large array can be declared and initialized here. Then, values can be read and checked. Tags: arduino-uno (Prev Q) (Next Q), safety (Next Q) Q: Does Arduino Uno R3 require cooling in a closure? Tags: arduino-uno (Prev Q) (Next Q), enclosure (Next Q) I was looking at getting an enclosure to house my Arduino Uno R3, but I'm not sure if I should also attach a fan. Does anyone have experience with this? It doesn't look like much heat is being generated, but with no ventilation except some slits in the enclosure, there won't be much air circulation without a fan. My concern with adding a fan was the fact that I'd need to power it. Tags: arduino-uno (Prev Q) (Next Q), enclosure (Next Q) User: b.k. Answer by jippie The only times I had an AVR run hot was when I applied reverse power to it.

Description:
If you have a question about Arduino Stack Exchange this is the book with the answers. Arduino Stack Exchange: Questions and Answers takes some of the best questions and answers asked on the arduino.stackexchange.com website. You can use this book to look up commonly asked questions, browse questio
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.