One issue with both your failed implementation and the previous answer
is that they do loads of dynamic allocations and copies. Every time you
use the String’s + or += operators you are allocating heap memory
for a brand new String, copying the original character data into the
newly allocated space, and eventually destroying the original Strings
when you don’t need them anymore.
The simplest way to avoid all these copies and allocations is to not
build the String you want. Instead, just write() the pieces one after
the other on the display. Here is a zero-copy, zero-dynamic allocation
solution:
void printMessage(const char *message) {
    size_t length = strlen(message);
    while (length > 20) {
        oled.write(message, 20);
        oled.write('\n');
        message += 20;  // point to the rest of the message
        length  -= 20;  // remaining length
    }
    oled.write(message);
}

Note that the method Print::write(const char *, size_t) is used here
to print a slice of the message without ever building it as a string in
memory.
On these memory-constrained devices it is always preferable to avoid
heap allocation, and thus String objects. However, if for whatever
reason you really need to print a String object, then you can use
the following overload to print it’s internal buffer without making any
extra copy:
void printMessage(const String &message) {
    printMessage(message.c_str());
}


You cannot use Serial inside an interrupt. Transmitting Serial relies on interrupts being available, and from inside an interrupt they aren't.

All Serial communication must be done from loop().

So you need to just count the switch toggles and check to see if that value has changed in your loop.

volatile uint32_t toggles = 0;
uint32_t old_toggles = 0;
uint32_t ts = 0;

void setup() {
    pinMode(2, INPUT_PULLUP);
    pinMode(3, INPUT_PULLUP);
    attachInterrupt(0, toggle, RISING);
}

void loop() {
    if (toggles != old_toggles) {
        old_toggles = toggles;
        Serial.print("C1: ");
        Serial.println(toggles);
    }

    if (millis() - ts >= 1000) {
        ts = millis();
        Serial.print("S1: ");
        Serial.println(digitalRead(3));
    }
}

void toggle() {
    toggles++;
}


Variable Fan Controller - Properly Sized Transistor

Doing a quick search for high-current MOSFET transistors, I ran across the following:
https://www.digikey.com/en/products/detail/ixys/IXFK170N20T/2126313
The important spec here is the Rds ON (max) of 11mOhm @ 60A, 10V
At your peak current of 100A, you would drop 1.1V across the transistor, for a power dissipation of 110W.
The advertised P(max) is 1150W, so assuming the junction temp can be held to under 175C (and with an entire metal truck to use for a heat sink, this shouldn't be a problem) you should be OK with this device.  In the 'cruise' configuration with 25A motor current, you should have no problem controlling the fans.
YMMV ;-)


How do I connect multiple pinhole cameras and take photos and video at the press of a button?

Arduinos and Cameras do not mix well at all.  It's all down to the sheer quantity of data involved in pictures.

Take for instance a typical VGA image - 640x480 pixels at 24-bit (3 byte) colour depth.  One single picture requires 640x480x3 = 921600 bytes just to store it.

Add to that the fact that most small cameras include hardware JPEG compression which the Arduino really has no hope of being able to handle, and you just can't do anything with it.

Most camera modules use a system called CSI-3 (Camera Serial Interface version 3) for streaming the raw data from the CCD elements into the target.  That allows for high speed data transfer of the whole frame at a speed that is able to support video.  If you think about video as 25 frames per second, and raw data, that means that the data is being transferred from the CCD elements in total at arouns 22 MiB/s - there is absolutely no way that an Arduino can deal with that kind of data.  So cameras that attach to an Arduino have their own controller chip that compresses the image to JPEG and streams it out through a much slower interface - typically RS232.  All the Arduino can then do is tell the camera "Take a picture for me" at which point an image is captured and compressed, and then the Arduino receives the JPEG data through serial (slowly) and stores it on an SD card (also slowly). It can't do anything else with it.

To crunch those numbers - assume that the compressed VGA image from the camera's processor chip is 100,000 bytes (I took a typical photo, scaled it to 640x480 and saved it with 90% JPEG compression and it was roughly that size).  At 9600 baud you get 960 bytes per second. 100,000 / 960 = 104 seconds.

That is how long it would take to transfer one single image through the Arduino.

If the camera has a higher speed UART, say 115200 baud (11520 Bps), that would then give you 100,000/11,520 = 8.7 seconds.

So no, using an Arduino to control cameras in that way just isn't possible.

Instead you need a system that can talk CSI-3 directly - something with a direct camera connection, such as the Raspberry Pi.  Another alternative is any embedded computer with enough processing power and USB ports to connect cheap USB webcams to.  Again the Raspberry Pi would do - especially the newer version 2 with the quad core processor.


The basic set of functions of the esp8266 WiFi object follows the API of the Arduino's first WiFi library for Arduino WiFi Shield. It is documented here.

The esp8266 implementation of status() focuses on state of the STA and maps SDK status to some of Arduino documented codes.

wl_status_t ESP8266WiFiSTAClass::status() {
    station_status_t status = wifi_station_get_connect_status();

    switch(status) {
        case STATION_GOT_IP:
            return WL_CONNECTED;
        case STATION_NO_AP_FOUND:
            return WL_NO_SSID_AVAIL;
        case STATION_CONNECT_FAIL:
        case STATION_WRONG_PASSWORD:
            return WL_CONNECT_FAILED;
        case STATION_IDLE:
            return WL_IDLE_STATUS;
        default:
            return WL_DISCONNECTED;
    }
}


This problem was fixed by restarting the arduino IDE by the exe instead of opining it from an .ino file.


You can try something along these lines:

void verboseDelay(unsigned long ms)
{
    unsigned long now = millis();
    Serial.print(F("delaying"));
    unsigned long start = now, lastPrintTime = now;
    do {
        now = millis();
        if (now - lastPrintTime >= 20) {
            Serial.write('.');
            lastPrintTime += 20;
        }
    } while (now - start < ms);
    Serial.println();
}

The trick is to used unsigned long for all the time-related variables,
and also to avoid printing too fast.


A tilt sensor, can be used as what you are trying to say, whenever someone (who wore it) raise his hand or move it, will trigger an alarm.
If you want to carry your alarm with you then...
You can use arduino nano or micro with a sensor and buzzer connected to it to just place it in gloves or watches etc.


Print out times tables from 1 to 10 with array

//Define global array, is this needed? Makes no difference for my output in serial monitor.
//int number[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

This is not needed, you can use a for lop from 1 to 10.

The void loop will look like this (not checked, no IDE nearby):

void loop()
{
  for (int multiplier = 1; multiplier <= 3; multiplier++)
  {
      for(int i = 0; i <= 9; i++)
      {
         prod = i * multiplier + multiplier;
         // or: prod = (i + 1) * multiplier;
         Serial.print(prod);
         Serial.print(",  ");
      }

      Serial.println();
      Serial.println();
      delay(3000);
  }
}

Some remarks:

To go to the main for loop (with multiplier):

Identify the similar parts
Check the differences within each similar part (only the multiplier value, 1, 2 or 3)
Make this a for loop and instead of 1, 2, 3 use the multiplier variable
Instead if i = i + 1 you can use i++. It means exactly the same.
For clearity I put the Serial.println() together. You also can use Serial.print('\r\n\r\n') or Serial.println('\r\n') to achieve the same


Not getting any output from ECG sensor AD8232

The problem was that I connected GND on the other half of the protoboard and there was no connection. I thought that the whole length of the protoboard is on the same potential for + and -, so GND wasn't connected. After connecting GND pin correctly, all worked perfectly.


How to organize my Arduino projects' structure for easy source control?

My way of organizing an arduino project is quite simple, all my project are git repositories so that there is at least the following:

project/

project.ino
Makefile

