text:
Hooking up 12v Push button to arduino uno/nano
I want to use one an push button with an led in middle, similar to this one on eBay.
The push button has a 12v input I want to hook it up to an Aduino Uno or Nano.
Is there a way to hook it up and receive the signal?
Specifications from the eBay page:

Latching type, push it—on, push it again — off
Switch Rating: 3A/250VAC
LED voltage: 12V only
Contact Configuration: 1NO1NC
Pin Number: 5

You can probably power the light using only 5v instead of 12v. The led will be less bright, but probably still visible. The button part has nothing to do with 12v so you can just use 5v like !AMADANON Inc. said.

Most likely, there will be a push button, and on separate wires, there is a light. If this is the case, you can hook the push button part up to the arduino. You can test this - find two random wires, test the resistance with a multimeter, then press the button and see if the resistance changes. Keep trying until you find two wires that change when you press the button.
Once you find the pair, you can hook one of those two to a digil pin on the Arduino, and via a resister (large, anything 10kilo-ohm or larger is fine) to ground (GND). Then, connect the other side of your pushbutton to 5V. See http://arduino.cc/en/tutorial/button for photos and a circuit diagram - their wiring is more complicated than it needs to be, and their button has 4 pins in two pairs (left pair, and right pair in the picture with the breadboard; the left-top and left-bottom are permanently connected, and the right-top and right-bottom are permanently connected). Have a look at the circuit diagram - that's a lot simpler. The zig-zag at the top is the resistor, and the disconnected looking thing is the switch (open). There is sample code there too.
Note that push buttons typically "bounce" - that is, when you push them, they will go (starting off) on-off-on-off-on-off-on, so if you're counting the number of pushes you will get a result which is way too high. If you delay long enough in between (10ms?) then you won't get these. The code I linked to already has debounce built in.
The other part is the light. This is a little more tricky. The light will probably use too much current for the arduino to supply directly. You will need a transistor and a resistor (again, at least 10 kiloOhm is good).
The transistor should be an NPN transistor, and should look like the top one in http://www.reprise.com/host/circuits/transistor_pinouts.asp. The easiest one is the base - this is the middle one. Connect this via your resistor to another digital pin on your arduino (pin 13 is great for testing this, because it will also light up the led on the Arduino). Next, connect your emitter to ground (GND). Then, IF YOUR POWER SUPPLY IS NO MORE THAN 12 VOLT! you can connect VIN to the + side of the light, and the - side of the light to the collector.
Next, load a sketch - the "blink" sketch is good to test this. Adjust the pin as necessary.
Note that, these switches have a resistor already built in to the light; if you want to do the same with an ordinary led, you will have to add one yourself. Check out http://ledcalc.com/ to tell you which resistor you need.


text:
ADXL345 Arduino UNO Activity Inactivity interrupt
I have DATA_READY, Activity and Inactivity interrupts mapped from INT1 to INT0 on the arduino. DATA_READY works fine, the problem is Activity and Inactivity are always set to 0 in the INT_SOURCE register. I have set up the threshold for activity and inactivity and the time of inactivity. I would like the algorithm to run when DATA_READY and Activity interrupts are 1 and do nothing when Inactivity is 1 (activity is 0). When Activity is 0 the accelerometer should go automatically in sleep mode and wakes up if activity is detected.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <avr/io.h>
#include <avr/power.h>

#define F_CPU 16000000UL

int state=0; //0--active detecting; 1--sleeping
int state_count=0; //sleeping trigger between 2 states
double mag[40];
int i=0;
double acc_rate[39];
int hunt_sub=0;
int exit_marker=-10,trough_marker=-30,peak_marker=-10;
volatile int sensor_update=0, active_mode=0;//active_mode=0, inactive; 1--active;      sensor_update=0, no new data; 1--new data comes
byte buff[1] ;

volatile unsigned long time=0, time0=0,time_dis=0,time_array[40]={0};

//----------------------------------------------------------------------------------------------

//Read ADXL345 registers
void readFrom(int device, byte address, int num, byte buff[]) {
Wire.beginTransmission(device); //start transmission to device
Wire.write(address);        //sends address to read from
Wire.endTransmission(); //end transmission

Wire.beginTransmission(device); //start transmission to device (initiate again)
Wire.requestFrom(device, num);    // request 1 byte from device

int i = 0;
while(Wire.available())    //device may send less than requested (abnormal)
{
buff[i] = Wire.read(); // receive a byte
i++;
}
Wire.endTransmission(); //end transmission
}

//Write to ADXL345 registers
void writeTo(int device, byte address, byte val) {
Wire.beginTransmission(device); //start transmission to device
Wire.write(address);        // send register address
Wire.write(val);        // send value to write
Wire.endTransmission(); //end transmission
}

//----------------------------------------------------------------------------------------------

/////////////////////////////////////////////////////////////////////////////////////////////

//ISR function

void interrupt(void){

readFrom(0x53, 0x30, 1, buff);

if(buff & 0b00010000){
  active_mode=1;//active state
}
if(buff & 0b00001000){
  active_mode=0;//inactivity state
}

if(buff & 0b10000000){
sensor_update=1;//DATA_READY each 10ms
}

}

/* Assign a unique ID to this sensor at the same time */
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

void setup(void)
{
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
Serial.begin(9600);
//Serial.println("Accelerometer Test"); Serial.println("");

pinMode(4, OUTPUT);// buzzer output pin
pinMode(2, INPUT);

/* Initialise the sensor */
if(!accel.begin())
{
/* There was a problem detecting the ADXL345 ... check your connections */
//Serial.println("Ooops, no ADXL345 detected ... Check your wiring!");
while(1);
}

/* Set the range to whatever is appropriate for your project */
accel.setRange(ADXL345_RANGE_8_G);
accel.setDataRate(ADXL345_DATARATE_100_HZ);
// displaySetRange(ADXL345_RANGE_8_G);
// displaySetRange(ADXL345_RANGE_4_G);
// displaySetRange(ADXL345_RANGE_2_G);

/* Display some basic information on this sensor */
//displaySensorDetails();

/* Display additional settings (outside the scope of sensor_t) */
//displayDataRate();
//displayRange();
//Serial.println("");

//Create an interrupt that will trigger when a tap is detected.

writeTo(0x53, 0x2D, 59);//POWER_CTL  auto sleep, link, 1hz rate
writeTo(0x53, 0x2C, 10);//BW_RATE low power mode off rate 100Hz
writeTo(0x53, 0x2E, 0);// disable interrupt

attachInterrupt(0, interrupt, RISING);

writeTo(0x53, 0x2F, 0); //map to to INT1
writeTo(0x53, 0x2E, 152); //enable data_ready, activity, inactivity
writeTo(0x53, 0x25, 18); //THRESH_INACT  ((11/9.8)*1000)/62.5
writeTo(0x53, 0x26, 60); //TIME_INACT    one minute
writeTo(0x53, 0x24, 21); //THRESH_ACT    ((13/9.8)*1000)/62.5
writeTo(0x53, 0x27, 0); //ACT_INACT_CTL   dc coupled, use only magnitude.

}

void loop(void)
{

readFrom(0x53, 0x30, 1, buff);
Serial.print("buff: "); Serial.print(buff); Serial.print("  ");

sensors_event_t event;
do{ //clear DATA_READY
accel.getEvent(&event);
readFrom(0x53, 0x30, 1, buff);
}while(buff & 0b10000000);

if(sensor_update==1 && active_mode==1){
//When sensor_update is set to 1 in the ISR,the algorithm process the data from the accelerometer being updated every 10ms(100Hz)
//rest of algorithm is here
 sensor_update=0;//reset

}

}

Edit:
I have modified the program to check in the loop whether the different flags are set and only the DATA_READY is. Activity and Inactivity are never set.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <avr/io.h>
#include <avr/power.h>

#define F_CPU 16000000UL

int state=0; //0--active detecting; 1--sleeping
int state_count=0; //sleeping trigger between 2 states
double mag[40];
int i=0;
double acc_rate[39];
int hunt_sub=0;
int exit_marker=-10,trough_marker=-30,peak_marker=-10;
volatile int sensor_update=0, active_mode=0;//active_mode=0, inactive; 1--active;     sensor_update=0, no new data; 1--new data comes
byte buff[1] ;

volatile unsigned long time=0, time0=0,time_dis=0,time_array[40]={0};

//----------------------------------------------------------------------------------------------

//Read ADXL345 registers
void readFrom(int device, byte address, int num, byte buff[]) {
Wire.beginTransmission(device); //start transmission to device
Wire.write(address);        //sends address to read from
Wire.endTransmission(); //end transmission

Wire.beginTransmission(device); //start transmission to device (initiate again)
Wire.requestFrom(device, num);    // request 1 byte from device

int i = 0;
while(Wire.available())    //device may send less than requested (abnormal)
{
buff[i] = Wire.read(); // receive a byte
i++;
}
Wire.endTransmission(); //end transmission
}

//Write to ADXL345 registers
void writeTo(int device, byte address, byte val) {
Wire.beginTransmission(device); //start transmission to device
Wire.write(address);        // send register address
Wire.write(val);        // send value to write
Wire.endTransmission(); //end transmission
}

//----------------------------------------------------------------------------------------------

/////////////////////////////////////////////////////////////////////////////////////////////

//ISR function

void interrupt(void){

//
//    if(buff & 0b00010000){
//      active_mode=1;//active state
//    }
//    if(buff & 0b00001000){
//      active_mode=0;//inactivity state
//    }
//
//    if(buff & 0b10000000){
//    sensor_update=1;//DATA_READY each 10ms
//    }

}

/* Assign a unique ID to this sensor at the same time */
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

