Category Archives: Arduino

RCWL-0516 Doppler Radar Sensor Interface with Arduino

In this tutorial we interface RCWL-0516 Human body induction switch module Intelligent sensor (Radar Motion sensor) with Arduino.

This mini doppler radar motion sensor module is equipped with supporting DC 4-28V wide voltage. It will automatically continuously output the high level TTL signal when there is motion. 360 degree no blind angle detection and maximum 7m sensing distance. It is perfect for DIY microwave motion sensor light switch, human sensor toys, smart security devices, etc.Microwave Motion Sensor

Continue reading RCWL-0516 Doppler Radar Sensor Interface with Arduino

Arduino reading and writing string to EEPROM

The arduino EEPROM library only provides functions to read and write one byte at a time from the internal EEPROM. Note that EEPROM has limited number of writes.

In this tutorial I will provide some functions to store string to EEPROM and Read back to String variable. String is basically character array terminated with null (0x00).

Continue reading Arduino reading and writing string to EEPROM

Interfacing of RFID RC522 with Arduino UNO

In this tutorial we will learn How to interface Arduino UNO with RC522 RF ID Reader using Arduino library for MFRC522 and other RFID RC522 based modules.

This library read and write different types of Radio-Frequency IDentification (RFID) cards on your Arduino or NodeMCU using a RC522 based reader connected via the Serial Peripheral Interface (SPI) interface. Before we move to actual code lets know more about RF ID.

RF ID Reader MFRC-522
RF ID Reader

Continue reading Interfacing of RFID RC522 with Arduino UNO

“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 ?