I have a preference using my favorite editor and a Makefile which I have crafted to work against most use cases (and I even improved on that one that I'm going to share soon).
For the libraries, I prefer to keep them as their own repositories and use git submodule to include them to the project. As many libraries written by the community are shared as git repositories, that's a good generic solution. Then, within the Makefile, I just have to add the libraries path I want to include in the LOCALLIBS variable.
Though, for some projects, it makes sense to encapsulate the libraries into a hardware abstraction layer library crafted for the project, then I prefer to use a path such as:

project

project.ino
Makefile
project_hal_lib

library1
library2
library3
…

Though, with arduino 1.5.x a new way to specify libraries is offered, that will offer a way to create and build arduino projects the same way we already do with pipy and virtualenv in python, i.e. you define the set of libraries you need and they get downloaded.


Where is the Arduino IDE log file located? Not the Serial Monitor

There is no log file. Instead you need to turn on both "compilation" and "upload" under the "Show verbose output during:" option in Preferences.
This will give you far more information about any errors in the output scroll pane at the bottom of the IDE.
On Linux if you run the IDE from the command line you get large amounts of logging on stdout. There may be a way of doing the same from Windows.


Using Arduino UNO as FTDI programmer for 9DOF Razor IMU

What you're missing is the signal that resets the ATMega so it can enter the bootloader.  That signal is the one that goes to the DTR pin of the 9DOF and would normally be sent to the reset pin on your Arduino (that you are grounding).

What you need to do is reset the 9DOF just as it's about to start trying to upload the code.  Timing is critical - you get about a second or so of leeway where the bootloader is actually available for avrdude to talk to.

Alternatively you can try and find a point on your Arduino board where the DTR signal from the USB interface chip is available before it passes through the capacitor to the RESET pin of the Arduino and take a wire from there (wherever that may be) to the DTR pin of the 9DOF.


Yes there is a library to load the image to Arduino called as "TFTLibrary".

Loads an image file from the SD card into a named instance of PImage. The TFT library has the ability to read .bmp files off the root of a SD card and display them on the screen. Images can be smaller or larger than the screen resolution (160x128), but there is no method on the Arduino for image manipulation. The images should be sized before you put them on the SD card. The TFT library has the ability to read .bmp files off the root of a SD card and display them on the screen. It is possible to load 24 bit bmp image only.

Syntax:

screen.loadImage(name);

Details available on Arduino website:
https://www.arduino.cc/en/Reference/TFTLoadImage


ESP8266 Soft Access Point: Timeout of request of resource when not responded to in set undocumented time

WifiMulti wifiMulti;//declare global.
wifiMulti.addAP(ssid,pass);//instead of WiFi.begin();
int i = 0;
//add below to wait for connection.
while (i < 20)
  {
    if (wifiMulti.run() == WL_CONNECTED)
    {
      return (20);
    }
    delay(500);
    Serial.println(WiFi.status());
    i++;
  }


I assume the OP wants the frequency of the vibration, which an accelerometer such as the ADXL345 won't give.

I have two workarounds: if the expected vibration frequency is low, say, under 100Hz, use instead an on/off vibration sensor (adafruit has them for under a dollar) and count the number of transitions. If it's more, how about a microphone and a band-pass filter?


Is it possible to have two serialEvent() in Arduino code?

According to https://www.arduino.cc/en/Reference/SerialEvent

Arduino Mega handles:

void serialEvent1(){
//statements
}

void serialEvent2(){
//statements
}

void serialEvent3(){
//statements
}

Every other Arduino has only single:

void serialEvent(){
//statements
}


Advice for lower power clock type project

I will make my comment an answer:
Try one of Arduino supported RTC's boards. The most popular (and simple) are: DS1302, DS1307, PCF8563, and - very nice, precise DS3231 (my fav). Hook any of them up to your Arduino, add some (readily available) libraries, tweak a little and voila. The RTC will work from coin battery (or high capacity capacitor called supercapacitor, like this one)

Most (if not all) of mentioned RTC have 'alarm' function: you can set up your system to wake up your Arduino from sleep (sleep state to save battery) and gradually light up the LED.

To limit current of Arduino try removing LED, or - better - try to use Arduino Pro Mini. To modify it for better power saving see here

EDIT:
There are some other low-power boards:
Moteino
Rocket Scream Mini Ultra
JeeLink

Also, (as mentioned in one of comments) you can try one of ESP8266 and push it to one of many sleep modes. Try this link.


Moisture sensor data will not output data to Serial Monitor?

Your second print section will always fail.

You have:

if(millis() - printTime > printInterval)   //Every 800 milliseconds, print a numerical, convert the state of the LED indicator

However, a bit before then you have:

if(millis()-printTime>=printInterval)
{
  printTime=millis();

So millis() - printTime can never be greater than printInterval since you have just set printTime to millis(). So millis() - printTime will always be somewhere between 0 and printInterval - 1.

Consider combining your different printing routines into one single printing routine so you are comparing (and changing) the printTime only once.


Found the problem on the SPI library.

When I do the command SPI.transfer, the data is stored on a byte type variable. And I'm passing a 16 bit data on it.

I've changed line 84 of SPI.h to

uint16_t transfer(byte _pin, uint16_t _data, SPITransferMode _mode = SPI_LAST);

so it will return and receive 16 bit data.

Also have to change the corresponding function on SPI.cpp (line 174)

uint16_t SPIClass::transfer(byte _pin, uint16_t _data, SPITransferMode _mode)

so they will match.

I've copied and renamed the SPI library that I've changed so it won't affect other codes.


How to flash hex files from a micro SD card to an Arduino Nano using an SD card module?

No. Only the bootloader is allowed to write to the program flash.


Very easy Arduino code challenge for you brainiacs to solve

You are attempting to use IO pins that are already in use by the MP3 shield.

According to your subsequent research, only digital pins 0,1,5, and 10 are available for use.

You should shy away from using pins 0 and 1 since they are also connected to the computer through the USB interface and are used for uploading sketches.  You will find that either you can't upload sketches with the relays connected to those pins, or the relays will "randomly" switch on and off while you're uploading a sketch.

Don't forget that the analog pins A0-A5 can also be used as digital pins, so you can quite happily drive your relays using any of those.


Read Voltage at PWM off time, and Current at PWM on time

Add a pin-change-interrupt (PCI) handler (See eg PinChangeInt at arduino.cc); clear the flag and enable the interrupt whenever you want to take readings, and disable that PCI after you have the reading.  As noted in the link, PCIs are available on all signal pins (possibly not on A6 and A7 on the 328), so are available on any of the PWM pins.


It would seem you failed to configure the port on the Linux side. By
default, it is configured to who-knows-what baud rate, and to a “cooked”
mode where the data is preprocessed by the kernel driver. You want
instead to set it to the correct baud rate and to “raw” mode. The stty
(meaning, “set terminal”) command does this:

stty -F /dev/ttyACM0 raw 9600

Replace 9600 with whatever baud rate your Arduino is using.

If you Arduino program attempts to read the serial port, it will see the
echo of the characters it sends. In that case you probably want to
disable this echo also:

stty -F /dev/ttyACM0 raw -echo 9600


Detect and stream if a chair is occupied

For a soft seat you could sense occupancy with an LED and photo-sensor at opposite ends of a short somewhat flexible tube that gets flexed when the cushion compresses, interrupting the light. That or a microswitch would have to be the cheapest means of sensing.

Getting from there to the server depends a little on how much work you're willing to do, from rolling your own micro-controller+WiFi PCB to purchasing off the shelf parts, which may in turn, depend on whether you need to monitor one chair or a whole auditorium.


Are you using an arduino (as in UNO / mini / nano etc.) and communicating with a separate esp8266 via serial?
I've found esp8266 module to be more reliable by using a 12e or such like and running arduino boot loader on it. There's more memory to play with, and I tend to formulate the data I need within the ESP8266 and then communicate with that via serial or I2C to get data / requests to and from.

Make sure you're supplying the ESP module with enough current - they're juicy little things, so good 300mA @3.3v and use a good 470uf 10v cap or something too.. They can splurge current on occasion, particularly when scanning networks.

Let me know what set up you're running

Cheers


A 12 volt DC motor is good for dragging items, but then again it depends on the items weight. Stepper is used for millimeter precision, like 3D printing. Servo is an DC motor with precision for 180 degree movement, like robot arms. If the moving object is over 1kg you should look into geared DC motors or even the stronger brushed motors, or geared brushed motors. Whats the max weight?


Maybe this one, I'll try this when I will get my second sonar

Ding ding ding! Yeah, this would be one way to do that. That creates an array so you can reference the sonar with sonar[i], where i is either 0 or 1 for the first or second number.

For only two sensors, it might be easier just to do something like this:

NewPing sonar1(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
NewPing sonar2(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

Then you can run the other code like this:

delay(100);
unsigned int uS1 = sonar1.ping();
int cm1 = uS1 / US_ROUNDTRIP_CM;

unsigned int uS2 = sonar2.ping();
int cm2 = uS2 / US_ROUNDTRIP_CM;

A little less code to read, whichever one you want.

The reason you can do this is you can replace the sonar with whatever you wanted (following C++ variable rules like no spaces, etc.). You could call it Arduino_Sonar if you wanted to.

The array is basically a simple way of grouping variables together easily. It's not convenient to declare 500 differently name variables; I can just do int numbers[500]; to declare them. An array might be more useful if you're expanding your circuit, but either is correct.


Get a specific item from comma separated text

Use the strtok function.
From Geeks for geeks (https://www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/):
arguments:

str: The string which is to be split
delim: The character on the basis of which the split will be done Return value

The function performs one split and returns a pointer to the token split up. A null pointer is returned if the string cannot be split.


Basicly OTA supports the upload of *.bin files. Wether this contains compiled code or a filesystem (SPIFFS/LittleFS) is irrelevant. BUT The space for the OTA (partition) has to be min the size of the *.bin plus an overhead for processing. So with 4MB at all, you would need 2.5MB OTA for 1.5MB App/SPIFFS. To tweak partition sizes (or custom partitions) you have to go into the boards.txt file.OTA - Details and Info here

File system - Details and Info here


OLED display crashes when connecting USB

When your computer boots, or when you plug the board in with it booted, most likely the serial port that gets created (/dev/ttyACM0) is opened by the process modem-manager. That will cause the Arduino to reset giving you the same results you see when you reset the board in other ways.

I have had no end of trouble in the same manner with a green version of the same screen. The best results I have had is to control the power to the display and power it up at every boot.  You can do it with a simple P-channel logic level MOSFET or PNP transistor:

simulate this circuit – Schematic created using CircuitLab

If you chose, say, D3 (as an example) as your control GPIO you would go:

void setup() {
    pinMode(3, OUTPUT);
    digitalWrite(3, LOW);
    delay(1000); // Give it time to settle after powering up
    ... rest of setup code ...
}

You can also then use it to save power (if you want to) by turning the display off - simply set the pin back to INPUT and it will be turned off by R1.


Serial printing from Flash Memory (F() macro, PROGMEM, sprintf_P, SPTR)

First, the freeMemory() function that you used from Adafruit was originated from a github, I don't know about the __arm__ implementation, but for the avr, it is incomplete for handling the corner case when the program does not use the malloc() function, if your program never use malloc(), the formula used in freeMemory() will produce the wrong result. A simple corrected version for AVR that I used is here:

extern unsigned int __heap_start;
extern char *__brkval;

int freeMemory() {
  char top_of_stack;

  if (__brkval == 0) {
    Serial.println(((int)&top_of_stack - (int)&__heap_start));
  } else {
    Serial.println((int)&top_of_stack - (int)__brkval);
  }
}

  explain in detail what exactly does each of the keywords F(), (PGM_P)F, PSTR, const PROGMEM.

PSTR("string literal")

PSTR came into Arduino from part of avr-libs(a C library) defined in avr/pgmspace.h, it is actually a macro, not a function as many think it was, and is defined as:

#define     PSTR(s)   ((const PROGMEM char *)(s))

It looks a little bit intimidated but it actually quite simple, it not only tell the avr-gcc that the string literal s should be kept in program memory (i.e. Flash memory in the case of Arduino), but allows the program to convert it into a const char *s PROGMEM variable so that it can be pass around into some PROGMEM-aware functions as a parameter.

 //this is a PROGMEM-aware function in c
 printMsg_P(const char* str) {
     char buf[strlen_P(str)+1];
     strcpy_P(buf, str);
     puts(buf);
 }

 // this handle the normal string array function
 printMsg(const char* str) {
     puts(str);
 }

F("string literal")

F() is also a macro but it is not part of the avr/progmem.h, it is actually part of the String class defined in WString.h together with a definition of a class called __FlashStringHelper:

class __FlashStringHelper;
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

To understand the F() macro and the difference between F() and PSTR() take a little bit explanation.

As you can see from the definition of F(), it casts a string literal into a const char* variable using PSTR(), and then re-cast it into a class __FlashStrngHelper. If you further looks at the __FlashStringHelper, it is actually an empty class without any construct or method, it is literally empty, so why is this useful? and why can't just pass the string literal around by just using PSTR().

This has to do with C++'s function overload. Function overload is a feature of C++ where multiple methods could have the same function name but each with different parameters. Within all the Serial.print() methods, there is a method Serial.print(const char* str) that will take in a string literal and print it to serial monitor, but it is not PROGMEM-aware, if you pass in a PROGMEM string literal Serial.print(PSTR("string literal"));, the same method will accept what you pass in because it meet the type checking (remember PSTR is actually const char*), but it will not print out the correct string for PSTR("string literal") because it simply expecting a normal string.

In c, as we see before, we solves the problem by using two functions with different names for handling normal string and PROGMEM string, but Serial is a C++ class, it needs another function overloaded method to be PROGMEM-aware, and PSTR() is clearly not the solution as we just mentioned.

What WSting.h and Print.cpp did is to create an overload method that is PROGMEM-aware by accepting a class as parameter, so that you can pass a F() wrapped string literal which has a data type of class __FlashStringHelper into the Serial.print() and get the print out correctly from program memory. See the source code yourself.

Serial.print(const __FlashStringHelper *ifsh)

So in summary, the F() and PSTR() are alike, both telling the compiler to keep the string literal in the program memory, and allow the string literal to be pass around into some function as parameter. But it was designed for different purpose from different programming paradigm (C versus C++). F() is Serail.print()-friendly, while PSTR() is not. If you are getting PST() in a function and yet you want to send it to Serial.print(), you will have to explicitly cast it into __FlashStringHelper like this:

Serial.print((__FlashStringHelper*)PSTR("test"));

PGM_P

PGM_P is a macro defined as:

#define     PGM_P   const char *

Whether you want to use PGM_P or const char * is a personal preference, for example, this is copy from https://www.arduino.cc/reference/en/language/variables/utilities/progmem/:

const char *const string_table[] PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};

can be written as:

PGM_P const string_table[] PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};

This is a lengthy explanation, but I hope this will help on better understand the subject and therefore be able to use the PROGMEM and all the associated macros effectively.


You probably will want a moisture sensor like this one (there are many variations of this).

This will return one signal when dry, and another when wet.

You will need a Buzzer to make a sound as well (Or a piezo speaker if you feel like getting more advanced) in order to make a sound.

Your sketch should have, in its loop, an if statement checking if the moisture sensor has returned the wet signal (The signal will depend on the sensor you get) and, in the block that executes if there is a signal, a statement driving the buzzer and a delay before turning it off.

Bear in mind that you want to keep the Arduino itself away from the moisture sensor, as your Arduino probably won't survive the dog's doings.


Connecting Peltier module to Arduino Nano

I prepared a little circuit that should help you safely connect the Peltier module to Arduino. It uses a single n-channel MOSFET and 1K resistor.

I couldn't find any Peltier in Tinkercad so instead I used a simple light bulb. (In previous version of this answer I used a DC motor, but it was not a good replacement for Peltier module)

When Arduino Pin12 is HIGH light is bright (high current flows through it just like it should through the Peltier) when Pin12 is LOW light bulb goes dark (no current is flowing)


Arduino IDE Permision Denied For Upload, Ubuntu

As mentioned on the official guide for Linux, you need to run

sudo usermod -a -G dialout <username>

with the <username> replaced with the username of your system.
After running this, log out and log in and you should be good to go.


Resistor - Correct value for optocoupler, but dont have that size

1kΩ will be just fine. But if you want lower you could take two 1kΩ and place them in parallel - that will give you 500Ω.
BTW - 1kΩ will give you ((5-1.3)/1000=) 3.7mA through the diode of the optocoupler, and 500Ω will give you ((5-1.3)/500=) 7.4mA.


How do I use RFID-RC522 with an Arduino?

Sorry, but I must disagree with your 'NXP datasheet is incomprehensible'. From the FIRST PAGE of the MFRC522 datasheet:

'Remark: The MFRC522 supports all variants of the MIFARE Mini, MIFARE 1K,
MIFARE 4K, MIFARE Ultralight, MIFARE DESFire EV1 and MIFARE Plus RF
identification protocols'

Here it says the MFRC522 covers just a part of ISO/IEC 14443. The following are missing fron the NXP RC522:

*MIFARE DESFire EV1 (includes AES encryption)

MIFARE DESFire EV2 (includes MIsmartApp, Transaction MAC, Unlimited Applications
MIFARE Plus drop-in replacement for MIFARE Classic with certified security level (AES 128 based))

MIFARE SAM AV2 (secure access module that provides the secure storage of cryptographic keys and cryptographic functions)*

These are probably the ones used in bank cards. Again, from the FIRST PAGE of the MFRC500 datasheet:

'All protocol layers of the ISO/IEC 14443 A are supported.'

You'll have to plow through all the different MIFARE / ISO/IEC 14443 specs to find out how many ID bytes there are for the different types (I suspect diferent types return a different quantity of bytes).

So, basically, you're screwed. Spring for the expensive MFRC500-based reader. I assume that with the higher cost you also get a high-class API, documentation and examples or even (gasp!) tech support.

Cheers


Arduino Orion Upload - Which Board When Compiling

Yes, the "Orion" is just an Uno in a different shape with different connectors.  Just treat it like an ordinary Uno.

Similarly the "Baseboard" is just a Leonardo in a different shape with different connectors.


ATMega328P U Query - does it work straight away on Uno R3

The MCU on the Uno R3 comes with a specific bootloader (Optiboot) and
fuse configuration (external clock, clock prescaler disabled, bootloader
enabled...). You may find some ATmega328Ps on the market that have been
specifically configured as drop-in replacements for the one on an Uno.
Those should “just work”. If the ones you bought come with a different
bootloader or fuse configuration, you may have to re-flash or
reconfigure them.


Arduino PWM Frequency - Pros and Cons of Modifying

A PWM frequency of 490Hz means a period of approximately 2.041ms. This allows a high period of 2ms, which is the maximum pulse length required by a large number of inexpensive servos. Obviously if your design uses no servos then this is not a consideration.

Timer 0 itself is used for the various Arduino timing functions (delay(), millis(), etc.), so if you change the frequency used for timer 0 then those functions will no longer have accurate results.


Boil water inside a small container with an arduino

Try to find a boiler pot on electricity (I doubt you can heat water to boiling temperature with like 5V (unless you use many amperes).

Use a relais to switch it on with an Arduino.

Use a temperature sensor (0-150 degrees or so) to decide when to switch it off.

Warning: Get first some electrical knowledge before you start with >200 volts projects since it can be deadly. And boiling water can be devestating for skin and your Arduino.


Connect arduino nano and ESP32 with I2C on the GPIO7 and GPIO8?

Since I made a PCB prototype, I would avoid to add some wires and cut the traces, so I would ask if I could use these pins (GPIO7 and GPIO8) as SDA and SCL.

No, you can't. Those pins are used by the internal flash chip. If you connect things to them you will end up not being able to read the flash and thus won't be able to run any code.  In other words, the chip will not boot. So you will have to bite the bullet and cut traces and add bodge wires.

  Wire.begin (7,8)?

Yes. That will control the bus matrix to route the I2C through different pins - but of course you can't use those pins, as noted above.

  On the arduino side I wrote:

  digitalWrite(SDA, 0); digitalWrite(SCL, 0);

  It is correct to do the same thing on the ESP32 side?

No. That exploits a quirk in the AVR GPIO system that doesn't exist in the ESP32. In the ESP32 the pins are configured with:

pinMode(sda, OPEN_DRAIN | PULLUP | INPUT | OUTPUT );

and

pinMode(scl, INPUT | PULLUP);

so you could try replicating that in your code but without the PULLUP flag. However the effect of this is unknown, so YMMV.

However, if your external pullups are pulling up to 3.3V then you really don't need to do anything on the ESP32. All you end up with is a large resistance in parallel with your 4.7kΩ, which will just cause your resistance to drop slightly (and since 4.7kΩ is arguably too high any way that's a good thing).


Can I use an external power supply and still communicate with my computer over Serial?

Yes you can. It still leaves the data/ground lines intact, it just doesn't bridge the 5V line.

Arduino Uno Schematic v.3:

The USBVCC is directly from the 5V on the USB jack (well, technically there's a fuse there). It then goes through a transistor (T1) that only allows power through when there is no power coming from the 5V regulator (that regulates the VIN voltage).

The USB jack:

You can see pin 1 of the USB jack (5V) goes through the fuse to USBVCC. The next ones D+/D- are the data lines that go through resistors to the ATMEGA16U (used for USB to UART). The last one just ties into ground.


I would suggest looking into threading.

To minimize the time from the first read to the final read, an interrupt and an interrupt timer would probably be good. Have the interrupt timer fire after some interval and place all of your sensor reads in the Interrupt Service Routine (ISR).

I would also suggest staying away from functions that the Arduino platform provides, like delay(), digitalRead(), digitalWrite(), analogRead(). Those functions will add extra instructions to your sensor reads and waste clock cycles. The Arduino platform sacrifices speed for usability in some cases.

You might also want to look into using a real-time OS if this is a real-time application

UPDATE

The arduino will not support 15 true threads. if you look into The TimedAction class you might see something that you can use. Basically, timed actions occur after an interval and a specified function is called. However, if you have 15 timed actions all with the same duration, they won't all read at the same time, they will still have to read in some order, one at a time.

If you look into the source code for many of the functions you can see how they work. The Arduino source code comes with the IDE. A good place to start would be Arduino.h. If speed is a concern, you want to reduce as many clock cycles as possible, which means removing as many lines of code as possible. If you can do something without calling digitalRead() for example, you will save yourself some time.

A real-time operating system is an OS that is used in real-time systems. I find it helpful to think of a RTOS as a timing library that will help you, opposed to installing Linux on your arduino. There is plenty of material around the web on what a real-time system is and what a real-time OS does if you want to learn more.

The important part of an RTOS is that is guarantees that an action be performed before a deadline. So in your case, sensors are read before a given time. There are a couple RTOS's for the Arduino that google will find for you.


Which GSM-shield is most efficient for GPRS communication?

GSM, by its very nature, is power hungry.  Even the most "efficient" one will blow your power budget many times over.  Since everything on GSM goes down the same digital transmission channel there would be no real difference between one with call and SMS and one without. It's all just data at the end of the day.

That said, the most efficient GSM module is one that consumes absolutely now power. And that is, at least for most of the time, perfectly possible.  By making the Arduino control the power supply to the GSM modem it can be literally turned off until an update is needed to be sent. Worst case that is on for maybe a minute (give it time to register on the network and what have you) and then off for 19 minutes. That's only on for 5% of the time - less if there isn't a change since the last time, of course.


DMX dimmer appears to receive data from Arduino but connected lights do not respond

The light technician, Toby Peperkamp, came with the solution. I'm not sure exactly where he found the information, but apparently the protocol for non-RGB DMX lights requires that the lights be switched on to maximum (255) at the beginning of the connection. So I added that to the setUp() and all the lights started to respond.


There are also limits on the total power of groups of pins,

  The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed
  200mA.
  The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
  The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200mA.
  The sum of all IOH, for ports E0-E7, G5 should not exceed 100mA.
  The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100mA.

So you are already limited to 800mA.

Secondly, you have to be careful to change all the pins at exactly the same time. Otherwise some pins will be low, and others high creating effectively a dead short. Or if you make sure the pins are inputs before changing, some pins will be on sooner, and those pins will then for a short period, handle all the current, and thus exceeding their limit for a brief moment. Which isn't that bad, but still not ideal.

So definitely don't use digitalWrite to change all the pins, one after the other.


ESP32 USB HID/MIDI library (not the BLE one)

The ESP32 doesn't have USB. You can't do USB communication. All it has is (like the UNO) a USB to UART interface chip. Unlike the UNO this is not programmable (more like a cheap Chinese knock-off UNO clone in that respect).
You would need to couple it with a microcontroller that has USB and program hat to be your USB interface and communicate with it over some other communication medium, such as UART or I2C.


Help Led matix isn't lighting up correctly Is it a Hardware or software issue?

This was what i was able to come up with, once a notes is press the blink function turns the LED on and off really fast. i am now have trouble getting the led to turn off once the notes is being pressed am not sure if the code is exiting from the while loop.

include

MIDI_CREATE_DEFAULT_INSTANCE();

define LedR 3   //

define LedC 4 //pin for each led

byte data1 = 0;

unsigned long previousMillisR[2]; //[x] = number of leds

unsigned long previousMillisC[2]; //[x] = number of leds

int Status [25];

void setup() {

MIDI.begin(MIDI_CHANNEL_OMNI);

MIDI.setHandleNoteOn(MyHandleNoteOn);

MIDI.setHandleNoteOff(MyHandleNoteOff);

pinMode(LedR, OUTPUT);

pinMode(LedC, OUTPUT);

}

void loop() {

MIDI.read();

//BlinkLedR(LedR,2000, 0);   //BlinkLed( which led, interval, one of the
stored prevMillis

//BlinkLedC(LedC, 10, 0);  //last parameters must be different for each
led

}

void BlinkLedR (int led, int interval, int array){

//(long) can be omitted if you dont plan to blink led for very long time I think

if (((long)millis() - previousMillisR[array]) >= interval){

previousMillisR[array]= millis(); //stores the millis value in the

selected array

digitalWrite(led, !digitalRead(led)); //changes led state

}

}

void BlinkLedC (int led, int interval, int array){

//(long) can be omitted if you dont plan to blink led for very long
time I think

if (((long)millis() - previousMillisC[array]) >= interval){

previousMillisC[array]= millis(); //stores the millis value in the

selected array

digitalWrite(led, !digitalRead(led)); //changes led state

}

}

void MyHandleNoteOn(byte channel, byte pitch, byte velocity) {

data1 = MIDI.getData1();

if (data1==48){//C3

Status[0]=1;

while(Status[0]==1) {

BlinkLedR(LedR, 10, 0);   //BlinkLed( which led, interval, one of the

stored prevMillis

BlinkLedC(LedC, 1, 0);  //last parameters must be different for each led

if (Status==!1){

break;

}

}

}

}

void MyHandleNoteOff(byte channel, byte pitch, byte velocity) {

data1 = MIDI.getData1();

if (data1==48){//C3

Status[0]=0;

}

}


Sharing a crystal between multiple devices is a very bad idea. The crystal is only a piece of the oscillator, the rest of it being a small bit of circuitry within the IC itself. Having multiple ICs connected to the same crystal will cause them to fight over who is driving it.

The datasheet for the CH340T/R, which I was able to find in English, says the following:

  When CH340 chip is working normally, the outside must supply 12MHz clock signal to XI pin.

This seems to imply that you can feed an external 12MHz clock into the chip and it will work. So we take the clock from the '328P and pass it to the '340G.

Programming the CKOUT fuse on the '328P will cause the internal clock to be output on CLKO, which we then connect to XI of the '340G. This means that that you will lose PB0/D8, but no longer need a second crystal. This also means that you will be unable to use the prescaler since doing so will affect the clock output.


Digital Read Serial tutorial - calculating the resistor value

You're very close. The resistor is there to act as a pull down resistor; If the input pin is floating it is just an antenna picking up random static. The key is that when positive is supplied (by pressing the button) the positive source needs to "overwhelm" the pull down resistor so that the input pin reads positive.

If there were no resistance, than the input pin would be reading in the middle of a direct path that does not favor positive or negative. Asside from the direct short that would be occurring, Which state the arduino would read I suspect would either be random or some property of the power supply; It would probably still read ground.

With the resistor, the signal is read directly connected to positive, before the load resistance. This way it will be sure to get a HIGH signal.

The exact size of the resistor is of little consequence. Too small and you waste current, but too much resistance is effectively just disconnecting ground again. There is a very wide range of values that will work fine between those.

I would like to note that when an arduino pin is set to input mode, it will effectively supply no current. It can be moddeled is being in series with a 100 megaOhm resistor. see http://arduino.cc/en/Tutorial/DigitalPins
for details.


Feasibility of a Wi-Fi Positioning System

I don't think that arduino is the right hardware for such a project. Better use a cheap android phone, there you have a stronger processor with more memory as well as a lot of sensors like compass, accelerometer, gyroscope and maybe in newer ones barometer, which you will need - also you have wifi. An arduino uno just comes without wifi and all the sensors. Also I guess a lot of persons already have a phone, so this will lower your project costs, because hardware is already available at most users. Last but not least I think you could use mobile phone vibrations to give feedback to the sight disabled users, oder sound commands like "go left" etc.


Possibly. It depends exactly what it is you want to drive.

When you connect 12V to the barrel jack you get about 11.3V out of the VIN pin. This is because there is a diode in series with the barrel jack to protect against reverse polarity connections. This loses some voltage (could be as much as 0.7V).

Also that diode is rated at 1A maximum. So you can't drive anything that would need more than 1A (including the current needed by the Arduino and shield components).


i am unable to make a correct program using the pushbutton to toggle LED on/off?

I would use a different approach

int led = 13;
int buttonpin = 8;
boolean waspressed = false;

void setup (){
    pinMode(buttonpin,INPUT);
    pinMode(led,OUTPUT);
    digitalWrite(led,LOW);
}

void loop(){
    if(digitalRead(buttonpin) == HIGH){
        waspressed = true;
    }else{
        if(waspressed == true){
            digitalWrite(led, !digitalRead(led));
            waspressed = false;
        }
    }
}

We can understand it better if we just take a step by step view. When the controller is started, it first executes the setup(), setting the led pin as output, buttonpin as input and setting the led pin value to low. The led pin is set to LOW because it needs to have an initial value once it is an output. The initial value can also be HIGH without changing the behavior of the circuit. Always remember to set an initial value to all your output pins. This prevent them to float, which may lead no unpredictable results.

The loop() can be a little more tricky.

State 1 - button not pressed

The first interaction tries the value of buttonpin:if(digitalRead(buttonpin) == HIGH). Once the button is not pressed (buttonpin is LOW), the interpreter moves to the else element. At this element, there is another conditional - i.e, another if. This conditional looks for the value of waspressed. This is false, as set at the begging of the code. Because of this, the information inside the conditional is not executed and the loop() is executed over and over with no change until the button is pressed.

Stage 2 - button is pressed

When the button is pressed, the next iteraction of loop() will catch this action when trying the first conditional if(digitalRead(buttonpin) == HIGH). Once buttonpin is high if the button is pressed, waspressed will be set to true. This will repeat as long as the button remain pressed.

Stage 3 - button is released

After being released, the first conditional will read buttonpin as LOW, and the interpretor will move the the else element. At that element, it will try the second conditional if(waspressed == true). Until now, there is no difference from what was executed at the first stage, however this time, waspressed is true because it was set true when the button was pressed. This leads the interpreter inside the conditional and execute the lines

digitalWrite(led, !digitalRead(led));
waspressed = false;

The first one set the led pin to the opposite value it has. I.e, if the led pin is HIGH, it becames LOW, if it is LOW, it becames HIGH. This happens because !digitalRead(led) outputs the complement of the value of digitalRead(led) - without the !.

The second one set waspressed to false again. With this, the next iteration will be back to stage one and wait for another press on the button.


No, this is a receiver only, not a transmitter.


Arduino IDE with ATtiny85 error "multiple definition of `__vector_5"

The error message was:

  wiring.c.o [...]: multiple definition of `__vector_5'
  Glove_heater_v1.ino.cpp.o [...]: first defined here

__vector_5 is TIMER0_OVF_vect. So you have one definition of this
ISR in your sketch, and another one in wiring.c. This wiring.c is part
of the Arduino core. As KIIV puts it in a comment, it uses
TIMER0_OVF_vect for timekeeping (millis(), micros() and
delay()).

You have two options for solving this:

you can use the other timer (Timer 1) in your sketch, and leave Timer
0 for the Arduino core
since you are not using the Arduino core anyway, you can get rid of it
by simply defining main() in your sketch instead of setup() and
loop().


Erratic behaviour using Serial.print() when powering only from power supply

It seems likely that your Arduino is repeatedly resetting, which means it's starting the program again from the beginning all the time. This can be caused by insufficient power.

For the standard 5v Arduino boards, the minimum recommended voltage for an external power supply is usually 7v. An on-board regulator brings it down to 5v.

Technically, you can run them directly from an external 5v supply. However, you have to ensure that it's properly regulated, and that you bypass the on-board regulator.

Obviously you also have to ensure your external supply is capable of sourcing sufficient current. If you're just running an Arduino and a small thermal printer then it's probably OK, but it's certainly worth checking.


If you start from the beginning of the project, instead of trying to jump in half way through, you'll know precisely what components you need.

Your first step shouldn't be trying to order components, but to identify (through research) how the technology works.

Second is to find out how it can be implemented, by looking at existing schematics and designs that other people have created.

Third is to design your own schematic.

Fourth is to prototype it.  It's only at this stage that you should be thinking about what components to order.

Go back to stage one and do the research. Thanks to the likes of Google it'll probably only take you a few minutes.


Is there a radar - like sensor that can tell me the distances of multiple things around the sensor?

What you're looking for is called lidar - but it's not cheap. RPLIDAR is the current price leader for non-hacky solutions, and I haven't seen it for much less than $400 anywhere.


Constants within array of structs causes strange compiler errors?

Don't put a semi-colon at the end of #define.

Whatever comes after #define NAME will be used to replace NAME across the source code.


Looks like your sketch (pin usage) is in conflict with the SD shield (SPI pins). Try using other pins.


Using Piezzo Electric buzzer 10V with an Arduino Lilypad USB

Your options:

Try it anyway with 5V: the buzzer might still produce loud enough sounds for your needs.
Use the line from the arduino to drive an "amplifying" stage (ex: 2N2222 in ON/OFF mode) - but this will also require a 10V source (like a step-up voltage converter)
Get a piezo that is designed to operate at 5V


Data from PROGMEM array mismatches initialisation

@TMa: seems to work! I totally missed the necessity of referencing the array element. Thanks a lot. But I did not get any compiler warnings without the reference operator. Why isn't this call type-safe?

The PROGMEM word is an attribute, not a type. It might be type-safe but not attribute-safe (if there is such a thing). See Data in Program Space

Reference

Putting constant data into program memory (PROGMEM)


Condition in a while loop not updated on my mkr1010

while (buttonState != LOW){
    // turn LED on:
    digitalWrite(ledPin, HIGH);
     WiFiDrv::digitalWrite(25, 255); // for full brightness
     Serial.println(buttonState);
  }

You never update the value of buttonState in this while loop.  If buttonState is not LOW to get into the while loop, nothing inside the while loop will ever change it so every time it gets checked it will still not be LOW.  It's not going to surmise that you meant to read a pin just because you used that variable to read a pin once before.

But do you really need this while loop?  Couldn't you just write the led pin low when you first get a press and then write it high when it first gets released?  See the "State Change Example".  Let the loop function be the loop.  It will lead to better code.  You don't see this now because you are a novice, but you are about to paint yourself into a corner with this approach and you'll soon be rewriting the whole thing.  It's a trap that gets most new coders.  Better to get it right now.


You have a rogue semi-colon.

Splitting your code up on the end of statements you get:

1. x = 5;
2. Serial.println (x);
3. if (x == 0);
4. { // stuff }

With the semi-colon after the if it terminates the if before the opening block {, and that block becomes a completely separate statement detached from the if.


Check your other post I answered it there. The ESP01 has 2 serial channels.


RFID stops working when I place the servo

Use a 3.3VDC regulator for your RFID board a small boxed DC-DC buck converter will be easiest, if linear use an LDO type. Ideally also use a level shifter on your data lines. This could be a resistor voltage divider or zener diode clamp at the most basic, FETs or a dedicated IC is a bit more involved but gets better results.


A PLL is a very complex device which is not something that can easily be created purely in code.

Many microcontrollers include a PLL as part of their oscillator systemm which allows them to run internally at a higher speed than their external crystal.  This is not a programmable peripheral that you can use for your own things, but an integral part of the workings of the microcontroller.

While it may be possible to write one in software the results would be very somewhat limited. The best you could hope for is to use timers to measure an incoming frequency and use the results to output another frequency through some means, maybe PWM.

To create a real PLL you would be best off using either a dedicated PLL chip (which you can buy off the shelf) or use some form of programmable logic like a CPLD that has a built in PLL block.

Some microcontrollers, most notably the Cypress PSoC range, have programmable logic blocks built in that may be more suited to your task than an Arduino.

A typical digital PLL looks something like this:

Implementing all that in code would be both tricky and somewhat slow on a little 8-bit MCU with no floating point support.  However, the basic principal of what a PLL can be summarised in one simple sentence:

  The frequency coming in determines the frequency going out.

The PLL, or Phase Locked Loop is just one method of achieving that desired result.

Another method, which is not using any form of PLL, is purely algorithmic and consists of just three things:

Three simple blocks, all of which the Arduino is, to a certain extent, capable of performing.

The first block, the Frequency Detector, works out what the frequency of the incoming signal is.  That could either be by counting the number of pulses that arrive over a certain time frame, or measuring the time between successive pulses.  Which method you use (Frequency Counting or Frequency Measuring) is really down to what frequency ranges you are using.  Frequency Counting is better for higher frequencies, whereas Frequency Measuring is better for low frequencies.  There are many examples on the web of how to do both of those using timers on the Arduino.

The Decision Making is basically working out what your output frequency wants to be according to your input frequency.  This could be as simple as "Output = input * 2", for instance, or something more complex like "Between these frequencies I want to output this frequency, between these frequencies this other frequency, etc".  It's entirely up to you.

The third block just takes the decided-upon output frequency and generates it.  That could be done using the hardware PWM generation of the Arduino.

All this, though, will be limited to relatively low frequencies (tens of kHz maximum really) though with clever coding you could push it up slightly higher.

One thing that really makes this method differ from a PLL is that you don't get the "PL" portion of it - that is, the phase of the incoming frequency is lost, and the output frequency is running entirely with its own phase.  There is little or nothing you can do to synchronise the phases of the input and output like you get with a full PLL.


What options are available for connecting to a CDMA network?

There are no CDMA (more correctly known as CDMA2000) modules for hobby projects. There are a lot of reasons for this, which I won't get into, but suffice it to say, it is the way it is.

EDIT

Okay, I'll bite (just a little).

I think the most important reason is CDMA is actually kind of USA-centric technology. While there are now a few other countries that have CDMA networks deployed, it pales in comparison to the number GSM networks globally.
So in the cellular services world there is a service offering called machine to machine (M2M). What this is is a service to allow various machines (think parking meters, vending machines, ATMs, etc.) to have a data connection for control and status messages. These services are usually bought in bulk at rates much lower than equivalent consumer services would cost.
The rest from here on out is just economies of scale. If I am making an ATM machine, would I rather be limited to a handful of countries, or be able to sell in almost all countries. The obvious choice is the latter, so these manufacturers use GSM.
The reason a hobbyist can get anything cheap is because some other industry is using a lot of them. For example accelerometers used to be crazy expensive, that was until millions of cell phones started shipping with them every year, and now you can get them for pretty cheap. GSM modules are relatively cheap because there are lot of devices being made with them for the above mentioned reasons. CDMA modules are not so cheap because there are not a lot of devices using them.


A relay is a common way to allow a smaller power source to safely control a larger one. A relay is like a switch.

Here's some reference material about using a relay with a microcontroller. You shouldn't have much trouble finding more material now that you know what you're looking for.


Switch a 12V 3.3A component from an Arduino

A relay, as pictured, is a good choice. It provides complete galvanic isolation and switches the power properly.

Another option is to use a MOSFET that can handle enough current (an N-channel switching the ground as a low side switch, or a P-channel switching the power which is itself switched by an N-channel, as a high side switch).


error: 'analogRead' was not declared in this scope

// yours code looks Ok, but i think problem is with Arduio IDE setting. Go to the "Tool > Boards...." in arduino IDE and make it sure that you have selected the right option of Arduino module. Mean it is same as you are using in hardware?


The Arduino Forum has a Gigs and Collaborations section where such questions are welcome.


This is a basic problem of only having two sensors.  There is no way that two sensors of this simple type (some motion yes/no) can be used to work out where the motion comes from except when there is a difference between the two sensors.  Anything else is, and always will be, ambiguous.
If you think of it as a circle divided in two, you have only three possible conditions:

That is, left, right or somewhere.  Not ideal.
So you need more data to be able to make a decision.  That means more sensors.  The ideal scenario is four sensors - left, right, front and rear.  That gives you many possible scenarios, including:

As you can see from that you have a full 360° idea of where the motion is. You can even know how far to the left it is by if the front or rear is also on.  For instance, using sailing terminology, those 8 circles would mean (in order):

Motion on the left beam
Motion on the port bow
Motion dead ahead
Motion on the starboard bow
Motion on the starboard beam
Motion on the starboard quarter
Motion dead astern
Motion on the port quarter

Also the dead-ahead and dead-astern could be indicated by just the forward or rear sensor on and the left/right sensors both off.  You could even use that fact to give some indication of the distance of the motion depending on the angular coverage of the different sensors.


Can I apply a Kalman filter to DHT11 data?

Learn about the kalman filter and what it does. It requires a certain understanding of what it is, what it is good for and why you would eventually use it. It seems to me, that at the moment this isn't your strongest topic.

Thereafter, figure out which !multiple! sensor values you have, since only with a "model" and an "observation" a filter of this kind makes sense in the first place.

To specifically adress your question: you can apply any filter to any data. The hidden question, if it makes sense in this case is not trivial to answer, since you didn't exactly provide the vast information. My guess is, you only have this one sensor, and it would be (at this state of knowledge) a reasonable idea to use a bandpass filter of sorts instead.


the sensor gives unstable readouts varying for around 0.03-0.04 V each
  readout cycle

If your sensor outputs 0 to 5V and you're only getting 0.03 to 0.04 variance then I would say that it's working pretty well.  You can get a more stable output by averaging several readings before printing them.

Additionally, for even more stable readings consider powering your Audrino from a battery.  USB power can induce a considerable amount of noise if it's coming from a PC or Laptop USB port.  Also, there is a low noise mode where you can put the Arduino to sleep during your ADC reading (and it wakes up afterwards) which helps a lot with ADC noise reduction.


How to add two assembly arrays in arduino

add r16, Z+

You probably meant something like
add r16, memory[Z+]

However, the AVR is a RISC processor. It has instructions to address the
memory, and instructions to do arithmetics, but it has no “complex”
instructions that both address the memory and do arithmetics with the
addressed data. So you have to use separate instructions to:

Load (ld) the data from RAM

do the arithmetics

store (st) the result in RAM

Now, looking at your assemble code, I have a few comments:

If you are mixing assembly and C/C++, you should pay attention to the
ABI conventions. Specifically, some registers, like r28 and
r29, “belong” to the caller. If your function needs to use them, it
should save their contents (typically by pushing them to the
stack) before clobbering them, and restore them (pop) before
returning.

For adding two 8-bit numbers (a + b), a single addition is enough.
There is no point in starting the addition with zero (i.e. computing
0 + a + b).

For managing the counter, it can be more convenient to decrement the
initial count you where given (like in C: if (--length) return;)
rather than using an extra variable that is incremented.

There is no need to split such a simple function into smaller
functions.


The line

while (Serial.availableForWrite() <= 0) {}

waits until the serial output buffer is not full. Whereas

Serial.flush();

waits until the serial output buffer is empty.


GPS seems to be working and informing you that you have no signal.  Usually happens inside buildings, when far from a window or when antenna isnt properly connected.

Testing out of doors is many times not possible, so try placing your antenna next to a window with a partial view of the sky.  Wait for a couple of minutes until you get a fix on 4 or 5 satellites.


Simple version: No, you cannot program Arduino using Objective-C.

Long version:
The Arduino IDE uses avr-gcc as it's compiler, and avr-gcc is a C/C++ compiler, not an Object-C compiler. The Arduino libraries are written in C/C++.

There are other compilers that exist for AVR processors, and so it is possible to use other languages for the AVR.

However, if you switch to a different compiler for your code, you will not be able to use the Arduino libraries with it, because they are written in C/C++ for the avr-gcc compiler. (It may be possible to compile the Arduino libraries with avr-gcc, and then link them to your code using external language linking methods, but that could be a significant challenge.)

Also, I do not know of any existing Objective-C compilers for AVR; it's possible one may exist, but after a quick web search, I didn't find any.


Replacement crystal on Uno for cold temperatures

There is a solution for just this problem, it's a "crystal oven". It is used to keep a crystal at a constant temperature so that the oscillating ferquency remains very stable.

Crystal ovens are usually expensive as they are quite precise and have good insultaion, but here's a kit that you might adapt for your uses: http://www.minikits.com.au/Oscillator-Heater, or google around to see if you find something that might suit you better.

You could also consider making a heater with a simple temperature regulator of your own to keep the crystal warm  (many temperature sensors for Arduino are available on the web).


You could put the 12v from the barrel jack on both Arduninos Vin pins by jumpering the Vin pins together instead of the Vin->+5 or +5->+5.  Then they'd have independent protection and regulation of 1A, 5V through their NCP1117ST50T3G chips.


How to get full response json SIM900 + Arduino?

Okay, I've found a solution. To start with, you need to download the server response length and loop according to the response length.


IDE to program Arduino Uno especially internal interrupt vectors

You can do all you need to do in the Arduino IDE.  It doesn't "block" you from doing any low-level operations.  Any other IDE will also allow you to do what you want.

All the information you need to manipulate the "guts" of the Arduino is the datasheet for the main chip - the ATMega328P on the Uno.

http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet.pdf


UltraSonic Sensor wirh ESP-01 Standalone

There are 2 things here.
Ultrasonic sensor works on 5V while ESP on 3.3V. So your sensor is sending 5V signal to ESP. It might fry your board but I believe it has a safety cut off of everything above 3.3V and that's the reason your application is not working.
Cheap solution would be adding voltage divider to your Echo pin:
https://randomnerdtutorials.com/how-to-level-shift-5v-to-3-3v/
but then you will face the issue mentioned by Juraj above.
You may then overpass that issue manually or look for more sophisticated (expensive) solution.


How to read data from Arduino with Raspberry Pi via I2C?

You might want to graduate to the pigpio library for the Pi side of this.

Here is where you can find examples of how it works.

here is a fun one that is like Wireshark - will show you the I2C traffic:

https://github.com/joan2937/pigpio/tree/master/EXAMPLES/C/I2C_SNIFFER

Here is the FAQ about I2C


Which sensor is best for obstacle detecting with retroreflector?

I think the question is worded to get a specific answer; I do not know if this is the answer you want. I'll give you that answer first:

I'd say an infrared LED, and an infrared detector.

Strobe the LED, then measure the difference between when it's (known to be) on, and when it's (known to be) off, to compensate for ambient light.

However, if I was doing this, I'd consider an ultrasound sensor - no retroreflector needed; instead you get the distance to the (obstacle or reflector).


Reading and interpreting Serial information

Two things immediately jump out at me:

char FirstLetter = input.charAt(1);

charAt(1) is the second letter, not the first - the first is charAt(0).

if (FirstLetter = 'U')

That is saying "If I have been successful in assigning the value 'U' to FirstLetter then..." - "=" is assignment, you need "==" for comparison.

Also your readSerial() function is complete junk.  It's not doing anything at all like you think it is.  You should read this to better understand Arduino serial reading: http://hacking.majenko.co.uk/reading-serial-on-the-arduino


How to interpret accelerometer output data?

The accelerometer will output a specific number of volts (or millivolts) per g.  You need to find that information in the datasheet for your accelerometer.

Then you need to take the readings you make through analogRead() and convert them to a voltage. Then that voltage can be used, combined with the value you found above, to determine the g reading.


"stray '/302' in program error" when compiling

0302 is 0xc2. Somewhere in your source you have one or more non-breaking spaces (0xa0) encoded in UTF-8 (0xc2 0xa0). Use od or a similar tool to find them, and then replace them with normal spaces. Since you have non-ASCII Latin-1 characters in your source, those characters are encoded as two bytes with the first being 0xc2 or 0xc3. Remove all non-ASCII characters before proceeding.


Speaker not producing the right sound after a led strip was introduced

The tone() command is interrupt driven.

To get the tight timing needed by the LED strips interrupts are disabled while sending the data.

That means the tone() command stops while you're updating the LED strips and starts again afterwards.

The end result will be the sound is corrupted - maybe sounding like it's bubbly or underwater or just "rough".

The two basically can't work together and I'm not sure what to suggest to make them work together on a low-end MCU like the AVR.


You need the person to emit a signal and the robot to receive it, sounds simple, but it isn't.  What you are trying to do is position fix the transmitter, in the same way as an ATC locates a plane.

The robot will need at least two directional receivers positioned a certain distance apart (depends of frequency and accuracy) to allow the robot to triangulate the transmitter.  The more receivers the more complex the triangulation.  The frequency of the signal you transmit will affect the distance that the robot can be from the person, research Frequency spectrum and transmission distances.  The longer the distance the signal can travel the stronger the signal will be at close range.  You also have to counter reflections and side lobes which will give you inaccurate readings on the transmitter direction.
Once you have dealt with all of that all you need to do is scan for the strongest signal on your frequency, triangulate it and then head towards it.
Whatever sensor you use the theory is the pretty much the same.

Could you tag the person with a GPS receiver and WIFI/BT and get it to transmit its location.  The robot could then consult its GPS and calculate the delta and move accordingly.


How to access parse cloud functions using arduino?

I read api of Parse and there i got the class to call cloud function from
Arduino.I hope it will help others.

 ParseCloudFunction cloudFunction;
 cloudFunction.setFunctionName(fnname); //String ("hello")
 cloudFunction.add("light_sensor", 139); //parameter

 ParseResponse response = cloudFunction.send();
 Serial.println(response.getJSONBody());


Interrupt flags are set even without interrupt enable flags, so there is pending overflow that you didin't cleared. And guess what happens after enabling TOIE1 flag. It gets handled by ISR. That's on behalf of Arduino's analogWrite() PWM outputs (all timers are up and running in 8bit mode and 1.024ms period).

Btw global interrupts are disabled and reenabled inside of ISR handler by hardware so you shouldn't have cli() and sei() in it.

Also there is another issue - counter mode is preset to 8bits and much bigger prescaler, so the first round is way off.

void setup() {
  Serial.begin(115200);
  Serial.println("start");
}

#define ENTRIES 5
long stack[ENTRIES+1];
int ctr = 0;

ISR(TIMER1_OVF_vect) {
  TCNT1 = 50000U;
  stack[ctr++] = micros();
  if (ctr > ENTRIES)  TIMSK1 &= ~(1 << TOIE1);
}

void loop() {
  if (ctr > ENTRIES) {
    for (int i = 0; i < ENTRIES-1; i++) {
      Serial.print(i);
      Serial.print(": ");
      Serial.println(stack[i+1] - stack[i]);
    }
    ctr = 0;
  }

  if (!Serial.available()) return;
  char c = Serial.read();
  if (c == 't') {
    Serial.println("testing");

    stack[0] = micros();
    ctr = 1;

    TCCR1A = 0;           // you have to change the timer mode before changes
    TCCR1B = 0;           // stop the timer
    TIFR1 |= _BV(TOV1);   // clear the overflow interrupt flag by writing 1 to it
    TCNT1  = 50000U;      // tick in around 1ms / this makes more sense if it's set correctly
    TCCR1B = _BV(CS10);   // no prescaler ?????  REALLY???? this one is prescale by 8
    TIMSK1 |= _BV(TOIE1); // enable timer overflow interrupt
  }
}


Your timer configuration is ok so far. Never the less I recommend using the TIMER1_COMPA_vect interrupt vector instead of TIMER1_OVF_vect which has the advantage of better readability (in my oppinion) and TCNT1 doesn't have to be reset in the ISR (instead, OCR1A is just initialized with 62500 once in setup()). Therefore, TIMER0 has to run in CTC (clear timer on compare match) mode and WGM12 has to be set in TCCR1B.

The reason why seconds_passed is incremented twice is because you Serial.print(seconds_passed++) in instantSpeed(). Printing on the serial interface is damn slow and using it in an ISR is a no-go!


What else is consuming Data Segment reported by avr-size?

Most of the missing data section is probably made of string literals.
When you write something like
Serial.println("Hello, World!");

the string "Hello, World!" is implemented by the compiler as an
anonymous array of characters, and the address of this array is
provided to the println() method. Since the array is anonymous, it
doesn't show up in the output of avr-nm. You can check that this is
the case by looking at the actual contents of the section:
avr-objdump -s -j .data x.elf

And you can avoid this by wrapping the strings in the F() macro:
Serial.println(F("Hello, World!"));

This has the effect of keeping the string in flash, and passing the
flash address to the println() method. Note that this is actually a
different, overloaded method, that knows how to retrieve the character
data from flash.

Edit: Adding some clarifications.
All this complexity about flash vs. RAM storage comes from the fact that
the AVR uses a Harvard architecture, where RAM and flash are
in different address spaces, accessed through different memory buses
using different machine instructions. Unlike C, the C++
language has no notion of address spaces, and the compiler simply
assumes that any pointer to function holds a flash address, whereas any
pointer to data holds a RAM address.
Per the rules of the language, a string literal has the type
const char *, and a function that should be able to accept a string
literal should take a const char * parameter. Since these are pointers
to data, when you dereference them the compiler emits the machine
instructions that are appropriate for reading RAM. This is why the
compiler puts all string literals in the .data section of the flash: at
program startup, the C runtime copies them to the .data section of the
RAM, making them accessible to those machine instructions.
The current solution to avoid this useless copy involves a bunch of
preprocessor macros like F(), PSTR(), PROGMEM,
pgm_read_byte()... that expand to compiler extensions or inline
assembly. These allow you to pass around the flash addresses of string
literals disguised as regular data pointers. These pointers should never
be dereferenced with the regular operators of the language (* and
[]), but only through the pgm_read_*() macros. And they should only
be given to functions that do expect these kind of pointers, like
sprintf_P() or Print::println(const __FlashStringHelper *), which is
the println() that gets invoked when using the F() macro.

Is there any way to put the literal in stack

Yes, there is, but it has to be done explicitly:
PROGMEM const char greeting[] = "Hello, World!";

void say_hello() {
    char stack_copy[strlen_P(greeting)+1];
    strcpy_P(stack_copy, greeting);
    Serial.println(stack_copy);
}

As you have already noticed, it is preferable to not put the strings in
RAM at all, and instead use functions like sprintf_P that expect
flash-based strings. However, if you need to use a library function that
expects a RAM-based string, you can use this trick to avoid permanently
committing it to RAM.


How can I record something using an arduino and use bluetooth to search those terms on google now?

If this is a simple "I can do it!", then it's a good project to work.
If it's just something to use, I'd rather use RPi. It's much much more simple to do it. Even already has proper connectors and everything. Just plug&play for this kinda application.


According to the documentation, SysEx messages are sent like any other messages:

array[0] = 0xf0;
array[1] = 0x7f;
array[2] = 0x7f;
array[3] = 0x02;
array[4] = 0x7f;
array[5] = 0x01;
array[6] = 0xf7;
usbMIDI.sendSysEx(7, array);


Why NVIC_EnableIRQ handler function only run once?

Two things:

Never use delay() inside an ISR. On some systems it may work, but on most it will just block. It's bad practice to have your ISRs run for more time that absolutely needed anyway.
You need to read the status register for the TRNG to clear the interrupt flag. You're doing that in your first code sample with if (TRNG->TRNG_ISR == 1) {.


stop running a certain function when sensor picks up something and return to where it stops?

You can use different ways:

Pause/sleep, don't use this, since it will block other activities
Poll, poll for time, and check every so-many ms what to do.
Timers/Interrupts, every microcontroller has one or more timers which you can use to generate an interrupt to perform an action. The interrupt can change the mode, and in your main program you can check for the mode what to do (go to another position, pick up something etc.

The last one takes a bit more programming, but is the preferred way to easily make changes later on.

There is no 'pause' function in C, but you can of course pause until an interrupt is triggered. In the datasheet of your microcontroller you can read how this can be used.

So in general your loops look like:

loop()
{
   switch (mode)
   {
   case modeMoveAToB:
       ... move from A to B (just a small portion, like 1 cm)
       break;

   case modeActionY:
       ... Perform action Y
       mode = modeMoveAToB;
       break;
   }

   if (SensorTriggered)
   {
      mode = modeActionY;
      SensorTriggered = false;
   }
}

In the trigger interrupt you set SensorTriggered to true.

Make sure that the modeActionY does not take long, so let it move e.g. 1 cm, so the sensor (SensorTriggered) is checked every 1 cm. If you need other actions, just add them in the case statement. And make the inside of each case statement a function, so you can easily reuse it later and/or keep the functionality clearly divided.


Yes, all those things have been done before.  Here's some suggestions for components:

MCP23S17 / MCP23017 - SPI / I2C IO expander (16 IO pins, many can be connected together) (MCP23S17 library)
MCP3208 - 8 channel 12-bit SPI ADC (MCP3208 library)
TLC59116 - I2C Constant Current LED PWM driver (16 channel) (TLC59116 library)

Some other useful tutorials that may help:

Keypad - read lots of buttons / switches with not many pins
Multiplex - Control many LEDs with not many IO pins


ESP8266 compilation error: "previous declaration of 'HTTPMethod HTTP_HEAD'"

You need a newer version of the WiFiManager.h library. This issue was fixed August last year.


MCU fuses used by Pro Mini and ATMega 2560 and power down

The data sheets are the ultimate source. However, that may be a bit overwhelming. I find the below great resources very helpful.

1) Online Fuse Calculator There are many others.

2) avrdude-GUI
there are many others out there.

3) the .\arduino-1.5.7\hardware\arduino\avr\boards.txt

uno.bootloader.low_fuses=0xFF
uno.bootloader.high_fuses=0xDE
uno.bootloader.extended_fuses=0x05

4) I also read the fuses from any device before I stomp over them. And check into what each mean.

As for narrowing down the features the Online Calculator very helpful to start with and then read into the data sheet for ones of interest.

For the most part there have several questions and answers for low power modes, using interrupts to re-awake. Where there appears to no direct fuses to save power, outside of clock source and speed. Arguably Brown Out detect is a fuse, but that is not directly related to saving power.


Your problem here is that you have an array of 10 bytes, which works fine, only that in your loop you don't stop or check that you are within that array.

If this is supposed to run forever, you could add a line like this at the end of your loop:

if (thisStep > sizeof(orders)-1) thisStep = 0;

(-1 because you have an array of 10, which are from 0-9, sizeof will return 10)

this will make it start from the beginning again.


2.8 inch tft LCD displays / Max Brightness / Startup White Screen / mirror text for Head Up Display Usage

1) set Max Brightness

You set the brightness of the backlight (usually) using PWM.

  2) change the start up splash screen from being white to black

That's not a splash screen. That's just the back light being on before the screen is initialised. Just don't turn on the back light until you need it.

  3) how to change settings so that text can be mirrored so when display is reflected into mirror or glass window the text reflects onto the mirror / glass so that it is readable

Either do it in software (tricky) or look at the MADCTL (many have it called that) register in the datasheet.  The library probably won't support it, but it's part of how it deals with display rotation, so you could examine that function and compare it with what's in the datasheet (hint: 180° rotation is actually flipping both the X and Y axis).


You must write the clock-select bits to the correct value. The simplest
way to do it is to write the proper configuration into the TCCR1B
register:

TCCR1B = (1<<CS12)|(1<<CS10);

In your program, you used |= instead of =. This doesn't write the
bits appropriately: it only sets (writes to 1) the bits CS12 and
CS10 but doesn't clear CS11. Since the Arduino core library sets the
prescaler to 64 (CS11 and CS10 set), you end up with all the
clock-select bits sets, in which case the timer is clocked by an
external signal on the T1 pin. Not what you want.

Edit: Judging from the comments, it appears that at least dannyf did
not understand my answer, I am therefore adding a clarification. There
are two scenarios when you may want to tweak the control registers of a
peripheral:

The peripheral is normally controlled by the Arduino core library,
and you want to use it through that library. Typical case: you want
to use a timer to analogWrite(), or the ADC to analogRead(), but
you want to clock the peripheral at a frequency which is not the
core's default.
You want to use a peripheral directly rather than through the Arduino
core. Either you are going to “take it over” from the core, or it's a
peripheral the core doesn't use in the first place.

In the first case, you should only touch those bits of the control
registers that you must change. The other bits should be left alone, at
whatever values the core has set them to. This is the approach of
dannyf's answer.

In the second case, it is wiser to not rely on the core's default
setting, and instead write every single bit of the control registers
to the values appropriate for your application. This is the scenario of
the original question, and the solution proposed in my answer.

For the particular case of this question, the TCCR1B register would
be set to: ICNC1 = 0†, ICES1 = 0, reserved bit = 0, WGM13
= 0, WGM12 = 0, CS12 = 1, CS11 = 0 and CS10 = 1. Combining those bits
together gives the setting TCCR1B = 0x05;. However, for readability
reasons, I prefer to write that value (1<<CS12)|(1<<CS10), as in the
question and in my original answer. Some people may prefer to explicitly
write every bit, like

TCCR1B = (0<<ICNC1) | (0<<ICES1) | (0<<5)    | (0<<WGM13)
       | (0<<WGM12) | (1<<CS12)  | (0<<CS11) | (1<<CS10);

Whichever version you prefer is up to you. I personally don't find this
latter version any easier to read.

†: The values of ICNC1 and ICES1 are actually
irrelevant in this case.


Is Arduino uno SPI comunication can be also master and slave in the same time?

You can have several devices on an SPI bus. Each must have a chip select. The Arduino SS pin (Uno pin 10) is often used for chip select. Chip select pins should then be in output mode.

Connect the sensor and display to the SPI bus (MOSI, MISO, SCK) and use a chip select pin for each.

A driver (library) for a device connect to the SPI bus will typically assert the chip select pin and transfer commands and data. The SPI transfer is both read and write at the same time.


You are redefining the random number wrongly each time with

randomNumber += xPrevious;

this is an error. You need another new variable (initialised at 0) to keep the running totals of all the random "rolls". You should be able to fix your program now you know this. Maybe something like

TotalofTherandomNumbers += xPrevious;

to start off with.

You may also want to add in the after the line

 randomNumber = random(1,7);

a new function, of yours, that takes random value randomNumber  do the action in the game, what ever that is,  depending on if its the first or second player.


Try something like this:

typedef struct  {
  char id[2];
  ....
} Device;

const int DEVICES_MAX = 8;
Device Devices[DEVICES_MAX];

for (int i = 0; i < DEVICES_MAX; i++) {
  Devices[i].id[0] = '1' + i;
  Devices[i].id[1] = 0;
  ...
}

for (int i = 0; i < DEVICES_MAX; i++) {
  if (!strcmp(Devices[i].id, id)) {
  ...
}

Cheers!


Converting `millis()` to decimal seconds?

Dividing an integer by an integer (1000) yields an integer, regardless of what you cast that result to.

Instead you need to divide the integer by a float, or cast the integer to a float first. The simplest way is:

Serial.println(millis() / 1000.0, 3);

The 3 as the second parameter tells Serial.println() how many decimal places to print. The .0 at the end of 1000.0 forces the compiler to see 1000 as a float value (you can also use 1000f if you prefer).

Since floating point can be quite expensive it's possible to emulate it using integer division and modulus (although they are still quite expensive):

uint32_t now = millis();
uint32_t secs = now / 1000;
uint32_t ms = now % 1000;

Serial.print(now / 1000);
Serial.print(".");
if (ms < 100) Serial.print("0");
if (ms < 10) Serial.print("0");
Serial.println(ms);

You could replace the % with a x1000 and a subtraction too if you like:

uint32_t now = millis();
uint32_t secs = now / 1000;
uint32_t ms = now - (secs * 1000);

Serial.print(now / 1000);
Serial.print(".");
if (ms < 100) Serial.print("0");
if (ms < 10) Serial.print("0");
Serial.println(ms);

A further method would be to first "print" the milliseconds to a string, then split it into two chunks. Print the first chunk, then a decimal point, and finally the second chunk. This avoids the use of any division or multiplication, but does use expensive string operations:

char num[10];
snprintf(num, 10, "%lu", millis());
uint8_t nlen = strlen(num);

for (uint8_t i = 0; i < nlen - 3; i++) {
    Serial.write(num[i]);
}
Serial.write('.');
for (uint8_t i = nlen-3; i < nlen; i++) {
    Serial.write(num[i]);
}
Serial.println();

So really there is no "perfect" method for converting milliseconds into seconds that uses hardly any CPU cycles. All base 10 operations tend to be a bit expensive on a small microcontroller without hardware support for integer MUL/DIV instructions, or a Floating Point Unit.


Stopping Serial on RX/TX pins while running Serial on USB

The Serial and Serial1 are two seperated ports. They are not connected. The Serial is the USB serial and does not use pin 0 and 1 at all. The Serial1 is the hardware serial port at pin 0 and 1, but if Serial1 is not used then pin 0 and 1 are normal digital pins that you can use.

Don't be confused by the text labels printed on the board. Pin TX (also called TX1) is D1 and pin RX (also called RX1) is D0.
This is the pinmapping for the Micro: PighiXXX - Micro.

The Arduino Zero uses 'SerialUSB' to indicate the serial port via USB. You can do the same for the Leonardo and the Micro and use the alias 'SerialUSB' in your sketch instead of 'Serial'.
I found it more convenient to use 'SerialUSB' in my sketch, but not many people use it.
The Serial port at pin 0 and 1 is still called 'Serial1'.


How to convert array of chars to array of ints?

If you have a C string containing ASCII numbers with a common delimiter (comma in this case) you can use the strtok() function to split it into individual strings.  Then you can use atoi() to convert those individual strings into integers:

char array[] = "10,11,12,1,0,1,0";
int intArray[7]; // or more if you want some extra room?

int ipos = 0;
// Get the first token from the string
char *tok = strtok(array, ",");
// Keep going until we run out of tokens
while (tok) {
    // Don't overflow your target array
    if (ipos < 7) {
        // Convert to integer and store it
        intArray[ipos++] = atoi(tok);
    }
    // Get the next token from the string - note the use of NULL
    // instead of the string in this case - that tells it to carry
    // on from where it left off.
    tok = strtok(NULL, ",");
}

Note that strtok() is a destructive function. It will decimate your existing string with NULL characters as it slices it up.


You are correct NFC is 13.56MHz the key chain ones you are referring to are most likely 125kHz The reader you have will only read 13.56MHz this is the NFC and HID cards. If you want to read the Key Chain ones you will need a reader like this one. Weigand 26 Card Reader Most Phones will not read the 125kHz


TimedAction.h: No such file or directory

You can use three ways to install librarys in the Arduino IDE:
The probably easiest way is to go to Sketch > Include Library > Manage Libraries, (you can use Ctrl+Shift+I too) search for the library you want to install and click the install button. After that you need to include the library in your sketch with a #include <LibraryName.h>, or if you don't know the name, head again to Sketch > Include Library and click on the library you want to include.
If a library is not in the Library Manager from step one, you have to download the .zip file, go to Sketch > Include Library > Add .ZIP Library and search for the file. You just have to do that once, and it will be moved to you library folder. Again, make sure to include the library into the sketch.
If you just have a single file, you can move it to the sketch folder and include it by using #include "LibraryName.h", but you have to do it all over again for a new sketch, so I would recommend the other solutions if you can and want to use it permanently.


The Serial Monitor's baud rate must match what you have in

Serial.begin(9600);

The EDP8266's baud rate is specified in the line

ESPserial.begin(9600);

and that is the one you need to change to try different baud rates with the ESP8266. The newer AIThinker firmwares default to 115200 baud, not 9600 baud.

Be warned, though, that SoftwareSerial isn't that great at 115200 baud - you tend to get some data corruption. It is best to change the baud rate to 9600 baud with

AT+CIOBAUD=9600

I'd also recommend investing in one of the ESP-01 programming boards from eBay. Make sure you get one of the ones with a switch on it that switches between programming and UART mode. Something like this one. It makes working with the ESP-01 much simpler - you can directly use your PC to set it up right for your system, and even upgrade the firmware (or program it directly with a sketch from the Arduino IDE if you install the right core) with minimum hassle.


Reference link: https://create.arduino.cc/projecthub/rafitc/what-is-watchdog-timer-fffe20

Watchdog timers can be found in the datasheet. If there is no intervention to this module by the software, the MCU will be reset. basically, restarting all the functions.
It is a bad idea to use WDT to solve your particular topic. You should try to fix the issue
The external watchdog timers (Example: ADM8320) is more reliable than internal ones


Arduino Uno R3 stuck in DFU mode/Port not recognized

It sounds like your ATMega16U2 has lost its CDC/ACM firmware and is entering DFU mode by default to allow you to install firmware.

Installing the CDC/ACM firmware using dfu-programmer would get it working again.


Is there a portable timer interrupt library?

I think it would be hard, or impossible, to make such a library. Already there are problems with pin-change interrupt libraries, and Software Serial (which uses pin-change interrupts).

Plus, to have a generic "callback" might tempt people to do things which they shouldn't anyway in an ISR, like do serial printing.

Let's say you choose to use a spare timer (eg. Timer 1). You have the issue now that you won't be able to do (some) PWM output because that uses Timer 1.

The closest would be to lever off the existing millis() code and just have a test in loop to see if the time interval is up, and then call a function - however that wouldn't be an ISR.


Autonomous Quadcopter power distribution and sensing concerns

Your question is quite long. I've broken it up into several parts:

  whether or not it is safe to have a common ground on arduino with an 8 amp power supply

Yes. In fact, if you have any electrical connection (even a signal) between those two, you'll need a common ground to ensure integrity of the data being sent.

  if it is safe to use a 5 volt 8 amp power supply with these sensors.

I didn't see how much they drew. Without a lot of information, I'm going to say yes. If you don't need that much current, consider removing one of them so you only have 6A or 4A, since 8A is quite a bit if you aren't using it (and you might waste electricity in the conversion process). Make sure to have a thick enough wire for it. A best practice scenario would be to use each ESC separately or use two of the ESCs in parallel (with all  of the grounds connected!). This would isolate the current to either 4A or 2A.

  while powering my IMU off the BEC and sending motor PWM signals my sketch would run for about 10 seconds then freeze. It was not until i powered my IMU off the arduinos 5 volt power that I was able to run the sketch flawlessly. What could have been causing that?

I'm not quite sure what would be causing that without seeing the code/circuit for that. The only thing I can think of is the grounds weren't connected and the signal got corrupted.


Programming Attiny45 using Arduino Uno with weird behavior

If you take a look at Attiny45 datasheet, you will find at the very first page:

Operating Voltage

1.8 - 5.5V for ATtiny25V/45V/85V

2.7 - 5.5V for ATtiny25/45/85

Your circuit will have unpredictable behavior out of this range. If you want to use four AA cels, you can organize them to have a 3V output or use a step-down voltage regulator.


I actually think you are meaning what is the difference between the Arduino Mini and the Arduino Pro Mini, since there is no such board as the Arduino Pro Micro. However there is a board called the Arduino Micro and also the Sparkfun Pro Micro, so this answer will look at all four.

Arduino Mini

Arduino Pro Mini

Arduino Micro

(Sparkfun) Pro Micro

Microcontroller
Arduino Mini: ATmega328
Arduino Pro Mini: ATmega328 (ATmega168 on older boards)
Arduino Micro: ATmega32U4
Pro Micro: ATmega32U4

Memory
All four have 32KB of Flash and 1KB of EEPROM
Both Minis have 2KB of SRAM where as both Micro boards have 2.5KB

Digital I/O
Both Minis have 14 (of which 6 provide PWM output)
The Arduino Micro has 14 also (of which 7 provide PWM output)
Some of the analog pins can also be used as digital I/O
The Pro Micro has 12 (5 PWM pins)

Analog Inputs
Arduino Mini/Pro Mini: 8 (some boards only break out 6 analog inputs)
Arduino Micro: 12 (6 dedicated and 6 from digital I/O pins)
Pro Micro: 9 channels of 10-bit ADC

USB
Arduino Mini/Pro Mini: Requires FTDI cable or Sparkfun breakout board to provide USB power and communication to the board.
Arduino Micro / Pro Micro: Native USB

Clock
All 16 MHz
(Some 3V3 variants run at 8MHz)

Power
Arduino Mini: 7-9 V
Arduino Pro Mini: There are two version of the Pro Mini. One runs at 3.3V and 8 MHz, the other at 5V and 16 MHz. VRAW  can accept voltage up to 12VDC.
Arduino Micro: USB or external supply of 6 to 20 volts (recommended range is 7 to 12 volts)
Pro Micro: can accept voltage up to 12VDC

Interrupts
Arduino Pro Mini: The Atmega328 has 2 hardware interrupts available
Arduino Micro / Pro Micro: The ATMega32u4 has 5 hardware interrupts available
credit: Enric Blanco


Looking at the datasheet, the TSL2591 does not appear to have a comfigurable address mechanism, therefore you are most likely obliged to use an I2C Multiplexer.

One example of such a device is the TCA9545A, Low Voltage 4-channel I2C and SMbus Switch With Interrupt Logic and Reset Functions, that can split one I2C line into 4 buses.

They are very easy to use and the pinout (and datasheet) are self explanatory.

Don't forget that you will need 3k3 Ω resistors on the INT, RESET, SDA and SCL lines from the Arduino and on each of the INTx, SDx, and SCx lines from the TCA9545A:


While it would have been nice to see your research rather then having to spend some time finding this information myself, I did find this http://www.instructables.com/id/Add-Ethernet-to-any-Arduino-project-for-less-than-/ from what I can see this should be compatible to any arduino as long as it has 3 volt pin and 4 i/o pins. While the arduino micro doesn't have a 3v3 pin, as far as I know, that shouldn't be an issue as long as you can drop the voltage from the 5 volt pin, this module should work for you.


Some fixes:

pin==2;  should only be 1 = here. == is a comparison.

pinMode(sw3,INPUT);  make this INPUT_PULLUP, to turn on the internal pullup resistor

if(digitalRead(sw3)==HIGH){  change this to LOW, and wire your switch/button to connect the pin to GND when pressed. The internal pullup will unsure the pin is HIGH when not pressed, and the button/switch makes it LOW when pressed. The pin is thus not allowed to 'float' and return a random HIGH or LOW.


Secure HTTPS request fails 90% of the time

Increase the timeout for your request with HTTPClient.setTimeout(). Note the timeout is in milliseconds.

HTTPClient http;
http.setTimeout(15000); // 15 Seconds
http.begin(url, thumbprint);


Water flow sensor unable to get readings

Sensor to Arduino(Nano)
  Sig --> D2

Your connections are wrong.

int vla=analogRead(2);

is reading from analog channel 2, which is pin A2 on your Nano, not D2

D2 is not an analog pin and thus you can't use it with analogRead().