void setup(void)
{
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
Serial.begin(9600);
//Serial.println("Accelerometer Test"); Serial.println("");

pinMode(4, OUTPUT);// buzzer output pin
pinMode(2, INPUT);

/* Initialise the sensor */
if(!accel.begin())
{
/* There was a problem detecting the ADXL345 ... check your connections */
//Serial.println("Ooops, no ADXL345 detected ... Check your wiring!");
while(1);
}

/* Set the range to whatever is appropriate for your project */
accel.setRange(ADXL345_RANGE_8_G);
accel.setDataRate(ADXL345_DATARATE_100_HZ);

//Create an interrupt that will trigger when a tap is detected.

  writeTo(0x53, 0x2D, 59);//POWER_CTL  auto sleep, link, 1hz rate
  writeTo(0x53, 0x2C, 10);//BW_RATE low power mode off rate 100Hz
  writeTo(0x53, 0x2E, 0);// disable interrupt

  attachInterrupt(0, interrupt, RISING);

  writeTo(0x53, 0x2F, 0); //map to to INT1
  writeTo(0x53, 0x2E, 152); //enable data_ready, activity, inactivity
  // writeTo(0x53, 0x25, 18); //THRESH_INACT  ((11/9.8)*1000)/62.5
  writeTo(0x53, 0x27, 119); //ACT_INACT_CTL   dc coupled, use only magnitude.
  writeTo(0x53, 0x25, 5); //THRESH_INACT  ((3.0625/9.8)*1000)/62.5
  writeTo(0x53, 0x26, 1); //TIME_INACT    one minute
  writeTo(0x53, 0x24, 21); //THRESH_ACT    ((12.8625/9.8)*1000)/62.5

  }

  void loop(void)
  {

  if(digitalRead(2)) {

  readFrom(0x53, 0x30, 1, buff);

  //Serial.print("### ");

  //Serial.println(interruptSource, BIN);

  if(buff[0] & 0b10000000) {

  Serial.println("### DATA_READY");

  }

  if(buff[0] & 0b00001000) {

  Serial.println("### Inacitivity");

  }

  if(buff[0] & 0b00010000) {

  Serial.println("### activity");

  // we don't need to put the device in sleep because we set the AUTO_SLEEP bit to 1 in R_POWER_CTL

  // set the LOW_POWER bit to 1 in R_BW_RATE: with this we get worst measurements but we save power

}

delay(150);

}

sensors_event_t event;
do{ //clear DATA_READY
accel.getEvent(&event);
readFrom(0x53, 0x30, 1, buff);
}while(buff & 0b10000000);

if(sensor_update==1 && active_mode==1){
//When sensor_update is set to 1 in the ISR,the algorithm process the data from the accelerometer being updated every 10ms(100Hz)
//rest of algorithm is here
 sensor_update=0;//reset

}

}

updated code ..

from the datasheet apparently reading the INT_SOURCE registers clears the Activity and Inactivity flags, in that case it would be normal to read o for them. As an alternative, I mapped the activity interrupt from INT2 of ADXL to INT1 of the arduino. active_mode=1 inside the second interrupt function, the first is for data_ready where sensor_update is set to 1. Even with this sensor_update and active_mode always reads 0. Confusing!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
How to choose between Lithium-ion vs NiMH batteries to power Arduino on the go.
For my next project I'd like to use a battery pack to power my Arduino.
I would also like to get a small solar panel and charging module to charge these batteries when possible (during the day).

What is the right type of battery for this kind of application?
What are the differences given this context?
What are the factors I need to consider when choosing a rechargeable battery for this application?

Both viable. LiIon easier to manage well if managed well. Easier to destroy if managed badly. As LiIOn cell has 3V-4.2V range probably need an inverter with 1 cell or buck regulator with 2 which is annoying. Nimh give 1.0 - 1.2 V/cell so eg  6 give 6 - 7.2V for 5V system and 4 give 4 - 4.8V for 3V3 system. NimH are easier overall to build half well and get half good reults. LiIon are very unforgiving of bad treatment past a certain point.

@RussellMcMahon if you could post this as an answer I'd like to mark it as accepted. Thank you for these explanations.

Look at Battery University for many good ideas.
Both NimH and LiIon are viable for your application.
LiIon are easier to manage well if managed well.
ie do it right and they are easy to manage, but cut corners and they are easier to destroy.
NimH can be abused more with a slow degradation in capacity - although complete destruction is possible.
As a LiIOn cell has a ~= 3.0V to 4.2V range you'd probably probably need a step up inverter with 1 cell, or a buck regulator with 2 cells, which is 'annoying'. If you are prepared to use the cell over say a 3.4V to 4.2V range with an LDO regulator for a 3.3V system then you lose a significant amount of available capacity but increase battery cycle life substantially.
Nimh give 1.0 - 1.2 V/cell so eg

6 cells give 6 - 7.2V for a 5V system,
5 cells give say 5.25V - 7V if run down to 1.05V for a 5V system with a suitable LDO regulator, and
4 cells give 4 - 4.8V for a 3V3 system.

NimH are easier overall to build half well and get half good results.
LiIon are slightly harder to get going with in most cases, work very well if treated well, and are VERY unforgiving of bad treatment past a certain point.

In some applications you can forgo any regulator and run the Arduino directly off the battery, if you're willing to accommodate doing so.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Seeeduino Motor Shield Power Supply
I'm looking to drive two DC motors (on a toy RC car) using a Seeeduino and Seeed Motor Shield V2, but can't manage to get the power scheme right. Right now, a 9V battery connected to the shield powers everything (i.e. LEDs are illuminated on the shield and seeeduino), but when I try running the motors everything flickers and the motors don't move (I assume this is because there isn't enough current). I've managed to get them working when plugging a USB and 9V battery (at the same time) into the seeeduino, as well as when plugging a 9V into the seeeduino and another into the shield (at the same time). Both of these configurations leave me feeling uneasy, as I'm not sure how the power sources will interact.
Further, there is a jumper (MB_EN) on the shield which, according to my research, should isolate the shield from the seeeduino when removed. The documentation (http://www.seeedstudio.com/wiki/Motor_Shield_V2.0) alludes to the fact that this jumper doesn't work, however. Indeed, when I try removing it, power is lost altogether.
I've found conflicting answers to this problem, none of which seems definitive. I've also found tutorials where people did exactly the same thing (with a proper arduino, mind you...) by plugging a single 9V battery to the shield. This should be possible.
I've exhausted just about every resource I can think of, and have spent innumerable hours searching up a solution -- nothing yet. Any help would be great.


text:
/dev/cu port resource always busy on OS X 10.10
Is there any reason why is my /dev/cu port always busy? How can I fix that?
It happened on both Uno clone and Spark Core.
The problem is, I'm having issues doing serial communication. Where (as a programmer) I'm seeing something like dropped packets with /dev/tty port. I did a quick test running it on Win 7 (a loaner PC), it works fine...
The code for now is extremely simple. It waits for a command, and write a response.
String str = String(30);

void setup()
{
    Serial.begin(9600);
    str = "";
}

void loop()
{
    if (Serial.available() > 0) {
        char inChar = Serial.read();
        if ((inChar == '\n') || (inChar == '\r') || (inChar == 'z')) {
            str.trim();
            if(str == "READ") {
                String x = String(random(27, 45)) + "," + String(random(45, 300)) + "," + String(random(35, 250));
                Serial.println(x);
            }
            str = "";
        }
        else {
            if (str.length() < 30) {
                str += inChar;
            }
            else {
                str = "";
                str += inChar;
            }
        }
    }
}

I always use the tty one, and not the cu on my mac.

Yeah, me too. But so far, I've only need to upload sketches. Never really thought nor care about tty or cu.

Finally figured it out. I need to call Serial.flush().

Waits for the transmission of outgoing serial data to complete.

Serial.flush() is not my solution. anyone with any new information on this?


text:
How to wait outside the loop without delay()?
Is it possible to delay a task inside a function that is called only once (meaning, it's not inside the loop) without using delay()?
This library I'm using, for reading sensor measurements via serial has a delay() in it. I want to get rid of it, but I don't how to do it, because the library's function is not looped.
I guess the simple solution would be to move the library functions inside the loop, so I can do a simple check with millis() and run the delayed part as soon as 250 ms have passed. I would like to improve this library though and do a simple, single call for sensor data that doesn't not hold up the entire program.
This is the function with the delay:
uint16_t COZIR::Request(char* s)
{
  Command(s);
  // empty buffer
  buffer[0] = '\0';
  // read answer; there may be a 100ms delay!
  // TODO: PROPER TIMEOUT CODE.
  delay(250);
  int idx = 0;
  while(CZR_Serial.available())
  {
    buffer[idx++] = CZR_Serial.read();
  }
  buffer[idx] = '\0';
  uint16_t rv = 0;

  switch(buffer[1])
  {
    case 'T' :
            rv = atoi(&buffer[5]);
            if (buffer[4] == 1) rv += 1000;
            break;
    default :
            rv = atoi(&buffer[2]);
            break;
  }
  return rv;
}

I've had a look at the SoftTimer library, but it requires sketches to be written very differently (without a loop). I'm also not sure if I can even pass arguments to delayed tasks with that library.

The first question is: why do you want to eliminate that delay call? Does it harm your program?

Split the function into a startMeasurement and readMeasurement method. Maybe add a measurementReady method for checking if the measurement is done.

The sensor doesn't return data immediately and I use a pulsating LED to indicate certain levels. The delay disrupts the LED's smooth transitions.

You could split Request() into two separate functions: You call sendRequest(), then go do other stuff, then, some time later, you call getResponse(). If you get RESPONSE_NOT_READY, then you know you have to call it later:
#define REQ_WAIT_DELAY     250  // Wait for 250 ms
#define RESPONSE_NOT_READY ((uint16_t) -1)

uint32_t time_request_sent;

void COZIR::sendRequest(char* s)
{
  Command(s);
  time_request_sent = millis();
}

uint16_t COZIR::getResponse()
{
  if (millis() - time_request_sent < REQ_WAIT_DELAY)
      return RESPONSE_NOT_READY;
  buffer[0] = '\0';  // empty buffer
  int idx = 0;
  // From here, same as original COZIR::Request()
}

This assumes that RESPONSE_NOT_READY (0xffff) is not an otherwise valid response. If all 2^16 values of an uint16_t may be valid, then you need another way for the library to signal that the response is not ready. Also, make sure you never compare timestamps, because of the millis() rollover problem. Taking the difference between two timestamps and comparing this with a specified delay (as in the example above) is rollover-safe.
Update: Here is an example of how this could be used:
COZIR cozir(some_serial_connection);

void loop()
{
    static bool waiting_for_a_cozir_response = false;

    if (time_to_get_another_cozir_reading()) {
        if (waiting_for_a_cozir_response) {
            report_something_is_wrong("This COZIR is too slow!");
        }
        else {
            cozir.sendRequest("Hi Cozir! Pliz send me another reading.");
            waiting_for_a_cozir_response = true;
            /* We won't get the response on this iteration. *
             * We will ask next time.                       */
        }
    }
    else if (waiting_for_a_cozir_response) {
        uint16_t response = cozir.getResponse();
        if (response == RESPONSE_NOT_READY) {
            /* Nothing to do now, really. We will just try again *
             * at the next loop() iteration.                     */
        }
        else {
            waiting_for_a_cozir_response = false;
            do_something_with_the_cozir_response(response);
        }
    }
    do_whatever_else_has_to_be_done_in_the_loop();
}

Thanks, but I'm not sure if I completely understand. In the example getResponse() is not called. I could put a call in the loop, but I'd prefer not to.
I tried the code as proposed and it compiles, but now I don't get sensor measurements returned any longer with czr.Celsius();

Yes, you have have to call getResponse() in the loop, see updated answer. Why do you want to avoid it? Here is the deal: You send a request to the Cozir, but it is slow to respond. You have three choices: 1) you just wait: that's the cozir lib approach 2) yo go do your business, but you remember you have to come later see whether the answer is ready: that's the code I gave you 3) you go do your business, and have something interrupt you and tell you it's time to get the response: that's the SoftTimer approach. Now it's time for you to make a choice: which approach do you prefer?

