Category Archives: Arduino

“error: cannot access /dev/ttyUSB0” Arduino (NodeMCU) esp8266

Question: Getting permission “error: cannot access /dev/ttyUSB0”
Answer: Just open terminal (Ctrl+Alt+T) and type this command and enter root password
$ sudo usermod -a -G dialout ${USER}

On Linux (Ubuntu), Arduino IDE will not be able to upload sketches (or communicate with the board at all) if you don’t change permissions on /dev/ttyUSB0 appropriately. Same as with the NodeMCU ESPlorer IDE, etc. Actually, this very problem comes up whenever you want to access a (virtual) Serial COM port on Linux.

It might happen that when you upload a sketch – after you have selected your board and serial port -, you get an error Error opening serial port … If you get this error, you need to set serial port permission.

Open Terminal and type:

$ ls -l /dev/ttyUSB*

you will get something like:

crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyUSB0

The “0” at the end of USB might be a different number, or multiple entries might be returned. The data we need is “dialout” (is the group owner of the file).

Now we just need to add our user to the group:

$ sudo usermod -a -G dialout ${USER}

NOTE: where USER is NOT  your linux user name keep as it is.

In some cases, You will need to log out and log in again for this change to take effect.

How to convert integer to string and string to int on Arduino ?

New version of arduino supports String data type . In this tutorial we will see both integer to string and string to integer conversion. Conversion of integer to string can be done using single line statement.

Example:
int a = 1234;
String myStr;
myStr = String(a);  //Converts integer to string

Continue reading How to convert integer to string and string to int on Arduino ?

Tutorial On Arduino Watchdog Timer Setup

Today in this tutorial we will learn importance of watchdog timer and configuring watchdog timer in Arduino.

What is Watchdog Timer ?

A watchdog timer (WDT) is a hardware timer that automatically generates a system reset if the main program neglects to periodically service(reset) it. The Watchdog Timer is clocked from a separate On-chip Oscillator which runs at 1 MHz. This is the typical value at V CC = 5V. It is often used to automatically reset an Arduino that hangs because of a software or hardware fault. Some systems may also refer to it as a computer operating properly (COP) timer. All Arduino boards have watchdog timer hardware. Continue reading Tutorial On Arduino Watchdog Timer Setup

Arduino vs Raspberry Pi

Most beginner have questions on which one is for me? Arduino or Raspberry Pi to know which is for you ? We must know what is arduino and Raspberry pi.

What is the difference between the Arduino and Raspberry Pi?

In short Arduino is microcontroller board based on ATmega328p microcontroller without OS running at 16MHz clock having memory in kilo bytes and Raspberry Pi is like single board computer running at 1.2 Ghz speed with Linux operating system with memory in Giga bytes. Continue reading Arduino vs Raspberry Pi