Dataset Viewer
Auto-converted to Parquet Duplicate
Id
stringlengths
1
5
Tags
stringlengths
3
75
Title
stringlengths
15
150
CreationDate
stringlengths
23
23
Body
stringlengths
51
27.6k
Answer
stringlengths
42
31k
1
|arduino-uno|web-server|ethernet|
Is an Arduino capable of running 24/7?
2014-02-11T22:24:09.530
<p>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. </p> <p>I'm using an Arduino Uno with a Ethernet Shield. It's powered with a simple outlet power supply 5V @ 1A.</p> <p>My Questions:</p> <ul> <li>Will I have any problems leaving t...
<p>It certainly can run 24/7. I either use 5V to the 5V pin, or a 7808 to the Vin pin to offload the vreg. Ideally it would be 6.5V, but I don’t have such supplies. You may want a decoupler cap on 5V though, to soak any minor spikes when powering up your supply.</p> <p>Any hardware attached which runs at 5V, I feed wi...
4
|ethernet|arduino-yun|web|
How to get HTTPS on Arduino?
2014-02-11T22:43:08.173
<p>Put plainly: is there a way to get an HTTPS connection on the Arduino?</p> <p>I have been looking in to it, and I have found it is impossible with the standard library and the Ethernet shield, but is there a custom library that can do it? </p> <p>What about a coprocessor, i.e. like the WiFi shield has? Anyone know...
<p>Using of WiFi shield can be a solution - it supports HTTPS. </p> <p><a href="https://www.arduino.cc/en/Reference/WiFi101" rel="nofollow noreferrer">https://www.arduino.cc/en/Reference/WiFi101</a></p>
6
|power|battery|
What are (or how do I use) the power saving options of the Arduino to extend battery life?
2014-02-11T22:48:30.837
<p>For solar &amp; battery powered projects, decreasing power consumption is a necessity.</p> <p>I know a little bit about using a timer and interrupt to put the microcontroller into sleep when it isn't doing anything.</p> <p>I have also read that you can disable some peripherals to further save power.</p> <p>Here i...
<p>Once your project is working and you need to deploy to "production" environment, you can opt to replace the Arduino with a bare meta ATMega328 or any of the ATTiny family chips. This will get rid of all the power eaters on the Arduino board you don't need. I found: </p> <ul> <li>Arduino board of 9V block battery - ...
14
|arduino-yun|linux|bootloader|
Yún boot from SD card
2014-02-11T23:57:39.350
<p>I have an Arduino Yún, and it only has 16mb flash onboard for the Linux. I was wondering of it is possible to put a bootloader on the flash that uses the sd card as a rootfs? i want to be able to do more projects on it than those that can fit in 16 MB flash.</p>
<p>And the Arduino team finally figured it out:</p> <p><a href="http://blog.arduino.cc/2014/05/06/time-to-expand-your-yun-disk-space-and-install-node-js/" rel="noreferrer">http://blog.arduino.cc/2014/05/06/time-to-expand-your-yun-disk-space-and-install-node-js/</a></p>
17
|uploading|avrdude|faq|
"avrdude: stk500_getsync(): not in sync: resp=0x00," aka Some Dude Named Avr Won't Let Me Upload My Program
2014-02-12T00:08:14.933
<p>I made an awesome program the other day, and I wanted to upload it to my Arduino. After clicking the upload button, some mean dude named avr came along and stopped me, saying:</p> <blockquote> <p>avrdude: stk500_getsync(): not in sync: resp=0x00</p> </blockquote> <p><em>All</em> I want to do is just upload my pr...
<p>If you use <code>arduino-cli</code> and a Arduino Nano clone, you can change the bootloader to the old one, as said in other answers, by using the following command to upload to the Arduino:</p> <pre><code>arduino-cli upload -v -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328old program_name </code></pre> <p>Ex...
25
|severino|reset|
Why Arduino Severino (S3V3) sometimes needs reseting when uploading a sketch?
2014-02-12T00:49:24.257
<p>I have an original Arduino UNO R3 that I bought and an <a href="http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3" rel="nofollow">Arduino Severino (S3V3)</a> that I've built.</p> <p>I have no problems uploading sketches to the UNO, but sometimes, when uploading to the Severino board, I have to hard reset it ...
<p><strong>Why does that happen?</strong></p> <p>When the serial port is opened by either monitor, avrdude or other it toggles the DTR pin of the serial port. Which in turn is AC coupled through C4 100nF. This toggling is converted to a up and down pulse on the ATmega(CPU)'s RESET pin. The subsequent reset starts init...
26
|severino|serial|
Custom Arduino board beeps and process freezes while I'm uploading a sketch to it. Why?
2014-02-12T01:10:46.997
<p>The strangest thing is happening to a standalone Arduino board that I designed and built. The board (whose schematics are below) has the following features:</p> <ol> <li>It has a ATmega328P with a 5V voltage regulator and usual circuitry when set up as a standalone controller. </li> <li>It controls a scoreboard wit...
<p>I finally found what was causing the problem: the reset signal from pin 4 (DTR - Data Terminal Ready) on the DB9-Female connector was spiking up to 10V before going to 0V and was triggering high-voltage programming on the ATmega. Below is a scope shot showing the situation:</p> <p><img src="https://i.stack.imgur.co...
27
|time|millis|
How do I get an accurate time?
2014-02-12T01:34:28.287
<p>I've made a clock using an Arduino, but the time seems to drift. I am aware of the <a href="https://arduino.stackexchange.com/questions/1/is-an-arduino-capable-of-running-24-7/2#2">rollover</a> issue; the clock seems to drift by about 15 minutes over the course of a week.</p> <p>I'm using a custom PCB with <a href...
<p>You do not need an RTC to build a clock: the ATmega chip has all the hardware needed to perform the duties of the RTC itself. Here is how:</p> <ol> <li><p>Get a 32768&nbsp;Hz watch crystal: either buy it or disassemble an old clock. These crystals, specifically designed for time keeping, have an <em>extremely</em> ...
28
|arduino-uno|matlab|
How to pause Arduino for 1 millisecond through MATLAB?
2014-02-12T01:37:23.670
<p>I have been able to connect MATLAB to my Uno with this line of code: <code>a = arduino('COM4');</code> through this package: <a href="http://www.mathworks.com/matlabcentral/fileexchange/32374-matlab-support-package-for-arduino-aka-arduinoio-package" rel="noreferrer">Matlab support package for Arduino</a>.</p> <p>Ri...
<p>It's not clear from your question whether you are trying to get real-time execution without latency or simply want to adjust the motor delay time from MATLAB. If the latter, a good way is to send delay data (e.g. a number that represents how long you want between pulses) vie serial, which your Arduino program will ...
36
|web-service|
Post Data To a Web Service From Arduino
2014-02-12T02:59:15.323
<p>If you want to submit sensor data such as temperature to a remote server/database somewhere you need to use some kind of call to a web server since it isn't possible to connect directly to a database from the Arduino.</p> <p>How do you post data to a JSON web service from an Arduino that's connected to the Internet...
<p>Check <a href="http://playground.arduino.cc/Code/WebClient" rel="nofollow">this</a> from Arduino docs. </p> <p>In the "Post method request" code example just define your JSON as plain text like <code>char jsonData[] = "{name: 'yourName', data: 'yourData'}"</code> for example, and then call <code>byte postPage(char*...
37
|compile|sketch-size|avr-gcc|gcc|
Is there a preprocessor constant for memory size
2014-02-12T03:05:17.680
<p>I would like my compiles to exclude some code depending upon the flash/program space available. To be used in the demo code of a library I support. Whereas my current solution is to use a #ifdef of processor type. But I would like to be more general and not have to specify all the various chips. Rather it would be n...
<p>Find the <code>io__.h</code> file for your microcontroller, on Linux it is located in <code>/usr/lib/avr/include/avr</code>, on Windows it will be in a somewhat similar location.</p> <p>Scroll down to the part that says <code>/* Constants */</code>. There are couple interesting macros defined there, <code>FLASHEND<...
39
|ethernet|arduino-uno|shields|
Arduino Uno R2 and Ethernet Shield R3 compatibility
2014-02-12T04:10:06.223
<p>I bought an <a href="http://arduino.cc/en/Main/ArduinoEthernetShield" rel="noreferrer">Ethernet Shield R3</a> for my <a href="http://startingelectronics.com/articles/arduino/uno-r3-r2-differences/" rel="noreferrer">Arduino Uno R2</a>, but since R3 has extra pins it does not fit. Can I use the shield? Should I cut of...
<p>The only issue that may create an incompatibility seems to be the IOREF pin next the 5V output pin which is extra on Revision 3 but not in Revision 2.</p> <p>However, I just had a look at the board schematics and the shield does not use IOREF.</p> <blockquote> <p><img src="https://i.stack.imgur.com/hOkcc.png" al...
40
|programming|arduino-ide|c++|ide|
What are the other IDEs for Arduino?
2014-02-12T04:22:30.253
<p>The basic Arduino IDE lacks a lot of the sophistication present in other IDEs such as code completion, code collapsing, folder organisation, etc. Are there other IDEs that allow programming in C or C++ and improve on these aspects?</p>
<p>I use Eclipse and Sublime Text for editing Arduino code, and I build in the Arduino IDE with it set to "external editor" mode, or using the Arduino Command Line tools. Eclipse has a fantastic indexer and makes understanding the Arduino core much easier. I've written a detailed PDF about using and setting up Eclipse ...
42
|software|avr-toolchain|
Assembly on the Arduino: IO registers
2014-02-12T04:24:33.670
<p><strong>Question:</strong> What registers do I use to access the IO on the Arduino Uno when I am using assembly for programming?</p> <p><strong>Background:</strong> I was interested in practicing my assembly language skills on the Arduino (I thought it would be easier to turn LEDs on/off than to worry about consol...
<p>The datasheets for the AVR microcontrollers are reasonably good to read. Just Google for the exact controller on your Arduino (eg. ATmege328) and find the "Complete" datasheet on the <em>atmel.com</em> website. Don't download the "Summary", it doesn't include a lot of information. Download the datasheet from atmel.c...
52
|arduino-uno|safety|reliability|
How do I figure out if my board is approaching end of life?
2014-02-12T04:54:51.720
<p>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 ...
<p>One of the sections of the Arduino that is likely to become unreliable over time is its memory. There are <a href="http://arduino.cc/en/Tutorial/Memory" rel="nofollow noreferrer">three pools of memory</a> in the microcontroller used on avr-based Arduino boards:</p> <ul> <li>Flash memory (program space), is where the...
57
|web-service|
What's the best way to put in a database sensors data's
2014-02-12T05:21:37.753
<p>I have not already started to try but I'm a good webmaster and I'm just asking which way is more suitable for sending and keeping data from sensors and I/0 state in a database.</p> <p>Here are some points:</p> <ul> <li>Post versus get</li> <li>MySQL or others types</li> <li>Security layers</li> <li>Graphics render...
<p>It depends on your skills and what you have in your Arduino "box". Let's assume you have an ethernet or WiFi shield.</p> <p>I would go with a PHP script (I'm a PHP dev, but any language will fit) that accepts POST requests sent by the board and store them in a SQLite db.</p> <p><strong>Why SQLite instead of MySQL?...
61
|emulation|testing|
Can I program for Arduino without having a real board?
2014-02-12T06:15:47.017
<p>I would like to start the development of some basic Arduino projects but I don't own an Arduino board yet. Is there a way I can write my code and emulate/test it using a desktop computer so after my board arrives I just have to upload and run my project on it?</p>
<p>An alternative to simulators are services similar to online compilers like <a href="http://coliru.stacked-crooked.com/" rel="nofollow noreferrer">coliru</a>, which allow users to build and run their code on a remote system. This approach has the same limitations as online compilers:</p> <ul> <li><p>The hardware conf...
71
|clones|
Compatibility between Arduino and Arduino clones
2014-02-12T07:22:41.363
<p>In a project I am using a Seeeduino v3.0 as an Arduino clone. On the seeeduino website it says that </p> <blockquote> <p>It is based on the Duemilanove schematic, 100% compatible to its existing program, shield and IDEs.</p> </blockquote> <p>In fact I never had any problems with shields or the IDE.</p> <p>My qu...
<p>I have found that most clones will do what you expect them to do, but as <a href="https://arduino.stackexchange.com/users/32/x4mer">x4mer</a> states in his <a href="https://arduino.stackexchange.com/questions/71/compatibility-between-arduino-and-arduino-clones#answer-90">answer</a>, be prepared.</p> <p>The most ann...
74
|arduino-uno|enclosure|
Does Arduino Uno R3 require cooling in a closure?
2014-02-12T07:36:18.303
<p>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. ...
<p>No, You shouldn't need any type of cooling device such as a fan as long as the case has a few holes in order to allow the heat to rise out of the case. I do not recommend using cases that are completely sealed, unless you are using it in an environment that has things that could hard the Arduino such as ROVs or Nuc...
85
|serial|pins|uploading|arduino-uno|
Why can't I upload a sketch while other components/devices are connected to my Uno?
2014-02-12T10:22:23.107
<p>I wanted to make a fairly simple circuit which would flash a series of LEDs in sequence, using my Arduino Uno (more specifically, a SainSmart clone). I wrote my sketch and it compiled fine. After that, I connected 8 LEDS+resistors to pins 0 through 7, and then connected the Uno to my computer via USB.</p> <p>I've u...
<p>" Peter R. Bloomfield " I used to upload sketch in my arduino uno by connecting Rx and Tx pin but my sketch get uploaded. Actually problem is arduino uno driver may be deleted in your case</p>
88
|pins|arduino-uno|current|
Is there a limit on how much current a pin can sink?
2014-02-12T11:40:08.950
<p>I've been experimenting with an 8x8 LED matrix controlled by an Arduino Uno. As I think is typical, the matrix uses a common anode for each row, and a common cathode for each column. </p> <p>At the moment, I've got all the matrix pins connected directly to IO pins on the Uno, and I haven't had any problems lighting...
<p><a href="https://electronics.stackexchange.com/questions/67092/how-much-current-can-i-draw-from-the-arduinos-pins/67094#67094">I'm going to steal my answer from when I answered this question on the last arduino SE attempt.</a></p> <hr> <p>This is a bit complex. Basically, there are a number of limiting factors:</p...
91
|lcd|shields|
Is there a color LCD display for an arduino?
2014-02-12T12:43:33.707
<p>I currently have a Mega2560 with the LCD4884 Shield. The Shield is good for putting out text and simple pixel images. But I am wondering if there is something that has a full range of colours that would work with the Arduino? The screen size would only have to be a few inches in size.</p>
<p>Another very cool screen is the official <a href="http://store.arduino.cc/index.php?main_page=product_info&amp;products_id=288#.UwlAY_kiEw8" rel="nofollow">Arduino TFT LCD Screen</a>. (<a href="http://arduino.cc/documents/datasheets/A000096_Datasheet_HTF0177SN-01-SPEC.pdf" rel="nofollow">Datasheet</a> if you're curi...
96
|power|heat|
Why is the regulator very hot?
2014-02-12T13:41:46.053
<p>We have an LED strip connected to output 6 and is powered by the Uno board itself. Shouldn't be drawing too much current, only have 10 elements on the LED strip. While this LED strip is connected to the Uno, I noticed that the regulator is getting very hot.</p> <p>One thing we haven't done yet is to power the LED...
<p>When a circuit is hot, it's very likely that it is drawing too much current. It may be a component that's getting more current than it's designed for, or a PCB track, or a wire.</p> <p>So, before you do anything else, I strongly suggest that you get a DMM and measure the current drawn by the board when powering the...
105
|programming|python|
Programming an Arduino using Python, rather than C/C++
2014-02-12T15:31:17.143
<p>I am not very skilled with the C Language and I was wondering if there is a way in which python could be used to program an Arduino. This would most likely require a different IDE in order to be able to debug the scripts them self. </p>
<p>You gotta use pyfirmata because that's the only way to make your son a PRO engineer who makes robots. Also, python can do more advanced stuff so use pyfirmata.</p>
113
|time|millis|
Is it possible to find the time taken by millis?
2014-02-12T16:04:13.967
<p>The function <code>millis</code> would be running in the span of 100+ microseconds or less. Is there a reliable way to go about measuring the time taken by a single millis call?</p> <p>One approach that comes to mind is using <code>micros</code>, however, a call to <code>micros</code> will include the time taken by...
<p>If you want to know <em>exactly</em> how long something will take, there is only one solution: Look at the disassembly!</p> <p>Starting with the minimal code: </p> <pre><code>void setup(){}; volatile uint16_t x; void loop() { x = millis(); } </code></pre> <p>This code compiled and then fed into <code>avr-objd...
117
|pins|arduino-uno|
Is there a way to have more than 14 Output pins on arduino?
2014-02-12T16:42:31.307
<p>Is it possible to have more than 14 output pins on the Arduino, I am working on a project in which I need to light up several LEDs individually. I only have an Arduino Uno, and I don't want to get a Mega. </p>
<p>There is a wealth of good answers here, but if you costed your time you'd find it cheaper to buy a Mega.</p> <p>My 3/2-d worth.</p>
122
|library|
What are the steps involved in porting an Arduino library?
2014-02-12T17:28:00.757
<p>I want to use the <a href="http://learn.adafruit.com/adafruit-cc3000-wifi" rel="nofollow noreferrer">Adafruit CC3000</a> and its <a href="https://github.com/adafruit/Adafruit_CC3000_Library" rel="nofollow noreferrer">Arduino libraries</a> on another platform. In this case it's the Arduino pin compatible <a href="htt...
<p>I did essentially the same thing with getting the Adafruit ST7735 library working in chipKIT. <a href="http://forums.adafruit.com/viewtopic.php?f=47&amp;t=42966">I started a support thread here which can lead you through my process</a>.</p> <p>I tackled it the same way I do general programming:<br> 1-» Copy over Li...
129
|arduino-uno|atmega328|
Is my ATmega broken, and would replacing it with another break that one, too?
2014-02-12T21:54:44.307
<p>I was communicating between my computer and my Arduino Uno R3 through Bluetooth using <a href="http://www.mdfly.com/index.php?main_page=product_info&amp;cPath=8_47&amp;products_id=769&amp;zenid=6f2b3946847b73b5ef2185e5e756e498" rel="nofollow noreferrer">this Bluetooth module</a>. The connector I use has a red wire w...
<p>Besides breaking a pin while removing the IC from its socket, or static electricity during manipulation, I don't see what could fry the ATmega. </p> <p>However, it is possible that the R2 ATmega has a different bootloader and that may be an issue.</p> <p>If I was you I would just remove the ATmega from the R3 boar...
132
|pins|arduino-uno|
What are the AREF, IOREF, and the unlabeled pin next to IOREF on the Uno R3?
2014-02-13T00:17:38.463
<p>There are some pins on the Arduino which I haven't been able to find out anything about:</p> <ul> <li><code>IOREF</code></li> <li><code>AREF</code></li> <li>An unlabeled one next to <code>IOREF</code></li> </ul> <p>What are they?</p>
<p>Concerning the <code>AREF</code> pin, you have to remember that the Arduino comes with a 10bit ADC (Analog-Digital-Converter), which converts incoming voltages between 0V and 5V to integer values between 0 and 1023. This results in a resolution of roughly 4.8 mV.</p> <p>If a sensor only delivers a lower maximum vol...
136
|arduino-uno|revisions|
What is the difference between the revisions of the Arduino Uno board?
2014-02-13T02:04:23.007
<p>There are three different revisions of the Arduino Uno. What changed in each revision?</p>
<h3>User Side Changes</h3> <ul> <li>Both revision 2 and 3 boards add four solder pads (JP2) connecting to pins PB4 to PB7 of the USB ATMEGA.</li> <li>Revision 2 and 3 boards are both supplied with header pins in the USB ATMEGA ICSP header rather than just solder pads in the Arduino Uno.</li> <li>The revision 3 board ch...
141
|programming|software|
Programming options other than C++
2014-02-13T02:53:07.690
<p>Can I program my Arduino using any programming language other than C++? If so, which programming languages? What software would I need for compiling and loading my code onto the Arduino?</p>
<p>I'm surprised that nobody has mentioned <a href="https://www.microchip.com/webdoc/avrassembler/avrassembler.wb_instruction_list.html" rel="nofollow noreferrer">AVR Assembly</a>!</p> <p>Assembly is not often thought to be the most interesting, or even an easy method of programming, but it's nonetheless, 100% possibl...
142
|programming|
Code for one-time execution in Arduino
2014-02-13T02:56:18.943
<p><strong>Question:</strong> Where do I put code if I want it to execute only once per Arduino startup?</p> <p><strong>Background:</strong> I tend to use my Arduino to perform tasks that should be executed once per power cycle. (For example, my robot should only drive forward <em>once</em> every time I turn it on--m...
<p>I'm kind of confused by your question. You ask where you want to put once-per-startup setup functions, and then discuss the setup function. <em>That's what the setup function is for.</em></p> <p>As such, one-time setup functionality goes in the setup function.</p> <p>FWIW, if you look in the file that <em>calls</e...
143
|safety|
What I should be aware before I touch my Arduino?
2014-02-13T03:14:23.623
<p>Before you start to mess with a computer there are basic guidelines to be aware of, such as turn the power off and watch out for static electricity. What guidelines should I be aware of when I work with an Arduino board if I don't want to harm neither myself nor the board. The three kind of activity that requires to...
<p>One of the most common bad things I have seen is connecting LEDs directly to addition pins without a current limiting resistor.</p> <p>Basically, in electronics there are a few main sources of problems. Too much current, too much voltage, overheating, and physical damage.</p> <p>Too much current usually comes from...
156
|serial|arduino-due|
Connecting breakout board to Arduino with UART
2014-02-13T08:19:39.940
<p>I'm using a <a href="http://digistump.com/wiki/digix" rel="nofollow noreferrer">DigiX</a> (Arduino Due based 3.3V) board to connect to a GPRS/GSM SIM908 breakout board. The SIM908 EVB board has the following pins on its RS232:<img src="https://i.stack.imgur.com/zNZ90.png" alt="RS232 pinout"></p> <p>I've got all thr...
<p>Both the DigiX and the SIM908 are natively 3.3V boards. They should be able to connect to each other directly.</p> <p>For some reason, the SIM908 breakout seems to only offer RS232 level serial outputs for the GPRS and GPS. On U3 (the SIM908 module itself) Pins 68/71 offer 3.3V levels for the GPRS (GPRS-TXD and GPR...
158
|i2c|
How do I use I2C devices with Arduino?
2014-02-13T10:08:53.917
<p>I have a few useful I2C components, such as a 16-bit port expander (MCP23017), which I'd like to use in various projects.</p> <p>What do I need to do to make these work with Arduino? Will it work with any Arduino, or do I need a specific board or shield?</p>
<p>For future readers: use the Adafruit_MCP23017 library.</p>
168
|programming|arduino-ide|compile|
Why can't I declare a class in another tab in Arduino IDE?
2014-02-13T15:03:20.657
<p>I wanted to move some of my code out into a second tab in the Arduino IDE, to keep things better organised. At first, I only tried moving a function, and it seemed to work fine. I could call the function from the <code>setup()</code> function in my main tab, and there were no problems compiling or uploading.</p> <p...
<p>The way the Arduino IDE works is that it compiles your code (the code you write in the IDE) as the &quot;main&quot; code. Then it pulls code from all of the libraries you have imported and compiles that along with the main code. To do what you are suggesting would require you to create a library for Arduino.</p> <h3...
169
|arduino-nano|prototype|wires|
Is there a semi-permanent way to attach wires to the Nano?
2014-02-13T15:25:07.000
<p>At least for prototyping, is there a semi-permanent way to attach wires to the Nano posts?</p> <p><img src="https://i.stack.imgur.com/0n9s9.jpg" alt="Arduino nano"></p> <p>And yes, usually the Nano is hanging in free space by its wires (yes I know, quick and dirty, should be using something cleaner, even for proto...
<p><a href="http://www.aliexpress.com/item/Free-shipping-NANO-3-0-controller-Terminal-Adapter-for-NANO-terminal-expansion-board-for-arduino-Nano/1921109123.html" rel="nofollow">Here's what I use</a>, repeatedly, successfully. It fits the Nano headers, and gives you screw terminals for proto work.</p>
176
|serial|string|terminal|
How do I print multiple variables in a string?
2014-02-13T19:22:59.960
<p>Say I have some variables that I want to print out to the terminal, what's the easiest way to print them in a string?</p> <p>Currently I do something like this:</p> <pre><code>Serial.print("Var 1:");Serial.println(var1); Serial.print(" Var 2:");Serial.println(var2); Serial.print(" Var 3:");Serial.println(var3); </...
<p>I've been using PrintEx for years, and it works great. See <a href="https://www.arduino.cc/reference/en/libraries/printex/" rel="nofollow noreferrer">enter link description here</a></p>
179
|sketch|
Is there any way to download a sketch from an Arduino?
2014-02-13T21:23:36.390
<p>I made a sketch, but then I lost it. However, I uploaded it to the Arduino before losing it. Is there any way I can get it back?</p>
<p>Another approach might be to treat the program onboard the Arduino as a black-box exercise. That is, run the program and take careful notes of what happens (via Serial Monitor or whatever). If, in fact there is any output that you can observe, make it a task to create your own new code to emulate what the program DO...
188
|programming|arduino-uno|
What happens when I call exit() from my program?
2014-02-14T01:28:32.887
<p>In either of <code>setup</code> or <code>loop</code>, if I were to add an <code>exit(0)</code> call, where would control be passed to? What would the next state of the microcontroller be? Would it stop execution and power down?</p> <p>I am using a revision 2 Arduino Uno.</p>
<p>My initial guess is wrong. I would have thought it would simply return from loop and the core library would just call loop() again. However, I see the following code was created. Noticing that __stop_program is a hard loop...</p> <p>An extract of Blink.ino's listing, with exit(0) added:</p> <pre><code>// the loo...
189
|sketch|
What happens if there is a runtime error?
2014-02-14T01:33:03.127
<p>What happens if there is a runtime error in a program? Will execution of the program just stop? Is there some way I can get the Arduino to tell me what the error is?</p>
<p>I wrote an *.ino environment:</p> <pre class="lang-cpp prettyprint-override"><code>// Testing environment for Arduino sketch files. // Aduino IDE 2.3.0 // Author : Anders Munck // Released : 2024 02 09 #include &lt;iostream&gt; const bool LOW=false; const bool HIGH=true; const bool INPUT=false; const bool OUTPUT...
203
|serial|
Sending Large Amounts of Serial Data
2014-02-14T07:58:54.977
<p>So in the fields of robotics sometimes you need multiple boards and or computers linked together to share information or save statistical data. Currently I need to send a few different variables over a serial connection and was wondering what was the best way to go about doing such?</p> <p>So far I've determined th...
<h2>Send struct data across serial</h2> <p>Nothing fancy. Sends a struct. It uses an escape character '^' to delimit the data.</p> <h2>Arduino code</h2> <pre><code>typedef struct { float ax1; float ay1; float az1; float gx1; float gy1; float gz1; float ax2; float ay2; float az2; float gx2; float gy2; flo...
206
|safety|pins|led|resistor|
What happens to the Arduino if you don't use a resistor with an LED?
2014-02-14T12:06:10.727
<p>Making a blinking light seems to be one of the most common beginner projects with Arduino. A typical approach is to connect an LED + resistor (in series) to an IO pin, and connect the other end to ground. In code, you make the pin an output, and bring it <code>HIGH</code> and <code>LOW</code> repeatedly to flash the...
<p>I have done this once (being a beginner concerning electronics). The LED died, luckily the Arduino survived (without any pin problems).</p> <p>Wouldn't recommend this as it is not good for the Arduino.</p>
210
|arduino-uno|pwm|arduino-leonardo|analogwrite|
Why do some pins have a different PWM frequency?
2014-02-14T15:08:09.547
<p>According to the <a href="http://arduino.cc/en/Reference/AnalogWrite">Arduino reference for <code>analogWrite()</code></a>, the PWM frequency on most pins is ~490 Hz. However, it's ~980 Hz for pins 5 and 6 on the Uno, and for pins 3 and 11 on the Leonardo.</p> <p>Why are these different? Is it a deliberate design f...
<p>Those aren't the only frequencies available for the PWM signals. However, they are the frequencies as determined by the applied prescaler (which you can readily change as detailed below).</p> <p>Each of the 3 pairs of PWM pins is tied to one timer, each of which has its own base frequency, as follows:</p> <ul> <li...
221
|flash|sketch-size|
What can I do if I run out of Flash memory or SRAM?
2014-02-15T01:09:33.157
<p>According to the Arduino documentation, the ATmega328 has 32KB of Flash memory for the bootloader + uploaded sketch, and only 2KB SRAM for runtime data. The ATmega2560 has quite a bit more, totalling 256KB and 8KB respectively.</p> <p>In either case, those limits seem rather small, especially when compared to simil...
<p>There are two things to do if you run out of storage:</p> <ul> <li>Somehow "optimize" your code so it needs less storage; or at least uses less of the particular kind of storage that you ran out of (and uses more of the kind of storage that you still have plenty of). Or,</li> <li>Add more storage.</li> </ul> <p>Th...
224
|uploading|arduino-uno|
Is it possible to program an Arduino Pro Mini using an Arduino Uno R3?
2014-02-15T03:50:16.547
<p>I've recently received an Arduino Pro Mini as a gift, and I don't have an external USB programmer to program the Pro Mini. However, I do own an Arduino Uno R3, and I think it would be possible because they both have the same clock speed and micro-controller (16Mhz with an atmega328).</p> <p>Is it possible to progra...
<p>There is another method by which you can upload your sketch programs. Program the UNO with the "Arduino as ISP" sketch and connect the pro mini via the SPI pins (plus reset line). See "Upload with Programmer" on the Arduino website and elsewhere on the internet including stack exchange. This method will allow you...
226
|eeprom|
What is the real lifetime of EEPROM?
2014-02-15T04:09:14.367
<p>ATMEL says the cell lifetime of an EEPROM cell is about 100,000 write cycle/ cell. Is this actually how the EEPROM performs in the wild?</p> <p>If I do not change the value of a cell, does this stress the lifetime? For example, if I write the value <code>0xFF</code> to the same cell again and again, is this any dif...
<p>Couple years ago I made run time logger for piece of equipment. Memory got corrupted after 6 months 40 hours logged with 1s resolution => 144000 writes. My solution was to spread writes over entire eeprom.</p>
233
|library|i2c|1-wire|
Are there any good and maintained libraries for using DS2482 I2C to 1-Wire bridge?
2014-02-15T10:49:28.927
<p>The <a href="http://www.maximintegrated.com/datasheet/index.mvp/id/4382" rel="nofollow">DS2482-100</a> and <a href="http://www.maximintegrated.com/datasheet/index.mvp/id/4338" rel="nofollow">DS2482-800</a> are I2C to 1-Wire bridges which are useful for driving complex 1-Wire networks.</p> <p>These are natively supp...
<p>I believe the library linked by Cybergibbons has a bug in </p> <p>uint8_t OneWire::wireSearch(uint8_t *address)</p> <p>A discrepancy at i = 0 (bit zero in this library, id_bit_number = 1 in a Maxim example) only follows the direction = 1 path and fails to find ROM addresses where bit zero = 0 (i.e. even family cod...
242
|time|arduino-due|
Arduino Time Clock Accuracy
2014-02-15T23:54:05.670
<p>I'm currently trying to create an Arduino time clock by using the PJRC Time library (<a href="http://www.pjrc.com/teensy/td_libs_Time.html">http://www.pjrc.com/teensy/td_libs_Time.html</a>). I know that since most of the Arduino boards are running with a 16MHz clock and a single resonator, the time can become "out-o...
<p>Re-visiting an old question... as I found a very informative blog post that sheds new light into it. But let me first provide some context before giving the link.</p> <p>When assessing the quality of a time base, be it a crystal, a ceramic resonator or a lab-grade frequency standard, there are two notions that shou...
246
|library|signal-processing|
Are there any signal smoothing libraries for Arduino?
2014-02-16T13:57:37.557
<p>I am working on a mobile robot controlled via a wireless 2.4 GHz link.The receiver is connected to the Arduino Uno which serves onboard as the main controller. The most critical (and main) input channel coming from the receiver produces a very noisy signal, which leads to lots of minor changes in the output of the a...
<p>Check out <a href="https://github.com/ripred/Smooth" rel="nofollow noreferrer">the Arduino Smooth library</a>. It uses absolutely no arrays, no looping over past values, it's fast with constant compute time, and the objects take up 8 bytes regardless of the sample window size.</p>
249
|remote-control|ir|
Infrared TV Remote to Arduino
2014-02-16T17:35:27.827
<p>On the hardware side of things, what is involved in making the Arduino receive signals from a TV Remote? What kind of infrared receiver is needed? Do TV remotes use some kind of channels, encoding, or encryption requiring special receivers or else additional programming work to decrypt the signals?</p>
<p>I used TSOP1738 which is easily available at cheap price and I recorded values from more than 10 remotes and it worked very well.</p> <p><a href="http://pastebin.com/gpFxDbkP" rel="nofollow">Here</a> is a file which contain recorded values of a Videocon DTH setup box's remote</p>
269
|arduino-uno|sensors|arduino-mega|
Using the Waspmote Sensor Board
2014-02-17T04:28:35.933
<p>Spanish company Libelium makes this pretty impressive sensor board:</p> <p><a href="http://www.libelium.com/products/waspmote/sensors/" rel="nofollow">http://www.libelium.com/products/waspmote/sensors/</a></p> <p>for their Waspmote series of boards. These are not meant for Arduino compatibility, but they are not ...
<p>Too long for a comment...</p> <p>Look at some of their docs for <a href="http://www.libelium.com/development/waspmote/examples/ga-11-co-sensor-on-socket4-reading/" rel="nofollow">examples</a>. seems like they have a very similar platform to Arduino.</p> <blockquote> <p>Their forums suggest making the connection ...
273
|relay|mosfet|transistor|
When should I use a transistor, mosfet, and when should I use a relay?
2014-02-17T15:18:42.393
<p>I am used to relays some, and they are useful, especially for large loads like a incandescent light bulb or other 120V AC device. However, it seems like overkill to use a relay for a bunch of LEDs linked together (parallel) that use 60 mA (too much for the Arduino). Also, it wouldn't work if you wanted to turn it on...
<p>Big differences between relays and transistors are:</p> <ul> <li>relays are all-or-nothing (like switches) whereas transistors can transmit more or less current through the <strong>collector</strong> based on the current present on their <strong>base</strong>.</li> <li>relays provide isolation between the command c...
274
|programming|
What will happen when I use an invalid pin number?
2014-02-17T15:26:30.470
<blockquote> <p>Related to: <a href="https://arduino.stackexchange.com/questions/189/what-happens-if-there-is-a-runtime-error">What happens if there is a runtime error?</a></p> </blockquote> <p>This question is similar to the one above, however this is an alternate situation:</p> <pre><code>int pin = 999; pinMode...
<p>The compiler will not detect any error and the code will compile and execute. Hence, to see what happens we need to explore the behind-the-scenes magic. <em>For a summary, skip to end.</em></p> <hr> <p>The second line in your code is where the magic will happen and thats where we need to focus. </p> <pre><code>pi...
286
|arduino-uno|threads|
How can I create multiple running threads?
2014-02-18T15:11:41.877
<p>Is there a way I can have multiple parts of the program running together without doing multiple things in the same code block?</p> <p>One thread waiting for an external device while also blinking a LED in another thread.</p>
<p>And here is yet another microprocessor cooperative multitasking library – PQRST: a Priority Queue for Running Simple Tasks.</p> <ul> <li><a href="https://nxg.me.uk/dist/pqrst/" rel="nofollow noreferrer">Home page</a></li> <li><a href="https://nxg.me.uk/dist/pqrst/docs/" rel="nofollow noreferrer">Class-level documen...
292
|serial|arduino-yun|sensors|
Serial sensors and the Yun
2014-02-18T22:56:12.727
<p>I am involved in a project that is going to measure PH and chlorine in a swimming pool. The plan is to use a Arduino Yun. The sensors we are going to use are connected using serial. Since we may be using multiple sensors, is there any difference in reliability, latency, known issues (bugs) of using software serial...
<p>The Yun is a bit different to other Arduinos. The main microcontroller is a ATmega32U4 with a build in USB interface. This is used for the connection to the PC so the single USART is not used for this purpose.</p> <p>However, the single USART is used for connecting to the built in wireless processor. This means tha...
294
|clones|counterfeit|
What's the difference between a clone and a counterfeit Arduino?
2014-02-19T00:48:23.407
<p>I've been hearing a lot about clones and counterfeits. <strong>What are the differences between the two?</strong></p>
<p>A <strong>clone</strong> is an exact or almost exact replica of an original Arduino board, with a different branding.</p> <p>A <strong>derivative</strong> is a board based or inspired by Arduino boards, with some specific addition or modification (different layouts, built-in sensors...)</p> <p>A <strong>counterfei...
296
|arduino-uno-smd|
How high of a baud rate can I go (without errors)?
2014-02-19T03:16:57.470
<p>The standard is 9600 baud. That's just the <em>standard</em>. Using a Arduino Uno SMD R2, what is the highest practical baud rate I can achieve?</p> <p>Bonus points for the audacious: how would you go about creating an error checking mechanism and then increasing the baud rate ridiculous high to get high transfer ra...
<p>Error checking is actually very easy and there is an AVR lib that does this in a one liner. </p> <p>Read up on <a href="http://www.nongnu.org/avr-libc/user-manual/group__util__crc.html" rel="nofollow"><code>util/crc16.h</code></a> and you should be good to go in no time with the included examples.</p> <p>CRC ...
304
|pins|arduino-uno|clones|
What are the SVG pins for on the SainSmart Uno clone?
2014-02-19T14:30:38.310
<p>I bought a SainSmart clone board which is compatible with the Arduino Uno R3. Alongside each of the standard IO pins, there is a row of 3 additional pins (male). They are arranged in columns, marked S, V, and G.</p> <p>They can be seen on this image:</p> <p><img src="https://i.stack.imgur.com/rwQpm.jpg" alt="Photo...
<p>SVG = Signal, Voltage, Ground.</p> <p>The Signal pin will carry the actual output, which may be high or low at any given time. It's basically just a male version of the corresponding standard GPIO pin. The Voltage pin will always be high (which can be 5v or 3.3v on this board, depending on the output level switch)....
307
|arduino-uno-smd|revisions|
Are there different revisions of Arduino Uno SMD?
2014-02-19T22:11:19.283
<p>I know there are different revisions of the Arduino Uno itself, but are there any revisions of the SMD? If they are is SMD R2 identical to through-hole R2? I have a board marked R2 SMD and I am wondering if that is the only version that they produced in SMD format and just are signifying that it is compatible with t...
<p>The only difference with the SMD Uno is the fact you can't remove the chip. There are also 2 extra analog comparators not connected to anything.</p> <p>The SMD boards are compatible with the thru-hole boards, but they have SMD components, which apparently make them easier to make and cheaper. As I said before, the ...
316
|pins|interrupt|isr|
Can a function be called automatically when an input changes?
2014-02-20T00:42:53.183
<p>Currently, my sketch is checking an input pin every time round the main loop. If it detects a change, it calls a custom function to respond to it. Here's the code (trimmed down to the essentials):</p> <pre><code>int pinValue = LOW; void pinChanged() { //... } void setup() { pinMode(2, INPUT); } void loop...
<p>In the event that you want to detect a voltage passing a <strong>threshold</strong>, rather than being merely HIGH or LOW, you can use the analog comparator. Example sketch:</p> <pre class="lang-C++ prettyprint-override"><code>volatile boolean triggered; ISR (ANALOG_COMP_vect) { triggered = true; } void s...
318
|pwm|pulsein|timing|
How precise is the timing of pulseIn()?
2014-02-20T11:03:18.267
<p>I've been using the <code>pulseIn()</code> function for processing PWM-based binary data encoding. It works well for distinguishing pulses which are significantly different lengths, e.g. 500us vs. 1500us. That makes it more than sufficient for handling typical IR remotes.</p> <p>However, I want to make my own IR sy...
<p>The pulsein() function is very lossy, in that it is a hard loop and returns a number * the assumed clock cycles it takes for per loop</p> <pre><code>... // wait for the pulse to stop while ((*portInputRegister(port) &amp; bit) == stateMask) { if (numloops++ == maxloops) return 0; width++; } // convert the ...
319
|programming|c++|data-type|performance|
Why is int only 2 bytes?
2014-02-20T11:37:03.207
<p>When using C/C++ on other platforms, the <code>int</code> type is typically 4 bytes (or potentially more). However, on Arduino, it's only 2 bytes.</p> <p>Why is it different? Does it affect performance if I always use the 4 byte <code>long</code> instead?</p>
<p>One important fact about C and C++ languages is that their respective standards do not define the size (in bytes) of integral and floating point number types.</p> <p>They just define minimal ranges and relation between these ranges, e.g.</p> <pre><code>range(short) &lt;= range(int) &lt; range(long) </code></pre> ...
322
|library|c++|build|
Why do I need to include libraries used in other libraries?
2014-02-20T14:06:18.787
<p>I have a simple library which uses another library. </p> <p>Here is the header:</p> <pre><code>#ifndef __DERIVEDCLASS_H__ #define __DERIVEDCLASS_H__ #include &lt;HardwareSerial.h&gt; class DerivedClass { private: HardwareSerial* serial; public: DerivedClass(); }; #endif </code></pre> <p>And the CPP:</p...
<p>If I remember correctly this is in fact a limitation of the <strong>Arduino IDE</strong>.</p> <p>If you use a better IDE (personally I use Eclipse with the Arduino plugin) it works as it should, i.e. if you include a library A that includes another library B, then in the end you won't get compile-time errors and bo...
323
|library|build|
How can I adapt the DallasTemperature library to accept another 1-Wire class?
2014-02-20T14:15:29.497
<p>A commonly used library is the <a href="http://milesburton.com/Dallas_Temperature_Control_Library" rel="noreferrer">DallasTemperature</a> library, used to access DS18B20 sensors on a 1-Wire bus. When creating a DallasTemperature object you pass a reference to a <a href="http://www.pjrc.com/teensy/td_libs_OneWire.htm...
<blockquote> <p>The DS2482-100 is an I2C-to-1-Wire®bridge device that interfaces directly to standard (100kHz max) or fast (400kHz max) I2C masters to perform bidirectional protocol conversion between the I2C master and any downstream 1-Wire slave devices.</p> </blockquote> <p>It uses a higher level protocol over ...
331
|arduino-uno|lcd|oscillator-clock|
Can I link another device to the Uno's clock?
2014-02-21T10:14:47.667
<p>I'm trying to use an unusual 16x2 LCD display with my Uno. As far as I know, it's an EA-X16027AR. It doesn't seem to be compatible with the HD44780 driver, which is typically used for Arduino LCD's.</p> <p>According to the datasheet, the display's ENB (Enable) pin requires a clock input, described as follows:</p> ...
<p>Rather than using microprocessor-specific low-level programming, I was able to get a suitable signal using the core <code>tone()</code> function:</p> <pre><code>tone(11, 2000000); </code></pre> <p>It can be used to generate a 50% duty cycle square wave of a custom frequency on any individual GPIO pin (I'm using 11...
332
|motor|
Can a stepper motor be controlled directly from an Arduino?
2014-02-21T12:21:09.433
<p>I'm planning to build a simple XY plotter, and have been looking at the possibility of using a pair of small 5V 4-phase steppers to provide the movement. In my research, I've often seen stepper driver boards advertised, ranging from very big and expensive, through to quite small and cheap. Some of them actually look...
<p>Generally, stepper motors cannot be controlled by an Arduino pin. They have a current draw of over the 20mA any single pin can supply.</p> <p>Kickback is also a problem. Because the motors have moving magnetic parts inside, they will continue to generate electricity after power has been cut. this will almost certai...
337
|programming|avr-gcc|performance|
Would an infinite loop inside loop() perform faster?
2014-02-21T15:36:19.237
<p>When you're writing a typical sketch, you usually rely on <code>loop()</code> being called repeatedly for as long as the Arduino is running. Moving in and out of the <code>loop()</code> function must introduce a small overhead though.</p> <p>To avoid that, you could presumably create your own infinite loop, like th...
<p><a href="https://arduino.stackexchange.com/questions/337/would-an-infinite-loop-inside-loop-perform-faster#339">Cybergibbons's answer</a> describes quite nicely the assembly code generation and the differences amongst the two techniques. This is intended to be a complementary answer looking at the issue in terms of ...
342
|fat|sd-card|
Logging multiple gigabytes of data with Arduino
2014-02-21T19:30:53.623
<p>I have Arduino Uno with SD card shield. I'm planning to log a huge amount of data from various sensors - including accelerometers and 3D compass - to the SD card. </p> <p>However, I have understood that Arduino, 64GB SD, FAT and large amount of data are not working too well.</p> <p>Does Arduino work well with this...
<p>You should consider using <a href="http://code.google.com/p/sdfatlib/" rel="nofollow">sdfatlib</a>. This is currently supported version. Where an early version of this was the predecessor the IDE's stock SD library. SdFat better supports newer and larger SdCards, along with more features.</p>
343
|programming|compile|
Why do sketches take up so much space and memory?
2014-02-21T21:29:25.117
<p>When I compile this sketch for the Yún:</p> <pre><code>int led = 7; void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); } </code></pre> <p>I get:</p> <blockquote> <p>Sketch uses 5,098 bytes (17%) of program storage space. </p> <p>Maximum is 28,672 byte...
<p>You already have some perfectly good answers. I am posting this only to share some stats I did one day I asked myself the same sort of questions: What is taking so much space on a minimal sketch? What is the minimum needed to achieve the same functionality?</p> <p>Below are three versions of a minimal blinky progra...
348
|project|version-control|
How to organize my Arduino projects' structure for easy source control?
2014-02-22T07:31:10.457
<p>It's been a long time I've been looking for a good answer to this question.</p> <p>Typically, any Arduino project but the simplest one will include:</p> <ul> <li>The main source code file <code>MyProject.ino</code></li> <li>Libraries specific to the project (<code>MyProjectLibrary1.h</code>, <code>MyProjectLibrary...
<pre class="lang-none prettyprint-override"><code>MyProject |_MyProject |_MyProject.ino |_data | |_documentation | |_PCB | |_schematics |_src |_MyProjectLibrary1 |_ThirdPartyLibrary </code></pre> <h2>MyProject folder (repository root)</h2> <p>The reason I suggest the seemingly redundant <cod...
353
|arduino-mega|
How can I rename how my Arduino shows up on the computer?
2014-02-23T00:31:46.827
<p>I have a clone of a Mega 2560, and the Chinese manufacture apparently had a broken shift key. To my annoyance, whenever I connect it to my computer it reads, <code>arduino compatible mega 2560</code>. With my extreme <em>annoyance</em> with <em>slightly</em> misspelled or incorrectly capitalised English, it has been...
<p>This string is contained in the FT232 USB to UART interface chip and the manufacturer has released <a href="http://www.ftdichip.com/Support/Utilities.htm" rel="nofollow noreferrer">the FT_PROG tool</a> to reprogram it. But do take note of the warning on their website: "<strong>PLEASE NOTE - The use of some of these ...
355
|programming|sram|
How much can I recurse? How much can I recurse? How much ca!@#QFSD@$RFW
2014-02-23T02:40:20.173
<p>The Arduino Uno board has limited RAM which means it has a limited call stack available. Sometimes, recursion is the only quick option to implement a certain algorithm. So, given that the call stack is severely limited, what would be a way to find out that given a certain program running on the board, exactly how ma...
<p>I had this exact same question as I was reading <a href="https://www.cprogramming.com/c++book/" rel="nofollow noreferrer">Jumping into C++ by Alex Allain</a>, Ch 16: Recursion, p.230, so I ran some tests. </p> <h1>TLDR;</h1> <p><strong>My Arduino Nano (ATmega328 mcu) can do 211 recursive function calls (for the co...
356
|programming|python|sketch|
How can I use Python from a sketch?
2014-02-23T05:06:01.823
<p>I'd like to be able to use Python from a sketch. According to <a href="http://playground.arduino.cc/interfacing/python#.Uwl-r6go6aw" rel="nofollow">the Arduino playground</a>, one can use PySerial from a computer to talk with an Arduino via Python. </p> <p>It looks like from that page you can also use various API's...
<blockquote> <p>It looks like from that page you can also use various API's to execute Python directly on the Arduino.</p> </blockquote> <p>I don't see that, at all. All those links show you how to communicate with the Arduino over serial using Python on the host side.</p> <p>You'd need a python interpreter to be...
403
|pins|voltage-level|
How can higher current devices (motors, solenoids, lights, etc.) be controlled by an Arduino?
2014-02-23T20:42:26.537
<p>I'm looking for a broadly applicable solution, one that can be adapted to a variety of projects.</p> <p>I'm currently working on several projects that each require controlling devices ranging from 800mA to 2A from an Arduino Uno. One controls stepper motors, one controls 12vdc solenoid actuators, and one controls 1...
<p>I made an Arduino( Arduino Nano) circuit to power a 12V Peltier(which is also a high power source.) using a MTP3055V MOSFET 60V 12A transistor. And the circuit is operating very well.</p>
408
|pins|button|
Why does my sketch report too many button presses?
2014-02-23T21:43:22.787
<p>I've been using a button to interact with a sketch (on my Uno), and it's mostly working fine. However, sometimes it seems to be detecting multiple presses when it's only pressed once.</p> <p>It's a small circuit-mounted momentary button, which is normally open. It's connected from +5V directly to an input pin. I've ...
<h1>Contact Bounce</h1> <p>This is known as contact bounce and happens when the metal contacts in the button or switch bounce against each other when you push it. The microcontroller is fast enough to pick up these bounces and, as far as it's concerned, you're toggling the switch many times in as much as 10 millisecon...
412
|arduino-uno|ir|timers|
How can an Arduino output a specific (i.e. 56 kHz) carrier frequency?
2014-02-24T00:55:35.033
<p>I'm working on a free space optics project to send data wirelessly between two points. To accomplish this I'm using an IR LED connected to an Arduino Uno that pulses with a 56&nbsp;kHz carrier frequency for the transmitter and a second Arduino with a 56&nbsp;kHz IR detector module for the receiver.</p> <p>I tried u...
<p>There is no need to use an ISR to create the carrier. Just set up a timer to produce a 50% PWM output at the required carrier frequency. The ISR is then just in charge of modulating the carrier - typically at 0.5 or 1ms intervals - a far more comfortable rate. In my experience a 5% error in carrier frequency is tole...
414
|timers|programming|
Could someone explain this weird looking code, used to setup timers?
2014-02-24T02:06:06.347
<p>While looking at sketches other people have written, I occasionally come across code that looks somewhat like this:</p> <pre><code>TCCR1A = 0; TCCR1B = 0; TCNT1 = 34286; TCCR1B |= (1 &lt;&lt; CS12); TIMSK1 |= (1 &lt;&lt; TOIE1); </code></pre> <p>All I know is that is has something to with timing/timers (I think)....
<p>CS12 has a value of 2 since it represents bit 2 of the TCCR1B register. </p> <p>(1 &lt;&lt; CS12) takes the value 1 (0b00000001) and shifts it left 2 times to get (0b00000100). The order of operations dictates that things in () happen first, so this is done before the "|=" is evaluated.</p> <p>(1 &lt;&lt; CS10) ta...
418
|arduino-uno|serial|pins|arduino-due|voltage-level|
How can a 5v Uno talk to a 3.3v Due?
2014-02-24T12:23:42.077
<p>I currently have an Uno (which operates at 5v), and I'm looking at buying a Due (which only operates at 3.3v). I'd like to make them communicate via Serial or SPI or similar, but presumably connecting them directly isn't an option (I guess the Due's pins would get damaged).</p> <p>Is there any way to make the conne...
<ul> <li>For a 5V logic output to a 3V3 logic input, you can use a resistive divider to lower the voltage.</li> <li>When unloaded, a 3V3 logic output is just enough to drive a 5V logic input. Check the AVR datasheet for the exact voltages (0.6 × Vcc = 3V, found under DC Characteristics in the datasheet).</li> </ul> <p...
430
|arduino-uno|power|safety|
What will happen if I give my Arduino Uno more or less than 5 volts?
2014-02-25T05:44:28.927
<p>Will it still run on less than 5 volts? Will it break?</p>
<h1>Will it break at &lt; 5V? Not likely.</h1> <ul> <li>Check the datasheet for the IC's on the board and find the minimum power supply voltage the device works at.</li> <li>At typical ATmega328 Safe Operating Area (under "Speed grades" in the datasheet) specifies approximately 4.1V for 16MHz.</li> <li>If you require ...
432
|arduino-uno|wifi|xbee|
How can I connect to an Arduino using WiFi?
2014-02-25T06:50:47.410
<p>I'm working on building a solar powered, Arduino based weather station. The weather station consists of a temperature sensor and a photoresistor, and I plan to add an anemometer in the future. I would like to connect the weather station to my wireless network so that I can retrieve the sensor data from my computer w...
<p>After several trials &amp; errors in my IoT project, I would recommend working on ESP32 over ESP8266(and also Arduino Uno &amp; Nano), <strong>except if you know very well the scope of your project.</strong></p> <p>Advantages of ESP32 over ESP8266:</p> <ol> <li>Bigger RAM, ESP8266: 32KB instruction &amp; 80 KB use...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
28