Thanks so much for the clarification, this was exactly what I was wondering about, as I didn't know the options. I will probably go with your second option with the code you provided. That way I don't have to rewrite the sketch completely. For a next project I will probably use SoftTimer though.

You can look at the BlinkWithoutDelay example sketch (under Digital).  Basically you store the current millis as a variable, then have an if statement to check that it has been more than x milliseconds.

I would still have to put that inside the loop.


text:
Unable to upload sketch after bootloader has been flashed on Arduino Micro
I have created my own custom Arduino Micro, but I am experiencing problems when I attempt to upload an sketch via USB in Arduino IDE.
Here is how I program the Arduino Micro:
avrdude  -c atmelice_isp  -p m32u4 -P usb -u -v -e -U flash:w:Caterina-Micro.hex

And the result:
$ avrdude  -c atmelice_isp  -p m32u4 -P usb -v -e -U flash:w:Caterina-Micro.hex
avrdude: Version 6.1, compiled on Mar 23 2014 at 04:42:55
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/usr/local/Cellar/avrdude/6.1/etc/avrdude.conf"
         User configuration file is "/Users/aUser/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : atmelice_isp
avrdude: usbdev_open(): Found Atmel-ICE CMSIS-DAP, serno: J41800023270
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : JTAG3_ISP
         Description     : Atmel-ICE (ARM/AVR) in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 125.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9587
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: erasing chip
avrdude: reading input file "Caterina-Micro.hex"
avrdude: input file Caterina-Micro.hex auto detected as Intel Hex
avrdude: writing flash (32730 bytes):

Writing | ################################################## | 100% 38.80s

avrdude: 32730 bytes of flash written
avrdude: verifying flash memory against Caterina-Micro.hex:
avrdude: load data flash data from input file Caterina-Micro.hex:
avrdude: input file Caterina-Micro.hex auto detected as Intel Hex
avrdude: input file Caterina-Micro.hex contains 32730 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 133.93s

avrdude: verifying ...
avrdude: 32730 bytes of flash verified

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)

avrdude done.  Thank you.

The error in Arduino IDE when flashing sketch via USB:
Sketch uses 23.994 bytes (83%) of program storage space. Maximum is 28.672 bytes.
Global variables use 1.145 bytes (44%) of dynamic memory, leaving 1.415 bytes for local variables. Maximum is 2.560 bytes.
Forcing reset using 1200bps open/close on port /dev/tty.usbmodem1411
PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.Bluetooth-Modem, /dev/cu.usbmodem1411, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.Bluetooth-Modem, /dev/tty.usbmodem1411, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.Bluetooth-Modem, /dev/cu.usbmodem1411, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.Bluetooth-Modem, /dev/tty.usbmodem1411, } => {}
PORTS {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.Bluetooth-Modem, /dev/cu.usbmodem1411, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.Bluetooth-Modem, /dev/tty.usbmodem1411, } / {/dev/cu.Bluetooth-Incoming-Port, /dev/cu.Bluetooth-Modem, /dev/cu.usbmodem1411, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.Bluetooth-Modem, /dev/tty.usbmodem1411, } => {}
Uploading using selected port: /dev/tty.usbmodem1411
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/tty.usbmodem1411 -b57600 -D -Uflash:w:/var/folders/64/6n0yv9515hz1n6z3bdzcwv6h0000gn/T/build2162381950044145986.tmp/IMUNode.cpp.hex:i

avrdude: Version 6.0.1, compiled on Apr  3 2014 at 22:00:33
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/aUser/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodem1411
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Your problem is that your board doesn't have the bootloader loaded into the chip.
You have success with the ATMEL-ICE ISP because it is an in-system programmer (ISP) and you are downloading the code directly into the chip.
When you use the USB, I see from your output that the programmer is "butterfly" and the description indicates AVR109. These both indicate that the program is trying to be loaded through a bootloader.
A bootloader is a bit of code that resides in the codespace section of flash. It allows you to send the program through the UART. The bootloader then saves it to the codespace section of flash such that both the bootloader and your program co-exist.
To fix this, use the Arduino IDE along with your ATMEL-ICE ISP to load the bootloader into the microcontroller. This can be done by going into Tools and then Burn Bootloader (of course with the correct programmer selected).
This will then allow you to download your code through the Arduino IDE.
PS. You can program your sketch straight to your Arduino using your ATMEL-ICE ISP without downloading the bootloader. Do this by selecting the Upload Using Programmer option in the menus.

This is not correct. I received this same error after using the Arduino IDE to burn the bootloader, which the IDE said it did successfully.

@Cerin there could be many things that it could be such as the wrong bootloader or a problem with the USB circuitry or even your Tx pin has died. https://arduino.stackexchange.com/q/13292/19409

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Metal detector using Arduino
Is anyone out there building serious metal detectors with the Arduino? By "serious" I mean metal detectors with phase sensitivity to discriminate between ferrous and non-ferrous metals, etc.  Seems like the Uno is a good platform for a smart metal detector project.
Update:
Arduino allows me to control phase discrimination which allows ferrous metals to be rejected.
I already know it can be done with an analog phase shift circuit.
Also Arduino can perform target ID function with readout to 16x2 LCD display.

Should be possible with only analog logic. I don't see where you'd need an arduino. Just google some schematics for metal detectors.

A set of posts on Instructables uses an Arduino Nano to generate a Phase Induction pulse, with a capacitor instead of a dump resistor to set up a decaying oscillation, which is then limited with diodes and detected by the analog comparator with interrupts.  The comparator interrupts then count the frequency of the decaying ringing oscillation producing some ferrous/non-ferrous discrimination, and the duration of the ringing, producing some signal strength and size information.

Nano doing Pulse induction with LC-trap oscillation: https://www.instructables.com/id/Arduino-Based-Pulse-Induction-Detector-LC-Trap/
Nano meta detection software with high-frequency ADC sampling: https://www.instructables.com/id/How-to-Program-an-Arduino-Based-Metal-Detector/
Nano doing Pulse Induction, shifting the recovery pulse to match the arduino's analog comparator: https://www.instructables.com/id/Arduino-Based-Pulse-Induction-Detector/

The tricks in the Pulse Induction LC-trap system of using the analog comparator would be applicable to detecting phase shifts and detecting crossings in sync with a timer-based output.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Atmega328 component library for Protel 99 SE
Any one know a component library for Arduino UNO (Atmega328, etc) for Protel 99 SE PCB design software?

Found it here with 94 chips.
The author states, "I have made a little library for Protel 99SE with schematic sybols of AVR chips."
http://www.avrfreaks.net/forum/avr-8bit-microcontrollers-protel-99-library

All arduino design schematics are available from the Arduino website, e.g. for the Uno. However, these are in EAGLE format, I don't know if it's possible to convert.


text:
Arduino Uno - What can I make with just the base board
So I just bought my first Arduino (an Uno r3), and dove right in.
All I have currently is the base board (I didn't want to invest too heavily and then realize arduinos weren't for me), so I made a quick script that translates input letters to morse via the LED on the top.
Now that I'm done with that, I figured I'd come here to ask: do you guys have any random ideas for things I can make with JUST the uno? I understand that I should probably just start buying kits and shields, but I'm just curious as to what I can make with the most minimal of items. I consider it a test :)
Thanks in advance guys!

You can do anything that only involves talking on the serial connection and blinking the LED.

Well,
Your question is very broad. But the Arduino essentially needs controlling gadgteers to make things easy ( and funny ).
However if you know a bit of electronics, then you may be able to use the IN/OUT analog ports and build other interfaces to control, for example the lights of your home, or even better. You can measure and control priate things should be linked. Increasing the power of your home.
If you have interest in cars, then you can perform to connect the on-board computer of your car to the Arduino, like this.
Well, there are numerous ideas, none of these I'm saying is new and there are even libraries ready to be used in these segments mentioned above.
Regards,
Andrew Paes

Thank you for your multiple examples! I realize my question is extremely broad, but I think you did a good job of answering it. I thought about making a lightswitch controller but that would require some other components, correct? Unless I'm mistaken.

At least 1 push button costing you $2,00. Would better Would better buy a LCD Multi Touch display costing around $9,00 giving you the chance to have any buttons as you want.


text:
Arduino PWM output cannot drive MOSFET 0-12V
On an Arduino Uno, the PWM pin 3 is connected to the gate pin of an N-channel MOSFET STP16NF06L. The source pin is connected to ground of a 12 V power supply and drain pin connected to a multimeter. The other end of the multimeter is connected to the positive terminal of the power supply.
Question: When Arduino varies its PWM output from 0 to 255, the multimeter reading goes from 11.50 V to 12.10 V. Why isn't it 0 to 12 V?
When the FET gate is connected to the Arduino pin that outputs either 0 V or 5 V, the multimeter reading is as expected at 0 V and 12 V respectively.

Because there is no current??????? Check this schematic: Add one side 10kOhm resistor to the +5V, attach multimeter to another. And other end of multimeter to GND. BOOM its ~5V. Why? Because no current! Add all variables to Ohms law

Connecting a load helps! Why is it that when using digitalWrite, the multimeter is able to read 0 or 12V, but not when using PWM with analogWrite?

Briefly: Current makes the voltage to drop. You should read some basic info: http://en.wikipedia.org/wiki/Voltage_drop or what ever.

Assuming you have a suitable FET You should have a circuit in line the following.
http://elinux.org/RPi_GPIO_Interface_Circuits#Using_a_FET
You should have some kind of load (a multimeter will have too high an impedance). Use a resistor 4.7k or smaller. You should also have a resistor on the gate

It works! Whats the reason for using a resistor at the gate?

When the FET is saturated (pin 3 is high), I would expect the instantaneous voltage to be the full 12 v. When pin 3 is at 0v, there should be no connection across the FET; I would expect the voltage to fluctuate randomly. you might see the same if you measure voltage with nothing touching the probes, especially if the probes move relative to each other.
I'm fairly new to FETs, so I may be on completely the wrong track.

Also put a LED with a resistor connected trough drain, then you read the voltage across the resistor and also have visual feedback with the LED. Resistor should be with 0V when your pin is LOW. It's easier to work with transistor knowing if there is current or not.


text:
Arduino Grounding Issue
I have a project that turns a LED strip on and off using capacitive touch.  The project uses an Arduino Micro as the brain and a 12v wall wart to power everything.  I have the Arduino ground and negative from the power supply running to a common ground.
Everything works as expected during testing and the Arduino is connected via USB to my computer; however, when I unplug the USB and connect the circuit to the light installation, the lights just flicker on and off.  When I touch my finger to the negative/ground (and presumably provide common ground), everything works as expected.
It seems obvious to me that I have a grounding issue, but really do not know how to proceed. Is there a specific technique for grounding from a wall wart? Do I need to somehow pull the ground/negative down? I feel like there is something obvious that I am missing.
Thank you in advance for any and all help.

Seems like there is a problem in your wall wart, actually some people are having problems using wall wart with arduino. The problem is with the circuit of thre arduino regulator and with sime ripple variances with de wall wart, i sugest you to setup in your project a regulator (7805) and see if the problem is gone. This is by far problem not just with grounding, but with the power suply in general. I was used to make PIC projects and once it was happening exatly the same that happaned to you but the microcontroller started to work when i put my hand or finger close without even touching it :x. Crazy thing. If the power supply isn't well suited, the arduino enter in continous reset looping because of supply noise. So just put an external regulator, an maybe an extra capacitor (generally 10 nF) in arduino micro power supply rais (VCC-GND). Here's my tip. Good look man, tell me if it worked :)

Yes, I agree with this and had exactly the same problem when migrating Arduino projects to PIC! If you're using a strip of Neopixels, there will be a lot of noise generated on the power rails, so use plenty of bypass capacitors and an LDO like @Matheus sugests.

Here's an article describing how you can configure the simple regulator circuit: http://jumptuck.com/2011/11/15/voltage-regulation-friend-7805/


text:
What's the smallest (cheap) USB Host solution for Arduino?
I'm building a project that will connect to users' phones (Android at first, but iPhone too, if there's enough interest) via USB. Of course, this means that I need a USB host in the project. The total size of the device has to be about the size of the phone, so answers that seriously suggest shields aren't going to be helpful - they'd put me over my size budget by at least a factor of 3.
I'd also rather not require an adapter to go from the USB Mini B connector type to the Micro B connector type.
Gravitech has a USB Host board for the Nano 3 that has a USB Type A connector, and the combination of a Nano and Gravitech Host is about the right size (maybe a little thick, once the whole thing is soldered to my own board), but the USB host is $25. I can get the Nano for about $4 each and would like to keep the USB host in the neighborhood of $8 each. Are the solder fumes getting to me, or is there such a specimen out there and I'm just not finding it?

Why not go with bluetooth?

I'm uncertain of what you mean by "USB host". Do you wish to be able to plug the Arduino into the phone's USB port and interact with it via USB or GSm or WiFi or ... ...?

Your requirement would probably be better met by something that isn't an Arduino at all, and has native USB host.

Atmel has AVRs with USB OTG support perhaps one of those would work.

In the non-Arduino realm, I've had success with both STM32F401/411 Nucleos and the Kinetis KL25Z freedom board.  Those are all in the $10-12 range and slightly larger than an Arduino, but I've also made the corresponding chips work on smaller custom boards.  A KL25Z64 is just over $3 in a QFN32 package, though it needs another crystal and requires skill to solder (if space is not an extreme concern, the QFP48 will be easier to work with).

The Arduino Due and Arduino Mega ADK can both serve as a USB Host. You can also use the chip that the Mega uses yourself

No, the Arduino Mega is not a USB host (perhaps you confused the Mega for the ADK?).  You can of course add an embedded USB host chip to a Mega, but it is probably not cost effective to do so compared to devices which have that natively.  The Due, while still overpriced, is comparatively a good deal since it costs less than a board + host shield and is in the class of things which are far more capable as computational platforms (but still twice what you need to spend on hardware to do this).

Thanks for clarifying. I guess I misinterpreted when I read about the Mega.

I think you were probably looking at the Mega ADK - not particularly small or cheap -http://arduino.cc/en/Main/ArduinoBoardMegaADK

Cypress makes very small usb chips capable of host mode. Does this board meet your size requirements? http://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8CKIT-049-41XX/?qs=FSHIiqjonm0YmFbmBQfo1A%3D%3D&kpid=1159933375&gclid=CPjl6KOm4cQCFYGUfgodJh4A_g
You may also consider ditching the arduino and running everything on the cypress

Are you sure that the board you link can do this?  Cypress' own documentation lists the  CY8C4125AXI-483 and  CY8C4245AXI-483 offered on those kits as being without a USB interface while I'm not seeing any indication that the interface IC can function as anything other than a device.  Cheap alternative to an Arduino or USB-serial, yes,.  But apparently not a host solution.


text:
Converting Random Binary Data to PWM Signal
I am using a Arduino Due. I am doing a project on Visible Light Communication. I need to convert a binary data into a PWM Signal. Can anyone suggest me a method of generating that PWM Signal based on the binary data given?
Thank You.

So, if you simplu has to convert the binary data to PWM signal there are few things you need to cover:

If the binary data that you are receiving from the sensor is linear or non linear.
What is the size of binary byte. Ex: int(16 bits),char(8 bits),long (32 bits).
If it is linear, then if the data is multiplied by some number it will output a value betwen 0-255.
If the data is not linear than you just need to create an giant array with the pwm intensite value direct without any particular mathematical function. Ex: array[1024] = {0,1,1,2,3,4,5,5,6,6,10,9,...}; (1024 values because if you are using analog input. Then you can direct output the values from array:
analogWrite(3,array[x]); //x being your data

Here's the linear Example:
   //map(value, fromLow, fromHigh, toLow, toHigh);
    y = map(x, 0, 1023, 0, 255);

Doing this, y will receive a value from 0 to 255. You just need to first do a simple serial program that prints you through arduino serial window the binary data and see if the data increases or decreases conform your light project.

I don't know about your programming levels or if you are using a digital sensor or analog sensor, but if you are using a digital sensor, so you are probaly using SPI communication or i2c. Then you just need to read that binary data and take where the values bits are with bit wize manipulation.
y=(x & (0xfff<<3))>>3;

Tell me more about the source of data, how this data is and how is the behavior of the data so i can help you a lot more. Thanks

Count the amount of time a signal is high over a certain period, and use the ratio of on time to period as the duty cycle for the PWM signal.

Rather than completely build everything from scratch,
perhaps you can use some already tested and debugged Arduino library designed for free-space optical communication, such as

Ken Shirriff. "A Multi-Protocol Infrared Remote Library for the Arduino".
A1RONZO at Sparkfun. "IR Communication tutorial"
Dave. "EEVblog #506 - IR Remote Control Arduino Protocol Tutorial"
"Multitasked IR transmission"
"Arduino universal remote" (has 2-way communication, both send and receive)
"IR Remote Control Theory" (links to many different "standard" infrared protocols)

Practically all of these systems convert expand arbitrary binary data to structured "frames" or "packets" of information including some sort of checksum.
Each packet is repeated several times; hopefully the receiver catches at least one of them.
Each bit of the packet is expanded to either the "pattern representing a 0 bit" (typically turning the LED off for the full bit time) or the "pattern representing a 1 bit" (typically blinking the LED at 38 KHz for the full bit time, typically using a PWM).
To make the hardware and the software simpler and cheaper, most of these systems transmit only a few dozen bits per second.
A few free-space optical communication systems are designed to run much faster, such as RONJA.


text:
Getting "avrdude:stk500_recv(): programmer is not responding" while uploading sketch to Arduino Pro Mini
I recently bought an Arduino Pro Mini(3.3V 328p, 8MHz) along with a CP2102 USB to TTL UART convertor. When I try to upload a sketch to the Pro Mini using it, I get a avrdude:stk500_recv(): programmer is not responding error. My connection was like
Arduino pro mini                CP2102
TXO  ----------------------------> TXD
RXI  ----------------------------> RXD
VCC  ----------------------------> 3V3
GND  ----------------------------> GND
DTR  ----------------------------> DTR

I tried inter-connecting the TXO and RXI pins and had no luck. Also pressing and releasing the reset button on the Pro Mini doesn't seem to work either.  I also tried programming it with my Arduino Uno, by removing the 328 and connecting correspondingly. Still no use.
Does any one have any ideas?

Are you using avrdude at a command line?  If so, what command?  Or are you using arduino ide?  If so, what are the settings under Tools, Board and under Tools, Programmer?  (Please edit the answers to these questions into your question, instead of answering in comments)

@jwpat7 No no using Arduino IDE 1.0.6 for Mac. Actually the error is avrdude:stk500_recv(): programmer is not responding

Which port did you select?  Did you install a CP210x driver on your Mac?

Ok, so you are using the Arduino IDE. What are the settings under Tools, Board and under Tools, Programmer?

@ChrisStratton Yes i did install them

@jwpat7 I choose the correct port and set Board type as Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328.

First of all the Tx and Rx lines should be cross connected (Rx <> Tx). Images of the two boards would help I think, are you sure your CP2102 board has a DTS output and not RST(which can't be used as DTR)?

@alexan_s I tried cross connecting the Rx and Tx. It didn't work out.

Are you sure the board has a bootloader?

Double Check Your Code Errors and hold reset button until start uploading , I got same error at programming Arduino Mini Pro.

rx -> tx
tx -> rx
Please check your connections.

I had the same problem and I used a magnifying glass to check the processor.  I bought my clones off of eBay and they are using the ATMega168 (3.3V, 8 MHZ) processor.  Once I realized my mistake and switched to the correct processor version, the upload was seamless.
I'm using an "FTDI FT232RL USB to TTL Serial Converter Adapter Module 5V and 3.3V For Arduino" for the programming connection, with

DTS-DTS;
Rx-Tx;
Tx-Rx;
VCC-VCC;
GND-GND, and;
GND-CTS.

I didn't even need to use the "reset" workaround of holding down the reset button before pressing the upload button and releasing when the words "Maximum is ..." appear in the output window.

In the Arduino IDE for my Pro Mini I have to select the board:
"Arduino Deumilanove or Diecimila"
I'm not sure why this is or if this could cause any potential damage to your Pro Mini but I do know for sure this is the solution I used to program my pro mini and it works every time.

Change baudrate to
UPLOAD_RATE=57600

in Makefile (or via the GUI). I have seen your error many times and this fixes it, albeit on the 5V/16MHz mini USB variant. If 57600 does not work, try other values. I use this rate on my USB serial - may be different on bare Rx/Tx pins.
You have probably not messed up your bootloader, that is rarer than people think. I think your Arduino has some invalid code running, and it keeps resetting until it finds valid code - when I had that problem, I pressed reset just before punching enter for 'make upload'. Even if it does that, you've got perhaps 0.5s to initiate an upload after reset.
Do correct me if I'm wrong.

As above, it was the upload rate of 57600 that saved the day for me - thanks

Check connections, make sure RX-TX lines are crossing over.
Arduino -> Preferences -> Show verbose output during - check upload will give you better visibility what is happening.
When Arduino says "Uploading..." briefly press reset. The upload should start.

But one thing that helped me was... try different USB-UART adapter. For some reason the one which looked like (and was) cheap knockoff worked like a charm.
As a general advice, when sourcing parts from Chinese manufacturers I learned to be redundant - I usually order a bit more than I need and from mixed sources.

If this is a cheap clone it may be that there is no bootloader installed. You might try using a programmer or an Arduino as ISP to reprogram the device if this is the case. Using ISP programming will avoid any problem with serial connections as it is using SPI wiring instead and the Arduino IDE allows you to load the necessary bootloader using this method to enable programming over serial. You will need either an ISP programmer or another Arduino however.

no no bootloader was installed. In fact the it came with blink sketch preloaded. I tried reinstalling bootloader and had no luck. Any way now seller had agreed to replace the item.

You should try another USB port, install the right drivers for the TTL/uart chip and reboot your PC. That worked for me.

Also, you should consider getting an arduino nano usb, these have an built in ttl/uart converter, ICSP header and can be placed on a breadboard easily.

Well I am using Ubuntu and I can see the UART convertor getting recognized correctly. The nano is too big for my project. I am right now checking up ATTiny 85 from digispark

Can you also see the converter in your Arduino-editor?
and are you sure you have selected the right mcu?

Yeh in fact the transmitter pin on the UART blinks when I begin flashing of programs

Hoe about pressing the reset button just before it uploads, worked for me once

I tried that out. Didn't worked

The problem is crystal clear in the picture

This has absolutely nothing to do with the question asked.  It's not even the same board(!)


text:
Installing Ports for Arduino Nano on Mac OS X Yosemite
Just starting with Arduino and have gotten stuck at the first hurdle: trying to connect an Arduino Nano with my Mac Book Pro which runs 10.10. I can't seem to find the right port as all suggestions have bluetooth in the name and none with USB anything. Also the post list does not change when I plug/unplug the Arduino. Looking at http://arduino.cc/en/guide/macOSX#toc3 it says that I need to install FTDI software to get the USB port to show, however, having done this it still does not work. Any suggestions?
Thanks,
Calum

If this is a genuine nano from arduino.cc then the FTDI driver is what you need; if it is from someone else it could require a different driver or not be functional at all.  If you do apple-about_this_mac-system_report you can see a list of USB devices, if you can find the VID/PID associated with your board and add it to your question or do a web search on it that would help a lot.

Had exactly the same problem. Also using 10.10 and just got an Arduino. What worked for me was using a different cable. The one that came with my Arduino Uno only provided power not data. If you have a printer, it might have the right cable, just test it quickly.
Edit: In addition, whilst trying to find solutions, I also installed 64bit mac FTDIUSBSerialDriver_v2_2_18.dmg. I'm not sure if it made a difference. As after installing it and using the original cable the problem persisted.

Hopefully that was not an official board but a knock-off, if the cable it came with was bad.

Are you using a USB hub? I had problems with my MBP when the Arduino was on a hub. Attached directly to the mac it was fine.


text:
Problem uploading code to Arduino Uno using stino
I am having problems uploading my code to my Arduino Uno. The code that's already up, is running normally. The error code I get is:
ioctl("TIOCMSET"): Connection timed out
avrdude: stk500_recv(): programmer is not responding
ioctl("TIOCMSET"): Connection timed out
[Stino - Error 1]


text:
Arduino Upgrading from 1.0.6 to 1.6, code doesn't work anymore
I'm using Arduino UNO, and today I upgraded my IDE from 1.0.6 to 1.6, just to upgrade, nothing special.
I got my libraries again but I got an error with a code that was working OK.
The error was:
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:223:0,
                 from C:\Program Files (x86)\Arduino\libraries\ModbusMaster-master\ModbusMaster.h:53,
                 from C:\Program Files (x86)\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp:32:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h: In member function 'HardwareSerial& HardwareSerial::operator=(const HardwareSerial&)':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ubrrh', can't use default assignment operator
 class HardwareSerial : public Stream
       ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ubrrl', can't use default assignment operator
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsra', can't use default assignment operator
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsrb', can't use default assignment operator
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsrc', can't use default assignment operator
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_udr', can't use default assignment operator
C:\Program Files (x86)\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp: In member function 'void ModbusMaster::begin(uint16_t)':
C:\Program Files (x86)\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp:139:16: note: synthesized method 'HardwareSerial& HardwareSerial::operator=(const HardwareSerial&)' first required here
       MBSerial = Serial;
                ^

I couldn't find the real error, can someone help me?

Can you share the whole sketch?

Libraries for 1.0 aren't automatically compatible with 1.5 or 1.6. You can just comment out all the assignments like MBSerial = ... and replace all calls to MBSerial.whatever to Serial.whatever in ModbusMaster.cpp.

Thanks Gerben, I tried changing the ModbusMaster.cpp but it still does not work. But the IDE haven't change the things that I was expecting, so the easy way for me is to go back to the 1.0.6 version. But thanks man.

Judging by the error messages you were using a ModbusMaster library from GitHub such as this one and the HardwareSerial library from the Arduino IDE.
I think the key is in the statement:

I got my libraries again

I would suggest that you have downloaded a different library to what you originally used. Even if you did get the same repository, these libraries are also constantly changing and your code sometimes has to evolve with the library.
You have several errors (with the SoftwareSerial library): non-static const member, can't use default assignment operator. Essentially the program is trying to assign a value to a const or perhaps assigning a constant pointer to non-const data. Find more information on the error here and here. All of these errors stem from line 83 of HardwareSerial.h.
The last line(s) give the clue. You are assigning your instance of your Serial object to you MBSerial object.

You should not have added libraries to the Arduino files in the "C:\Program Files (x86)\Arduino" folder in the first place.
That is only for the Arduino program files and standard libraries that are included with the Arduino IDE.
Could you uninstall the Arduino and serial drivers. Remove also the "C:\Program Files (x86)\Arduino" folder, to be sure that absolutely nothing is left behind, because that will interfere with a new version that will be installed. Remove also the hidden "arduino15" folder(s).
Do you know the location of your sketches, it is in the preferences and is often "Documents\Arduino". Go to that folder and go into the "libraries" folder. Remove unused libraries or libraries that have been included in the Arduino files.
Do you have Java installed ? Some Java versions are not compatible with the Java files of the Arduino. If you don't need Java, then uninstall it.
Install the newest Arduino 1.8.3 from Arduino.cc Software.
Use the Library Manager in the Arduino IDE, and search for modbus. Install the "ModbusMaster by Doc Walker" with the Library Manager. The modbus library that will be installed is this one: Github 4-20mA ModbusMaster.
There has been a few changes, for example with PROGMEM. All PROGMEM data must now be 'const'. You might have to make a few adjustments.


text:
What could cause interrupts from MCP23017 suddenly stop working?
I have 4 rotary encoders connected to an MCP23017 which in turn is connected to interrupt port 0 on the arduino (and to I2C of course). Everything works fine: I get interrupts for all 4 rotary encoders, can read the values for them and even store these values in the EEPROM and load them in setup.

Now, I connect a WS2812 LED to the arduino (with a resistor and a capacitator in front of it). I connect the UNO and the led lights up. I attach the serial console (resetting the UNO) and it stops working (LED does not light up). This could just be simple wiring mistake and is not my real problem.
I remove the LED (and the capacitor) from the board and start everything up again. I can see via the serial console that the UNO works, however it does not receive any interrupts anymore. I exchange the MCP23017 thinking I fried it somehow but that doesn't change anything either...
Is there some sort of state the UNO has I could have affected?
Or could I have fried the interrupt "sub-system" on the UNO (again: all the other stuff still works)?
EDIT: The code is here: https://github.com/qollin/Liting/blob/master/src/Liting.cpp

You need to set the CONFIGURATION REGISTER (ADDR 0x05) to control how INTA and INTB react.

I wonder if the LED is a red herring and you just have some iffy code that is being picky about when it works. Could you post your code?

Just added a link to the main file (it uses quite a lot of libraries, though)...

I think I figured out whats wrong: you need to reset the interrupt handling of the MCP in setup() (by reading from both INT pins). Otherwise the MCP may start in a state where it does not generate new interrupts, because it waits for the old ones to be handled...

@qollin please post your solution as an answer so others can find it more easily.

I think I figured out whats wrong: you need to reset the interrupt handling of the MCP in setup() (by reading from both INT pins). Otherwise the MCP may start in a state where it does not generate new interrupts, because it waits for the old ones to be handled...

I'd just tie nRESET of the MCP' to the nRESET of the Arduino, but your call.


text:
Communication between python script and Arduino sketch
I'm trying to transfer data beetween the two scripts. I'm already using the YunMesseger library (https://github.com/plotly/YunMessenger). But it only make the
Arduino -> Python
communication.
I would like to know how to make the reverse way.
I would like to point that I'm search for a solution that doesn't involve the use of the Bridge, because I don't want to have concurrency problems.

What do you mean by concurrency problems? For example, if you use bridge's mailbox, I'm pretty sure that messages from multiple sources just go into a queue on the Linux side, and the 32u4 can check this queue at it's leisure.

One option is to use spacebrew. This is a cloud-based service, however you can run your own server which is based on node.js, so it should work on the Yun.
Your Arduino can then send or receive data using yunSpacebrew, and you can connect it to python using pySpacebrew. This is a pure python library, so it ought to run fine on the Yun.

Thanks for the comment. I'm aware of spacebrew, however I'm trying to build a service similar to theirs but integrated with other solutions I'm developing. That's why I need to know how to make this communication. Looking at their source files I saw that they use Console.read() in the arduino part, but I couldn't find how they do the python part.


text:
How to access 315mhz signals from household devices, with an arduino 315mhz kit?
Background:
I am looking into automation and I have realized that many of the devices I have around my house transmit 315mhz to their specific controllers.  I know this from reading the labels on the back that say 315mhz
Question:
Is there a way I can use a 315mhz receiver with an arduino to view the signals and log the data based on what happens and mimic certain actions with the transmitter?  In other words can I program the reciever to display every bit passed through 315mhz that is in range?
I know the virtual wire library parses the data before I receive it, but I don't know to what extent?  If I just dedicate the arduino to watch that pin and print results will that tell me what is being sent?
Thanks Very Much,
Joel

That depends entirely on what protocol the 315MHz device you want to listen in on uses

I don't know for sure, I know its 315mhz and it has some type of addressing system.  I was planning to do something like a push a button and see what it sends. Because when buying new components the device has to be synced with it.

The Short Answer:
In theory it is possible to do what you are asking.
There are examples of using an Arduino to send and receive messages at 315 MHz. Such as this example.
Although these devices might not even be compatible with the ones you are using. They may be modulating their signal differently or framing their data differently or at different baud rates or encoding bits differently or a number of other fundamental differences that would make them incompatible.
The Long Not Quite An Answer:
There is more to the problem than just being able to get bits at 315 MHz.
For one you would need to know how the bits are encoded. See some of the answers on this post.
Even if it was a simple high low stream of even width bits. You also need to know what baud rate the bits are being transmitted at so you can sync with it. (Consider 4800 vs 9600 baud, slow I know but just an example. You just got a bit stream, was it 1010 at 4800 baud or 11001100 sent at twice the speed of 9600.)
Not to mention that the lowest level of data is probably not just a stream of bits, but is probably framed in some way and grouped into a byte/bytes. Or has a leader to help lock onto the signal.
Even once you are getting reliable data you would need to know the data structure. Is the data arranged in packets? Do they have a packet header? Does the header contain these packet destination address? Where in the header is this data? How is  the data apart from the header structured? What does it mean?.
Knowing the answers to these questions defines, or is defined by, the protocol that is being used by the transmitter (as others are saying in comments.) But these are only a few simple questions that start to define a protocol. Often this information is difficult to come by. Often in the case of proprietary protocols it is very very difficult.


text:
Arduino Due - Multiple Serial Lines
I'm trying to interface with a serial device utilizing Serial1 (pins 18,19) on the Arduino Due. The normal serial port (Serial) is working just fine and is acting as a debug port at the moment - It's also able to communicate with the serial device without a problem when using the normal port.
I noticed that within the libraries for the Arduino hardware, the avr directory contains HardwareSerial files for the Mega's multiple serial lines, but the header file under the sam director does not. Simply a declaration of the HardwareSerial class with no elaboration on Serial1,Serial2 or Serial3 like the Mega's header contains.
Has anyone modified the libraries to set up the Arduino Due's multiple serial lines? Thanks in advance!

I tried Serial2, it definitely works on Due without any modification of any libraries


text:
Is it possible to read VGA with an arduino
In this forum thread on arduino.cc http://forum.arduino.cc/index.php?topic=107375.0 they talk about it not being possible to get 800 x 600 video in color with the arduino.
My case is a bit different:

I don't care about color, it can be black and white / grayscale.
I don't need 800 x 600 just 640 x 480.
I can do with something like 2-5 frames per second.
I don't need it to be processed by the arduino, just transmitted through an ethernet shield.

In other words, it is possible to transmit simple video (just enough to handle eg. bios) remote?

Magic Mouse, did you end up trying this vga->arduino->ethernet thing at all?? Im trying to do exactly that, and would really appreciate to hear from you experience!! thanks -H

Hi, my current solution was to look in to FPGA but i didnt get so far in this project. It is still pending though.

Please note that this question is about capturing VGA video, not about generating a VGA display.  The Arduino is not a good choice for either, but the capture problem at issue here is far worse than the more usual generation one.

Trying to capture analog video such as VGA and transmit it over Ethernet is going to be technically challenging, and of questionable wisdom (at least without compression).  A conventional ATmega-based Arduino is just about the worst contemporary platform you could choose for this job - even aside from the VGA issue, it is a poor choice for Ethernet requiring an expensive add-on.  But just for the sake of "can it be done" ....
If you can threshold your signal to a digital level (assuming a high contrast image) this probably can be done, crudely, but will be quite tricky.  The display is likely to be very blurred horizontally - really, it would only be worth doing for bragging points.
The first thing to realize is that the standard VGA 640x480x60 mode has a pixel clock of 25.175 MHz, and most others will be even faster.
One approach would be to try to write a program which samples a digital pin (directly, no Arduino abstractions) to memory as fast as possible.  This would not capture every pixel, but rather something like every 10th.  You would then have to send these over the network before you fill up your available memory.
The tricky part is that you then have to go back, and scan another frame of video with a slight offset, so that by getting every 10th pixel again, you effectively get the pixel adjacent to the first.   And then you do it again, and again, until you have collectively transmitted the entire screen, which hopefully hasn't changed much as you did it.
It's going to be tricky as you will have to work your delays from the sync signals, and you really want a delay which is a fraction of ATmega's clock - which won't happen without external circuitry (programmable delay buffer, etc)
The whole project would be a lot more feasible on an 80+ MHz ARM Cortex part, as you could then use a counter/timer to generate pixel-or-less-adjustable starting delays relative to the sync pulse.  An FPGA would likely be an even better choice.

Well, it's very possible, but actually you'll stress the arduino. You can use it perfectly but the problem is, it takes a lot of time of Arduino. The reason is actually simple: Horizontal syncronization takes each 32uS of arduino, so the code is interrupted a lot, and if you use other codes the screen may flick. But i have a solution for you. I found software libraries:
http://forum.arduino.cc/index.php?topic=102181.0
or:
http://labdegaragem.com/profiles/blogs/gerando-sinal-vga-colorido-com-arduino-completo
The last link is in portuguese but you can always ask me anything.
OK, what people do is to use for example 2 arduinos to aliviate de stress, you can buy a arduino bare metal chip and put it in a protoboard to reduce costs. Buuut, ther's another very very easy way to work with vga in arduino. Using a isolated hardware:
http://www.hobbytronics.co.uk/serial-vga
You just need to send serial commands to the vga driver and it will do whatever you want. It comes with a library so you can use in arduino. It's perfect, aliviates the arduino, so you can use your ethernet communication and the price is great (for you, here in Brazil the fees kill a lot of children every day :-( ).

From what i read about the Serial VGA is that it displays stuff from arduino to VGA, I want to read from a VGA port.

Been on both pages, and it seems like it is ARDUINO => VGA => MONITOR, i want to do COMPUTER => VGA => ARDUINO => ETHERNET

Hum, i think there isn't yet any library you can find on the net because this is very specific, but if you can send signal, you can receive it. Actually you just need to get any vga software library. put it in an arduino to simulate a vga video running, and in the other end of the vga cable you read it with other arduino. What i'm saying is that you just need to get the same vga library and change it to read instead of writting. It is possible, it will just take time from you, but its not difficult because the already done library cointain time directives.

No.  This is not applicable to the question asked.

Do you want to connect direct to ethernet shield?


text:
What happens if I connect an external power supply, plus to GND and minus to VIN?
So far, I have connected plus to VIN and minus to GND, but I am curious what would happen if I do it the other way around. And I am not going to try in case I break someting.
So, what will happen?

Magic smokes will apear. If you have such a question, then DO NOT TRY THIS! Yes, you will definately burn your device

Well, good I did not try then :)

FYI: If connecting through a power supply plug (eg on the Uno), no problem. http://arduino.stackexchange.com/a/896/3267

So we are talking about specific device?

I am talking generally. But the Uno has a power plug (besides the VIN pin). And as described in the answer I linked to, the power plug has protection against reverse polarity. I thought that was worth mentioning.

So FYI: generally about polarity: https://www.youtube.com/watch?v=D-RZ5RTAdSg and if we are talking about Arduino UNO: yes it has polarity protection diode.

As you say, D1 adds protection for the PWRIN pin but it does not protect from eg reverse polarity on Vin - which was and so far is what the question was specifically about. Whether a shield will see PWRIN I don't know.  If it does then how it deals with reverse polarity may adversely affect the Arduino.

Some systems have protection against people connecting things in reverse.
Some don't.
On unprotected systems you MAY destroy the powered system and/or you MAY destroy the power supply - both these depend on happenstance, system design and luck.
Possibly worse - you may damage the target system in an inobvious way so that it subsequently behaves incorrectly or damages other equipment.
Systems which are designed to be protected may not be protected in all cases. eg if you have a "shield" connected that accesses the Vin pin outside the protection diode the reverse polarity voltage may damage the shield AND current may travel via the shield circuitry back into the Arduino via other connections.

Advice on You tube may just sometimes very very occasionally be wrong. Or more often.
If this "Reference Schematic"  is correct (as you'd hope it was) then Vin is connected to the "inside" of protection diode D1 - so D1 does not protect against reversed polarity. See lines and boxes in red.
Larger version of diagram here
D1 does protect against reversed polarity on "PWRIN".
How PWRIN relates to shield feeding I know not.

And D1 refers to a diode on the diagram? (not to the pin D1)

@MadsSkjern - D1 - yes, diode D1 as per text. In RED box at upper right here. I looked at a UNO. The power supply jack circuitry is used only by that board and not by attached shields so diode-D1 does protect them against reversed power supply. BUT reverse voltage on VIN line is NOT protected against. .


text:
Serial, Numbers sent as Floating Point and Characters are different at 1e-8 level
I have some code that generates random numbers on the Arduino, it then sends these random numbers firstly, using Serial.print(float data,int lenght) and as a floating point number using the following function
void send_float (float arg)
{
  // get access to the float as a byte-array:
  byte * data = (byte *) &arg;

  // write the data to the serial
  Serial.write (data, sizeof (arg));
  Serial.println();
}

I then receive this data using python, take the absolute difference of the two values, discard any differences less than the length with which I send the string and output the rest to the screen.
I observe two things, a) Fluctuations of the order with which I send the data (ie. if I send to 6 decimal places then I see fluctuations of ~1e-6), this is reasonable and b) I see fluctuations of absolute value 1e-8 or lower independent of what accuracy I send the string.
Even if I send the string to 11 decimal places, when I compare against the float I see fluctuations up to but not above 1e-8.
Why? This doesn't make any sense. My full code is actually the answer to an old unanswered stack exchange question

The precision of a float is around 7.2 decimal digits. https://en.wikipedia.org/wiki/Single-precision_floating-point_format

This is a somewhat dumb question but, in case anyone else searches it as pointed out:

The precision of a float is around 7.2 decimal digits. en.wikipedia.org/wiki/Single-precision_floating-point_format –  BrettAM

So in python the number goes float -> double -> decmial, whereas on the arduino the number goes float -> decimal. The additional step of the double in the case of python causes the discrepancies. But anything after the 7th decimal place is nonesense anyway.


text:
How to send SMS from an Ethernet shield via SMS Gateway?
How do I send SMS from an Ethernet shield via SMS Gateway?
The site Clickatell provides free SMS.
Does anyone know how to do this or is there some other way to do it?

you might want to be more specific that this. How far are you? What have you tried? Do you have an ethernet shield ? Do you have an arduino ?'

please say what you want to do. Then i can say how to do it.

First contact Clickatel's support and ask them how to use their API, make yourself familiar with it.
Then when you know that you connect your Arduino to your ethernet shield, I'm just gonna assume you got Arduino's original shield, because you want to support the arduino foundation.
http://arduino.cc/en/Main/ArduinoBoardEthernet if you have the standalone board.
http://arduino.cc/en/Main/ArduinoBoardEthernet if you have the shield board.

yes i have original ardunio and Ethernet shield

Open an account and try to implement their API using something like Chrome REST client. Then do the same through the ESP8266. I would personally relay it through my own web service/ url. You could also take a look at: http://www.instructables.com/id/Send-SMS-from-Arduino-over-the-Internet-using-ENC2/

Thanks to the moderator for telling me to give an improved answer, Here it goes->
From your question I infer that you want to send a SMS from your Arduino with an Ethernet Shield.
My suggestion to you is to use a service "CAYENNE".
It's a cross platform service for IOT.
You can create a FREE account on it by visiting their website :here
You will be provided with a KEY to use with your devices
Then all you have to do is connect your Ethernet Shield and upload Cayenne's BASIC code to your Arduino so that it would link the key assigned to you to the account.
You can now Control your Arduino from any APP or directly through their website as provided above.
As far as SMS is concerned all you'll have to do is to add a trigger (GO TO OPTIONS -> TRIGGERING AND ALERTS  ) and select the notify option(Add SMS here)
Then you just have to enter the country code along with the phone number and when a particular event of your choice occurs you will be notified via SMS.
Hope this helps :)
Feel free if you have any further doubts.

authors: امجد حميد حمزاوي


text:
RF network using Arduino
I am working on home automation project. A network consists of one master device and many (maybe 10-20) slave devices, all communicating via these RF modules. I am using arduino in slave devices. Master will be based on raspberry Pi (most probably). Slave nodes can be sensors or switches(to control household electronics). To and fro communication will include data such as : a) Turn off bulb 1, b) Turn on TV, c) Set the bulb brightness to 34%, d) Temperature reading is 23 degree Celsius etc.
From security point of view, imagine there are similar other networks in the range and one network must not interfere with another. As such, I need to implement some sort of authentication whenever each data transfer takes place between master <---> slave. What logic do you suggest for this process?
There can be cases when data has not been received successfully by the receiving end. In such cases, I am planning to use some sort of checksum and acknowledgement system. If acknowledgement is not received, data will be resend in time intervals of 1s, 5s, 10s, 30s, 30s. If these 5 resends fail, the slave/master will be considered as unavailable/powered down. Your opinions/suggestions on this?
Slave arduino will be busy controlling appliances/sensors connected to it (real busy when controlling appliances). As such, it won't have much time for communication. Less time required for communication == Awesome. How much time do you think the arduino will take to complete one such data transfer?
Another solution I could think of was using two arduinos connected via i2c in each slave module. One arduino will be busy controlling the lights/sensors. Other one will take care of RF communication. If it receives some valuable info which was meant for this particular module, it will transfer the same to the other one using i2c bus. Is this a feasible backup plan?
Am I doing wrong by selecting RF modules for this purpose? Should I switch to Zigbees?
Thanks guys for reading. Any constructive suggestions from your side will be very helpful.

Got any example code ? Then i can throw it on my arduinos and try it out.

There is existing mesh network software for Arduinos. What you are tryingto do is doable but tends to be reinventing te wheel - which has its place :-).

Those are pretty "dump" rf-devices. You'd have to do the entire protocol, and error correction yourself. I'd suggest going with NRF24L01. I've no experience with zigbee (too expensive in my oppinion)

@Magic-Mouse - Sorry, no code yet. I am still to decide what to use. I did some research and I think I should use NRF24L01 as suggested by Gerben

@Gerben - Thanks a lot dude! I did some research and I feel that NRF24L01 is way better than what I was planning to use.

@RussellMcMahon - I agree with you totally. :) That's why I planned to ask before doing so. Since there are easier ways as pointed by others, I am not going to reinvent the wheel now. Anyways thanks for reminding.

NRF24L01 are nice BUT have limited data capacity per "packet" (32 Bytes AFAIR). That is by no means fatal but may be 'annoying'. The ESP8266 modules for about $5 or less give you a full TCPIP/WiFi/Internet access OR can be run as UART bridges (And have their own processor if keen enough an you want to use them as the whole system)

The one thing I don't like about these simple RF modules is that they have absolutely no security. This may be a problem for home automation applications. If you are willing to use wires, then RS485 could be a good option instead, see http://www.gammon.com.au/forum/?id=11428. The chips are quite cheap, you can have multiple devices on the one bus, and the protocol is designed to be robust to noise.

@RussellMcMahon - I did some research and I feel that NRF24L01 might be enough for my job. Basically, I'd be sending simple data such as turn this thing On/Off. Set dimmer level to 23% etc. I guess 32 bytes are more than enough. However, I am planning to explore esp8266 modules because it's capabilities are great. Might use it where I need large data thoroughput. Thanks for the suggestion. :)

@DaveP - I agree with you. I have decided to use NRF24L01 for my project. However I am yet to decide some sort of encryption protocol. Rolling code comes to my mind. Any suggestions?

@user3455594 - I haven't tried any of them, but https://github.com/DavyLandman/AESLib, https://www.das-labor.org/wiki/AVR-Crypto-Lib/en and https://code.google.com/p/avr-hardware-random-number-generation/ have libraries for encryption on AVR/Arduino, and secure random number generation.

The NRF24s are great, but limited to communication only.
Digi's XBee 2mW module has got great indoor range, but more to the point it's got 8 I/O lines and 6 10-bit ADCs on board. It's also built for mesh networks (or you can get star-network equivalents) and has security encryption to boot. This means that, for some of your nodes, you don't need any other hardware to have a fully functioning control point (not including relays and sensors of course), so you can ditch having arduinos at every node.
They're so easy to use, very low power, and have plenty of support and documentation available online.
Do it!


text:
Which components to built remapping keyboard via USB in + out (remapped)
I know that it's fairly easy to change the emulate keyboard and mouse by Arduino. But I'm quite specific about the goal I would like to achieve hence I would appreciate if you could advise me which components (Arduino compatible) I am going to need to have such a built:
Physical usb keyboard --> Arduino via usb IN --> keys remapping (for example pressing q will return ctrl+3 or more advanced action) --> Arduino USB OUT (which I can directly plug in to my computer and receive modified keyboard commands).
To sum up I  just want Arduino to work as intermediary.
Will simple Arduino Uno + USB shield do the work?
Thank you a lot for your support!

The Due might be cheaper than a leonardo+usbHost shield, but I guess you would need a female usb to male micro-usb adapter. In any case, can't this be done on the target computer a lot cheaper and easier?

The thing is I wanted it to be stand-alone and easily transferable across different devices (on which one unfortunately cannot install any developer tools)

you should look into the maximum bandwidth a keyboard needs and then do some tests to see how much latency the arduino adds processing that much data. If its acceptable, you should be good to go (I imagine this will be the case). Oh and make sure whatever you buy has at least 1 usb host port, emphasis on host.

Thank you BrettAM. Yes, as you have guessed latency is not going to be an issue as even up to 500ms is totally ok as device is not going to be a prank or hidden hack, just to make my life easier with plenty of repeatable shortcut sequences. I'm aware of USB host requirement. After some research I learned that this will be much easier with arduino brother - Teensy. Plenty of interesting and easy to do projects on their website here --> http://www.pjrc.com/teensy/projects.html


text:
ws2812b NeoPixel - how to address it? How Arduino knows the correct order of LEDS on the stripe?
How to get a One-Wire address of a given WS2812B pixel? I bought several of these, and I cannot make them light. On the other hand, when I connect the addressable LED strip made of these diodes, I have no problem controlling it.
Here is my set-up:

I tried many programs, e.g. AdaFruit_NeoPixel -> simple, setting number of LEDS to 1, but no effect. No blinks, nothing - as if the diodes were dead.
If every One-Wire device is identifiable by 64 bit ID, how does the Arduino know the correct "order" of the LEDS on the ribbon? How to tell the Arduino the new sequence of the LEDS on the strip that would result if I replace one (broken) LED with another?

WS2812B is not a 1wire device.

@IgnacioVazquez-Abrams Thank you! I was so sure it was 1-wire, I skipped that part when I read the data sheet. So, I understand, that each WS2812B is identified by its position within the chain relative to the Arduino? So there should be no problem with replacing the LED, providing that I don't mistake connectors.

The WS2811/2812/2812B is not a 1-Wire device but is in fact a timing-based shift register with 3 LEDs (external in the case of the WS2811) connected to it.
As long as valid bit pulses are sent to the input of one of these devices it will shift the data through it and subsequently out of its data output. Connecting this output to the input of another device will shift data into that device as well, with the latest data sent being transmitted towards the furthest device in the chain.
Provided 24 bits per device are sent before the latch signal, The first 24 bits will be shifted into the first device, the second 24 bits into the second device, and so on until the last 24 bits into the last device in the chain. Once the latch signal is received, the devices will switch to the color indicated by the 24 bits currently shifted into them.
Since all of the devices use the same signaling (the only differences being supply level and the presence of a built-in RGB LED), they can be replaced freely with devices of the same or different make between the three.

Just one correction. The the first 24 bits of the data are shifted into the first WS2812. That device loads those 24 bits into its PWM registers. If more data is transmitted, the first WS2812 shifts that out to the following WS2812. So the first data sent stays in the first WS2812, the 2nd data stays in the 2nd WS2812, and so on. This is explained in the data sheet.
Data-wise, it's a one-wire device. Power connections don't count.

I would be a little more clear abou the difference between a One-Wire (aka 1-Wire) device and a one wire device (a device that only has one data pin). The WS2812s only have one data in pin, but calling it a "one-wire" device is confusing because that is the name of an actual protocol, a protocol that is not implemented in the WS2812s. Everything in your answer is technically correct, I would just re-phrase the last part to be less confusing.


text:
Arduino WiFIWebSever - why client.println()?
I need to modify the WiFiWebServer example on the Arduino website but I am having some trouble understanding the code. I am hoping to get some advice from the community on the client-server relationship in this example so I can better modify it to suit my needs.
The problem I am having is the jump between server commands and client commands. Initially I see server commands; server.begin() in setup and server.available() in the loop. The commands quickly shift, however, as nearly all the other commands in the loop become client.println()'s.
I understand the initial client commands that deal with whether the client is available and whether it is still connected. The part I don't understand, however, are the client.read and client.println commands. Even client.read makes some sense to me since I want some communication from the client side but why does the example use client.print? The Arduino webpage defines the WiFiClientPrintln as data you write from the client to the server that it is connected to. Wouldn't I want to use server.print since the Arduino in this example is the server and the client is the computer I use to view the webpage that I built on the server?
I am using the WiFIWebServer example as a template for my project. The goal is to have the Arduino take sensor readings and post them on a webpage it hosts by acting on the server. This is quite similar to the example but I notice that I have slow update/transmission speeds and errors when a different client connects to the server. For example, if I view the website on my computer, I get the data fairly consistently If somewhat slow. If I try to view the same website off my mobile device, however, I have problems connecting, may need to refresh several times and the webpage crashes on the computer.
I am trying to troubleshoot the issue but going through the code I can't figure out the reason for the client.println()'s instead of server.println(). Even if that isn't the cause of my multi-client issue, I would like a better understanding of the code before going forward so would appreciate any guidance you can provide.

The confusion you have arises from the context of the command.
The server.* commands manipulate the server instance - that is, the actively listening socket that is waiting for connections.
The client.* commands change their meaning depending on if you are a server waiting for connections or a client that is making a connection.
In the latter case client.print() sends data to the server.
In the former case, on a server, the client.* commands refer to a specific client that has made a connection to the server.  Using client.print() in this instance sends data to the currently connected client.
So "client" can be thought of as "the connection between me and the remote end" however that connection was created - either by "me" specifically connecting to the remote end, or the remote end connecting to my "server" instance and a new "client" being spawned from it for this one connection.
Remember - a client can only connect to one server, but a server can have many connections from many different clients, and it is those client connections that you talk to.

client.println() is sending data to a specific client.
server.println() is sending data to every client that is connected to the server.
Also, i believe that the arduino keeps sending data to the client instead of stopping the request. You should have some javascript that updates the value say... every 5 seconds or so... Or you could have a
<meta http-equiv="refresh" content="5">

inside the  part which would tell the browser to refresh the page every 5 seconds instead of using the header
See http://tentencraft.net/demo1.php vs http://tentencraft.net/demo2.php

Thank you for the response and the suggestions.
I initially assumed the same about sending data to every client and refreshing but it does not produce the desired effect. I set updates to every second but it feels like it takes something like 30s updating on the computer and even worse on a mobile device. I have to force the mobile device's reload more often than not.
To circle back to the server.println(), if that is the command that sends data to every client on the server, wouldn't that make it the one to use for multi-client setups. Would client.read/available be affected?
Thanks again

@DaveP, forgive me for not following the proper forum etiquette but I am not able to upvote until I have 15 rep. While the reply was useful, my question has not yet been answered since I still don't understand why a WiFiWebServer example would use a client.print versus a server.print.

You would want to refresh it instead of sending more data unless you want it to keep logging the temperature to the client. If you add refresh code to the top then close the connection it will update the web page every x seconds.

@user3303997 my code, which follows the Arduino WebServer example, includes two lines "Connection: close" and "Refresh : 1". Based on the example notes, this means that it closes the connection after the completion of the response and refreshes every second. Despite the setting, the refresh rate is nowhere near 1 second - do I need to close the connection in Arduino code? I thought the http code was sufficient.

I suggest using the meta refresh i posted above and close the connection in arduino.


text:
Decide on baud rate for a project using Arduino Uno R3
I am using an Arduino Uno R3 with the MPU 6050 to get motion data. Different example codes use different baud rates, without any proper explanation as to why.
So how do I know which baud rate is perfect for my project?

I most cases it doesn't matter!
In some cases the highest possible is preferred, as it prevents delays. That is when the buffer is full (when sending large amounts of data through the serial connection). As Serial.write will block until there is room in the buffer. In most cases this won't be an issue.
When running your arduino at slower speeds, you have to select a lower baudrate, or the micro-controller can't keep up.
When connection to other devices (e.g. GSM shield) using serial, that device may require a specific baudrate.


text:
GPRS and Weather Shields
I have GPRS(GPRS_Shield_V1.0), weather shield and arduino uno R3. When I use Arduino and GPRS it works perfectly and when I used Weather Shield it also worked perfectly. But weather shield needs wire library, to use sensors. And when I use GPRS library with wire library, my program prints the same string many times. How I can use these two shields together?
These are some pics of my connected shields:
http://puu.sh/gcvk3/85595c38c7.jpg
http://puu.sh/gcvpc/22185212d3.jpg
As you can see, I'm not using A0,A1,A2,A3,A4,A5 pins for GPRS Shield. Thank you!

Have you checked whether you are running out of memory?

Yes. My arduino are running out of memory. Thank you!