Posts | Comments

Planet Arduino

Archive for the ‘tutorials’ Category

mauwb dw3000 st tag test

Hello, the device I am going to review is the MaUWB_DW3000 with STM32 AT Command. This is an Ultra-wideband (UWB) module from MakerFabs. The core UWB module on this board is the DW3000 UWB transceiver, and it is also equipped with an ESP32 microcontroller programmable with the Arduino IDE, as well as OLED display. The manufacturer claims that this UWB board resolves multiple anchors and tags mutual conflicts and supports up to 8 anchors and 64 tags. Additionally, the manufacturer has added an STM32 microcontroller to handle UWB multiplexing, allowing users to control the core UWB module by simply sending AT commands from an ESP32 microcontroller to the STM32 microcontroller. More information about this UWB board can be found on the manufacturer’s website. “MaUWB_DW3000 with STM32 AT Command” unboxing MakerFabs sent the package to me from China. Inside the package, there were 4 sets of the MaUWB_DW3000 with STM32 AT [...]

The post “MaUWB_DW3000 with STM32 AT Command” Review – Using Arduino to test UWB range, precision, indoor positioning appeared first on CNX Software - Embedded Systems News.

Programming the ATtiny85 with Arduino may seem daunting at first, but with the right guidance and tools, it can be a fun and rewarding experience. This microcontroller is small, affordable, and versatile, making it a popular choice for DIY projects and prototypes. In this article, we will go over the steps to program the ATtiny85 using the Arduino IDE, so you can start creating your own custom circuits and devices. Whether you’re a beginner or an experienced maker, you’ll find this guide helpful in unlocking the full potential of the ATtiny85. So let’s get started!

What is ATtiny85?

The ATtiny85 is a convenient and relatively powerful alternative to the AVR family. It is especially suitable when you want to minimize the size of your device.

The ATtiny85 chip has 8 pins – 6 I/O pins (including Reset) and 2 power pins. But how can it be programmed without a USB interface like most modern microcontroller boards? In this case, it can be programmed with an Arduino board.

The Necessary Components

  • Arduino Uno board
  • ATtiny85 microcontroller
  • LED
  • 220 Ohm resistor
  • Breadboard
  • Connecting wires

ATtiny85 Specifications

The ATtiny85 is a high-performance, low-power 8-bit microcontroller based on the Advanced RISC architecture. It has 8 Kbytes of reprogrammable flash memory (program memory), 512 Bytes of EEPROM (nonvolatile memory), 512 Bytes of RAM (SRAM), 6 general purpose I/O pins 32 general purpose registers, one 8-bit timer/counter with compare mode, One 8-bit high-speed timer/counter, USI (Universal Serial Interface), internal and external interrupts, 4-channel 10-bit ADC (analog-to-digital converter), programmable watchdog timer with internal generator, 3 programmable power modes.

The pinout of the ATtiny85 microcontroller is shown in the following figure.

ATtiny85 Pinout

Most ATtiny85 pins can perform several functions.

A Step-By-Step Guide to Programming the ATtiny85 With an Arduino Uno Board

Step 1: Configuring the Arduino Uno Board as an ISP

Because the ATtiny85 is just a microcontroller, you need to use ISP (In-System Programming) to program it. So we need to configure Arduino Uno as ISP to be able to use it as a programmer for the ATtiny85. To do this, connect Arduino Uno to the computer and start Arduino IDE. After that, open the menu File > Example > ArduinoISP and load the ArduinoISP code into the Arduino Uno board.

Step 2: Scheme for Programming the ATtiny85

A schematic for programming the ATtiny85 with an Arduino Uno board is shown in the following figure.

Scheme for Programming the ATtiny85

In the schematic, the positive pin of the LED is connected to pin 0 of the ATtiny85 microcontroller through a 220 Ohm resistor. The complete connection diagram is shown in the following table.

ATtiny85 Arduino Uno Board
Vcc 5V
GND GND
Pin 2 13
Pin 1 12
Pin 0 11
Reset 10

Step 3: Programming the ATtiny85 with the Arduino IDE

To program the ATtiny85 with the Arduino IDE, we first need to add ATtiny85 support to the Arduino IDE. To do this, open the File > Preferences menu, add the link below to the Additional Boards Manager URLs field, and click ‘OK.

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Then go to Tools > Board > Board Manager, search for ‘attiny’, and install the latest version.

After that, you will see a new item in the Arduino IDE menu – in the Board item, a sub-item with the name ‘Attiny25/45/85’ will appear.

Now open File > Examples > Basics and open the Blink example.

Change the contact number from LED_BUILTIN to 0 in this example.

Now open Tools -> Board again, select “Attiny25/45/85”, then choose ATtiny85 under Tools > Processor.

You can now load the program code into the microcontroller. If, after loading the program, the LED connected to pin 0 of the Attiny85 microcontroller starts blinking, it means that the program is loaded successfully.

FAQ

Can you program ATtiny85 with Arduino IDE?

Yes, you can program ATtiny85 with Arduino IDE. It is possible to use the Arduino IDE to program ATtiny85 by following a few simple steps. First, you need to install the ATtiny board support in the Arduino IDE. Once you have installed the board, you can select it from the Tools menu. You will then need to install the necessary drivers and libraries for the ATtiny85. With these in place, you can begin programming the ATtiny85 using the Arduino IDE, just like any other Arduino board.

What programming language is ATtiny85?

ATtiny85 is programmed using the Arduino programming language, which is a simplified version of C++. It is a popular choice for small microcontroller projects due to its low power consumption and small footprint. In addition, with its 8-bit architecture, ATtiny85 can handle simple tasks and provide basic functionality for your projects.

Does ATtiny85 have I2C?

Yes, the ATtiny85 microcontroller does support I2C communication. It features two wires, SDA (data) and SCL (clock), which are used for communicating with other devices in the I2C network. This makes it an excellent choice for projects that require communication with sensors or other peripheral devices.

Related Video: Program the ATtiny85 with Arduino 1.8.18

Final Thoughts

Programming ATtiny85 with Arduino can be a bit challenging for beginners, but it’s definitely worth the effort. With the right tools and resources, you can unlock the full potential of this tiny microcontroller and create all sorts of amazing projects. Whether you want to build a wearable device, a smart home gadget, or a robot, ATtiny85 has got you covered. So, don’t be afraid to dive in and start experimenting with this powerful and versatile platform. Who knows, you might just discover your next big idea!

The post How to Program ATtiny85 With Arduino: Quick Tutorial appeared first on NerdyTechy.

Arduino is an open-source platform for physical computing projects. Using Arduino, it is possible to create devices that interact with the real world. One way to do this is by using a Monster Moto Shield with an Arduino. The Monster Moto Shield can be used to control two motors simultaneously, allowing for precise and powerful motor control. In this article, we will discuss how to use a Monster Moto Shield with an Arduino in order to build exciting and innovative projects.

Monster Moto Shield Specifications

  • Supply voltage at the motor supply input Vin: 5.5 … 16 V;
  • Logic voltage: 5 V;
  • Based on VNH3ASP30 chip;
  • Number of channels: 2;
  • Type: H-bridge;
  • Load current: Up to 6 A without cooling, up to 14 A with cooling;
  • Maximum pulse current up to 30 A;
  • Idle current: up to 100 mA;
  • Protection against reverse current;
  • Capable of reading load current;
  • Operating temperature -40° to 302°F (-40° to 150°C);
  • Overheat protection;
  • PWM up to 20 kHz.

Arduino Connection

Arduino Outputs Monster Moto Shield Outputs
A0 A1 B1 key status
A1 A2 B2 key status
A2 analog output of the current value of the first driver
A3 analog output of the current value of the second driver
4 A2 key control
5 PWM control of the first driver
6 PWM control of the second driver
7 A1 key control
8 B1 key control
9 B2 key control

Power

The outputs of the Monster Moto Shield only work from an external 5.5 to 16V power supply, which must be connected to the Vin power inputs.

More About Monster Motor Shield

Monster Moto Shield is based on the VNH2SP30 chip, which allows you to control both speed and direction of the connected motors, as well as to block motors and read current consumption, using the analog pins of the Arduino.

More About Monster Motor Shield

Control of DC motors: The functions: motorGo (motor number, direction, PWM) and motorOff (motor number).

  • The first DC motor is controlled via outputs 7 (key A1), 8 (key B1) and 5 (PWM). Depending on the state of the keys the motor will rotate in one or the other direction. The PWM controls the speed of the motor.
  • The second DC motor is controlled by outputs 4 (key A2), 9 (key B2) and 6 (PWM). Depending on the state of the keys the motor will rotate in one or the other direction. The PWM controls the speed of the motor.
  • The direction in the motorGo() function is set by feeding the logic levels to A and B: A=LOW, B=HIGH – motor rotates one way; A=HIGH, B=LOW – motor rotates the other way.
  • The speed is set by feeding the PWM signal, the fill factor of which is directly proportional to the speed.

Example (Controlling Two Motors)

#define BRAKEVCC 0 // determine the value of the sharp brake
#define CW 1 //define CW rotation value
#define CCW 2 //define CCW counterclockwise rotation
#define BRAKEGND 3 //define stop value

const uint8_t inApin[2] = {7, 4}; // determine outputs of keys A
const uint8_t inBpin[2] = {8, 9}; // determine outputs of keys B
const uint8_t pwmpin[2] = {5, 6}; // detect PWM outputs
const uint8_t cspin[2] = {A2, A3}; // define current readout pins
const uint8_t enpin[2] = {A0, A1}; // define AB keys state outputs. The keys are opened when pulled to 0.
void setup()
{
  Serial.begin(9600); 
  //transfer the control outputs to the "output" mode
  for (int i=0; i<2; i++)
  {
    pinMode(inApin[i], OUTPUT); // outputs keys A
    pinMode(inBpin[i], OUTPUT); // outputs of B keys
    pinMode(pwmpin[i], OUTPUT); // PWM outputs
  }
  // initiate motors off
  motorOff(0);
  motorOff(1);
}

void loop()
{
  motorGo(0, CW, 32); // motorGo(0, CW, 32); // motor 0 clockwise, PWM 17.5%
  motorGo(1, CCW, 127); // motorGo(1, CCW, 127); // motor 1 counterclockwise, PWM 50%
  delay(3000); // wait 3 seconds, motors are turning
  Serial.print(analogRead(cspin[0]));
  Serial.print("\t");
  Serial.print(analogRead(cspin[1]));
  delay(3000);
//convert the output of the state of motor keys 1 to the mode "output":
  pinMode(enpin[1], OUTPUT);
// switch off motor 1:   
  digitalWrite(enpin[1], LOW);
// for three seconds: 
  delay(3000);
// turn motor 1 on, 
// switching the key state output to "input" mode:             
  pinMode(enpin[1], INPUT); 
  delay(3000);   
  motorGo(0, BRAKEVCC, 32); // bring motorGo(0, BRAKEVCC, 32); // bring motor 0 to the "brake" mode
  motorGo(1, BRAKEGND, 32); // stop motor 1 in mode "off
  while(true); //the script doesn't execute
  
}

// function to turn off the motor:
void motorOff(int motor)            
{
  for (int i=0; i<2; i++)
  {
    digitalWrite(inApin[i], LOW);
    digitalWrite(inBpin[i], LOW);
  }
  analogWrite(pwmpin[motor], 0);
}


// motor on function:
void motorGo(uint8_t motor, uint8_t direct, uint8_t pwm)  
{
// if motor number is correct:
  if (motor <= 1)
  {
// if direct is the same as the directional value:
    { if (direct <= 3)
    {
// if motor direction is clockwise or smooth stop,
// set the corresponding values of key A of the selected motor:
      if (direct <=1)
        digitalWrite(inApin[motor], HIGH);
      else
        digitalWrite(inApin[motor], LOW);

// if the motor direction is clockwise or sharp stop,
// set the corresponding values of the key B of the selected motor:
      if ((direct==0)||(direct==2))
        digitalWrite(inBpin[motor], HIGH);
      else
        digitalWrite(inBpin[motor], LOW);
//set PWM of the selected motor
      analogWrite(pwmpin[motor], pwm);
    }
  }
}

Description of the motorGo() function

Purpose: motor control;

Syntax: motorGo();

Parameters: motor number (0, 1), direction (CW, CCW, BRAKEVCC, BRAKEGND), PWM (0-255);

Return values: void;

Note: direction can be CW – clockwise, CCW – counterclockwise, BRAKEVCC – stop motor with interlock, BRAKEGND – stop motor without interlock.

Example:

motorGo(0, CCW, 127); // turn on motor 1, counterclockwise, speed 50%

Description of the motorOff() function

Purpose: to stop the motor

Syntax: motorOff();

Parameters: motor number (0, 1)

Returned values: void;

Note: this function also sets PWM value equal to zero of the selected motor

Example:

motorOff(1); // turn off the second motor

FAQ

How do I power my Arduino Motor Shield?

To power your Arduino Motor Shield, you will need to connect it to a DC power supply that provides at least 12V and up to 24V. The shield itself has two screw terminals for connecting the positive and negative wires of the DC power source. Make sure that you use an appropriate voltage range as using too much or too little can damage both your motor shield and any motors connected to it. Once wired in correctly, simply turn on the switch on the board itself or press its enable button (if present) and your Arduino Motor Shield should be ready to go!

How do I power my Arduino Motor Shield?

Can you connect motor directly to Arduino?

Yes, you can connect a motor directly to an Arduino, but it is not recommended. This is because the current requirements of most DC motors are too high for the Arduino’s pins and could damage them. To safely control a DC motor with an Arduino, you should use an L298 bridge IC as this will provide sufficient current while also protecting your board from damage due to excessive currents. Once connected properly through the bridge IC, you can then send signals from your Arduino code to turn on or off power going into each side of the motor which will cause it to rotate in either direction depending on how that power is applied.

How do I connect my RC motor to my Arduino?

Connecting an RC motor to your Arduino is a relatively simple process. First, you will need to purchase the appropriate components for your project such as an RC motor and a compatible power supply. Then, connect the positive lead of the power supply to one terminal on the motor and connect its negative lead to another terminal on it. Finally, use jumper cables or other connectors that are compatible with your Arduino board in order to link up each of these terminals from both sides – one side connected directly into ground pin (GND) while another side should be linked up with Digital Pin 9 (D9). Once all connections have been made correctly, you can begin controlling and powering your RC Motor using code written in C/C++ language within Arduino IDE software.

How many motors can an Arduino control?

The Arduino Mega 2560 is a powerful microcontroller that can be used to control a variety of motors. It has 14 digital output pins, which can be used to directly control up to 14 stepper motors. However, it is also possible to use port expanders and other devices connected through the I2C bus or SPI interface in order for the Arduino Mega 2560 controller board to control even more than just 14 motors – potentially allowing hundreds of different motor types and configurations. The exact number of additional motor outputs depends on how many port expanders are being added but typically an Arduino Mega 2560 could easily support over 50 different motors without any issue at all.

Can Arduino run brushless motor?

Yes, Arduino can run a brushless motor. This is achieved by connecting the ESC (Electronic Speed Controller) to the Arduino board. The ESC receives signals from the Arduino and converts them into appropriate electrical pulses which are then sent to the brushless motor for controlling its speed and direction of rotation. Furthermore, since most modern brushless motors require 3-phase power supply, an additional power source needs to be connected in order for it to work properly with our setup.

Related Video: Unboxing & Testing Monster Moto Shield 30Amp Motor Driver

Wrapping Up

Using the Monster Moto Shield with an Arduino is a great way to test out different motors and their potential applications. With the correct coding and wiring, this shield provides limitless possibilities for projects. It’s easy to understand why so many makers are turning to the Monster Moto Shield for their projects. Although it may seem daunting at first, using this shield with an Arduino is an achievable task that can open many doors.

The post How to Use a Monster Moto Shield With an Arduino: Epic Guide appeared first on NerdyTechy.

Connecting a microphone to the Arduino is a simple basic procedure that allows you to create full-fledged, very exciting audio projects. You can use devices that will convert the audio signal to digital, record the presence of sound, measure its volume (and then it all depends on your capabilities and preferences).

Using a Microphone With an Arduino: Main Steps

Microphone module (condenser∕electret microphone) is a simple device. It usually consists of a compact board with connection ports to the Arduino controllers (e.g. Nano). There is also a sound amplifier, a resistor and an electronic microphone, which is particularly sensitive to sound. By the way, with the sensitivity control you can easily and simply adjust the sensitivity of the microphone, and decide from what level of noise your sensor will be triggered in the future.

Of course, we will look at a few projects to familiarize ourselves with the practicality of using such a sensor. Let’s start with a little “warm-up” – let’s determine the intensity of the sound. For this wiring diagram (see the image below) we need the following hardware components:

  • Arduino UNO expansion board;
  • A sound sensor with a microphone (like KY-038);
  • breadboard;
  • LED;
  • resistor;
  • jumpers.

Using a Microphone With an Arduino: Main Steps

Load the sketch to check the functionality of the assembly:

int ledPin=13;
int sensorPin=7;
boolean val =0;
 
void setup(){
  pinMode(ledPin, OUTPUT);
  pinMode(sensorPin, INPUT);
  Serial.begin (9600);
}
  
void loop (){
  val =digitalRead(sensorPin);
  Serial.println (val);
  // when the sensor detects a signal above the threshold value, LED flashes
  if (val==HIGH) {
    digitalWrite(ledPin, HIGH);
  }
  else {
     digitalWrite(ledPin, LOW);
  }
}

We didn’t use any special libraries – everything is super-simple!

If you want, you can build and tune a simple equalizer. Pay attention to the circuit:

How to Use a Microphone and Equalizer With an Arduino

Example software firmware:

const int micPin = A0;
const int gPin = 12;
const int yPin = 11;
const int rPin = 10;
 
void setup() {
    Serial.begin(9600); 
    pinMode(gPin, OUTPUT);
    pinMode(yPin, OUTPUT);
    pinMode(rPin, OUTPUT);
}
 
void loop() {   
    int mvolts = analogRead(micPin) * 5.0 / 1024.0 * 1000.0; // values in millivolts
     Serial.println(mvolts); // output to the port
    /* LED thresholds are adjusted by
        by you experimentally: */
    if (mvolts < 2100) { //green led threshold, mV
      digitalWrite(gPin, HIGH);
      digitalWrite(yPin, LOW);
      digitalWrite(rPin, LOW);
    }
    else if (mvolts < 2125) { // yellow LED threshold, mV
      digitalWrite(gPin, HIGH);
      digitalWrite(yPin, HIGH);
      digitalWrite(rPin, LOW);
    }
    else if (mvolts < 2150) { // red LED threshold, mV
      digitalWrite(gPin, HIGH);
      digitalWrite(yPin, HIGH);
      digitalWrite(rPin, HIGH);    
    }
}

And you can also create your own light, which will be turned on by a clap of the hands or a snap of the fingers.

int ledPin=13;
int sensorPin=7;
boolean val =0;
 
void setup(){
  pinMode(ledPin, OUTPUT);
  pinMode(sensorPin, INPUT);
  Serial.begin (9600);
}
  
void loop (){
  val =digitalRead(sensorPin);
  Serial.println (val);
  // when the sensor detects a signal above the threshold value, LED flashes
  if (val==HIGH) {
    digitalWrite(ledPin, HIGH);
  }
  else {
    digitalWrite(ledPin, LOW);
  }
}

After loading the code you can snap your fingers near the sensor. If the LED does not light up, you must change the sensitivity of the sensor by turning the potentiometer switch.

How to Use a Microphone With an Arduino

You can adjust the sensitivity so that the LED follows the rhythm of a certain music track.

FAQ

Can an Arduino hear sound?

Yes, an Arduino can hear sound. There are various sound modules that can be used with an Arduino, such as the MAX98357 I2S DAC+AMP or the KY-038 Microphone Sound Sensor Module. These modules allow the Arduino to detect and amplify sound.

How do you use a microphone sensor?

There are many different ways to use a microphone sensor. Some common applications include recording sound, amplifying sound, and detecting movement.

What is a microphone sensor?

A microphone sensor is a device that converts sound waves into electrical signals. These signals can then be processed by a computer or other electronic device to convert the sound into a digital format.

Is sound sensor analog or digital?

There are both analog and digital sound sensors. Analog sound sensors convert sound waves into electrical signals, while digital sound sensors convert sound waves into digital signals.

What is the cost of sound sensor?

There is no definitive answer to this question as the cost of sound sensors can vary greatly depending on the specific make and model. However, you can expect to pay anywhere from $10-$100 for a quality sound sensor.

What is a noise sensor?

A noise sensor is a device that detects and measures noise levels in the environment. It can be used to monitor noise pollution levels or to assess the acoustic environment of a particular location.

Related Video: Using and Coding a Microphone Sound Sensor With Arduino

Conclusions

Today we have talked about how you can wire a sound sensor to the Arduino. We hope this information was useful to you! See you soon!

The post How to Use a Microphone With an Arduino: Easy Guide appeared first on NerdyTechy.

The ESP8266 was the real news of the last year for everyone who builds Arduino-based devices. It is a cheap microcontroller with more features than its expensive counterpart, yet compatible with AT+.

Arduino was not left out, and now this module is officially added to the list of supported by the board, and accordingly, more and more users will join the Chinese microcontroller for Wi-Fi connection. But the system needs to track the module’s location, for which one board ESP8266 will not be enough. This is where ESP8266 and SIM800L come in handy.

SIM800L GSM Module Pinout

Possibilities to Connect the SIM800L to the ESP8266 Microcontroller

Smart homes and many crafts require notification of the board’s location, whether a remote door or a regular tracker. Here is a short list of things that you can create by combining the ESP8266 and SIM800L:

  • Smart Home. Almost any technique for smart homes can be set to certain patterns when an object is approaching. But why install motion sensors if you can attach a SIM800L to the Wi-Fi board, sew in some piece of clothing microcontroller with a battery (goodness, a lot of power is not required) and automatically turn on the light or open the door when the user approaches.
  • All sorts of tracking devices. We are not talking about illegal bugs or other devices that violate your privacy rights. However, the microcontroller can work separately from the Arduino, and if you attach a SIM800L to it, the total size of the device won’t exceed a matchbox. Just wrap everything in a metal case and attach it to your keys as a keychain. Finding your smartphone, keys, and even your car in the parking lot will be easier.
  • Robotics and related fields. You can talk about the development of modern virtual intelligence and neural networks for a long time, but often, it is not enough for a piece of hardware to have sensors to create a map of the area and navigate in it. And if you do something like that, the GPS module comes in handy. It is convenient when paired with drones.

When you have decided on the project’s final goal, you need to understand the nuances of the question. The connection of the devices to the microcontroller mentioned above is the same as for standard Arduino boards. The only difference is the number of available pins. The GPS tracker requires 3.7 to 4.2 volts to operate instead of the usual 5 volts provided by the microcontroller. You have to design the circuit board accordingly and choose auxiliary power supplies accordingly. Or install transformers and resistors, depending on what else you will connect to the final system.

Important!
When the module is registering to the network, it will need approximately 2A, but this is its peak consumption, and later on, the required current will decrease to 1-1.2A.

Once you connect the tracker to the system, you need to start it up and send the first commands. AT and AT+ are best. The module will finally start sending data and responding to your requests after these actions, so don’t worry if you have connected it. The diode is flashing, but there is no reaction to scripts. You need to activate SIM800L the first time you use it so that it has time to register on the network.

Possibilities to Connect the SIM800L to the ESP8266 Microcontroller

Also, do not consider SIM800L an alternative to the ESP8266, as many users on forums are sinning. If you have stumbled on such a statement, you can be sure that the author has never worked with an Arduino. First of all, comparing an auxiliary board and a microcontroller makes no sense. Not to mention that one of the devices is designed to coordinate, send and receive requests over the wireless Internet, and the other is a GSM GPRS module. Accordingly, they are an excellent complement to each other but by no means an alternative.

Wiring Diagram SIM800L to ESP8266

The pinout is more than standard. You connect the power pin to a power supply capable of delivering 3.7-4.2 volts or to a transformer. TX goes to the RX pin and vice versa. Once you have soldered the module and decided to test it by plugging in the power supply, the diodes will signal that it is connected correctly. Next, activate the module using the method described above, and you can use AT commands to control it. If you want to load an auxiliary library or some weighty media, it’s worth reading about connecting the memory card to the Arduino system.

Wiring Diagram SIM800L to ESP8266

First, let’s test the speed of the port and the information about the module. We use “AT+IPR?” and “AT+CPAS,” respectively. If everything is OK and the information is displayed without errors, we can continue to check and test the signal strength and the operators that the module can see.

Important!
Most importantly, the Sim800i allows you to call specified numbers and receive calls, all with the help of basic libraries.

This also opens up a lot of room for applying systems with it. If you want to write a specific script that triggers something on an incoming call, consider that the module responds with the phrase “RING” on the command line.

This kind of functionality allows you to create hundreds of self-contained control systems, up to the point that instead of fingerprints or key cards, you can open the door on a call to a specific number. But of course, for a good level of protection, it is worth prescribing a white list of numbers.

Example of Connecting the GSM Module SIM800L to the ESP8266

The module should start blinking after connecting and soldering on the above-described pins. The diodes will begin blinking less frequently as soon as the network authentication occurs.

If the frequency of the light signals doesn’t decrease, you should check with the AT commands if the sim800I accepts your mobile operator’s network and if there is no error. Also, check the correct pinout and how the SIM card and antenna are installed. The error can be in them.

And of course, bring the system closer to the window if you are in a high building, it is possible that it can not catch the signal.

Final Words

In conclusion, SIM800L GSM Module with ESP8266 is a great way to get started with IoT projects. It is easy to use, and it is affordable. If you have any questions or thoughts on this tutorial, please leave them in the comments below!

The post Using SIM800L GSM Module with ESP8266: Guide for Beginners appeared first on NerdyTechy.

Arduino boards are very popular among electronic engineers and inventors. This is a fact: the cost of the original controllers is relatively low, while many Chinese clones are almost 3 times cheaper. With this controller, you can come up with and design anything you want.

But unfortunately, the board is very susceptible to external influences: at the slightest misstep, the controller is ready to fail immediately.

Here are ten undesirable experiments, after which you can safely throw the controller in the trash.

Mistake 1: High Voltage

Do not supply any voltage higher than 5V to the Arduino via the pin pins (or higher than 3.3V for controllers with this operating voltage)!

People sometimes confuse the 5V and vin pins and apply voltage exactly to the pin marked 5V. It is a pin, so don’t be surprised if your Arduino doesn’t turn on anymore after such an experiment.

Mistake 2: Two Power Supplies

Do not power the Arduino from two different sources at the same time! This leads to a voltage distortion, and as a consequence, after a while, the controller can fail.

Mistake 3: Software Resistance

Never enable resistance in Arduino controllers programmatically! When a pin is engaged, it should always be connected via a 10k ohm pull-up resistor to the ground. This is done to eliminate the interference from external power supplies.

Destroying an Arduino Board

The Arduino controller has internal pull-up resistors on each pin. They are enabled via program code and can be used as protection against false positives. But if such a pin is overloaded or accidentally short-circuited, it will simply burn out and won’t work anymore.

Mistake 4: Short Circuit

Never short the supply wires to the controller! You have probably already guessed that the chip is afraid of almost any short circuit. In general, any equipment is afraid of such an oversight. Many manufacturers put special fuses on their devices that break the circuit at the slightest overcurrent or overvoltage. But don’t push your luck.

There is already so-called “foolproofing” and protection against inattentive users on boards like the Arduino Mega. But there is no fuse on Nano-type boards because of physical limitations. It is good if it only burns out the wiring on the board. To change a diode or a resistor is not a problem, but to burn the controller because of a careless movement is a great shame.

Mistake 5: Shorting Without a Load

Do not short the Arduino pins together without any load! Just don’t do it that way. At the very least, if you think it should work this way and can’t be any other way, connect only through a resistor.

Mistake 6: Overloading

Do not overload the Arduino pins with voltage and current. The controller’s outputs are designed for a total current of up to 200mA. If this threshold is exceeded, the controller will overheat and will fail.

How to Kill an Arduino Board

The connection of a powerful motor or any other device to the outputs should be made through a bundle using MOSFETs or optocouplers. The power supply must either be separate or powered directly, bypassing the controller.

Mistake 7: Re-Polarizing, the Controller

Ground reversal is also terribly harmful to the controller: you will end up with a completely burned-out board! However, there is a chance that only the controller’s wiring, e.g., the protection diode, is burnt out. Try to replace it first: maybe the controller will come back to life, but it’s uncertain.

Mistake 8: Static Electricity

The microcircuit is sensitive to all kinds of external influences, and a strong arc of static electricity will stitch the controller to death. It is better to work with the controller in antistatic clothing. Also, there are special antistatic bracelets for sale: don’t spare the money and buy one for yourself.

Mistake 9: Controller On

Do not assemble the circuit with the controller turned on. People starting with controllers often don’t know that you can’t change or disconnect components in a circuit while it’s running. Program failure is not the worst thing that can happen.

The scary part is when half of the pins stop showing signs of life. Such a controller will never work adequately again (if it works).

Mistake 10: Twelve Volts

Do not apply a voltage higher than 12V to the board. Modules connected to the board can operate at voltages higher than the rated voltage, different from the intended voltage on the board.

The engineers who designed the Arduino have taken this nuance into account, and the chip can withstand high voltages, but it will be very warm. If the voltage threshold of 12 volts exceeds, the controller will burn out!

When working with Arduino boards, be very careful. It is better to double-check all the connections before you start the device.

FAQ

What can I do with an old Arduino?

There are many things that you can do with an old Arduino. You can repurpose it and turn it into something new. You can also use it to do some DIY projects like a robot or a light show.

Is Arduino hazardous?

The Arduino is not considered hazardous because it has a very low risk of harm. There are no known health risks for the user or anyone else in their environment.

Can Arduino overheat?

Yes, it can. If you are working with high current draw circuits, like servos, brushless motors, etc., you may consider adding a heatsink to the Arduino board.

Related Video: Top 10 Ways to Destroy an Arduino – I Did All 10 at Once

Final Words

I hope that you learned something new in this article, and maybe I was able to teach you a few tricks or tips on how to prevent destroying an Arduino board. If there are any questions or anything that you would like to ask me, please comment below.

The post How to Destroy an Arduino Board: 10 Common Mistakes appeared first on NerdyTechy.

The Arduino is a programmable board that can control electronic devices. The Arduino board has many useful features, making it an ideal platform for building projects. It can control LEDs and motors with ease and can be programmed to react to changes in the environment by turning on an alarm or triggering a camera shutter. This tutorial will show you how to stop an Arduino program.

Method 1: Unplugging the Arduino Safely

There are many ways to turn off the power to an Arduino. The most common way is by using the power switch on the Arduino board, but this can take up a lot of time if you are trying to stop a program. Another way is by unplugging the power source from your SBC or battery pack, but this can also be time-consuming if you have multiple boards connected together.

It is important to know how to safely turn off the power by unplugging the Arduino. This is a quick guide on how you can do this.

  1. Turn off the power by unplugging the Arduino safely.
  2. Disconnect all cables that are connected to the Arduino, including power supply wires, USB cable, and Ethernet cable, if any.
  3. Remove any shields and finally detach the Arduino from its base plate.

Method 2: Stopping the void loop() Using break

The break keyword is a keyword that comes from the C programming language, and it is used to stop a loop from running. It can be used in Arduino programs as well.

The break keyword stops the execution of the for, while, do-while, or switch statements to which it applies. The break keyword can’t be used inside nested loops or if statements.

Method 3: Stopping the void loop() Using Sleep_n0m1 Library

The Sleep_n0m1 library is an Arduino library that allows you to put your CPU to permanent sleep until you reset it manually or using a timer.

This is a very useful library for people who want their Arduino to go into sleep mode and have it wake up periodically, usually every few seconds. It’s also useful for projects that require high precision timing.

Method 4: Stopping the void loop() Using exit(0)

The Arduino program can be stopped using the exit(0) method after your code, but it doesn’t work for all Arduino boards.

Be careful when using this method, as it may cause the Arduino to stop working until you reset it.

Method 5: Stopping the void loop() Using an Infinite Loop

If you use an infinite loop in your program, the Arduino will not sleep and stay awake as long as it is powered on. This can cause problems with your device if you are looking to conserve power or have a battery with a limited life.

Stopping the void loop() Using an Infinite Loop

Method 6: Stopping the void loop() Using sleep_mode()

In order to stop the void loop(), one should use sleep_mode(). It is an operating system that puts the CPU into a power-down sleep.

FAQ

How do you stop an Arduino script?

To stop an Arduino script, you need to either turn off the power or pull out the USB cable.

Can I just unplug my Arduino?

This is a question that is often asked by people who are new to the Arduino. The answer is no. You can’t just unplug your Arduino.

How do I stop an Arduino program without unplugging it?

The Arduino board has a reset button that you can use to stop the program. But what if you don’t have access to the button? The reset button is not always available.

There are two ways to stop the program without using the reset button:

  1. Connecting the Reset pin to the Ground pin. This will stop the processor and return it to a known state.
  2. Disconnecting power from your Arduino board.

Final Words

I hope this article helped you to understand how to stop an Arduino program. In conclusion, the Arduino program is not only a toy. It is a great tool for learning how to code, and it can be used in very creative ways. I hope this tutorial has been helpful.

The post How to Stop an Arduino Program: 6 Easy Methods appeared first on NerdyTechy.

The Arduino random function returns a pseudorandom number, which means that the random number generation sequence is still predictable. The randomSeed function allows you to place a variable or constant into the random function to generate more random values. In this article, let’s figure out how to correctly set a random number in a range in the Arduino IDE.

The Arduino has a couple of ready-made functions to work with pseudorandom numbers. Let’s look at them:

  • random(max); – returns a pseudorandom number between 0 and (max – 1). max takes unsigned long, that is, from 0 to 4,294,967,295.
  • random(min, max); – returns a pseudorandom number in the range from min to (max – 1). max takes unsigned long, i.e. 0 to 4,294,967,295.
  • randomSeed(value); – give the pseudorandom number generator a new reference point for the count. Value is any number of unsigned long types, so we have 2^32 (4,294,967,295) sets of pseudorandom numbers on the Arduino.

How to generate random numbers so that the sequence is new every time? There are options:

  • Set a random number in randomSeed() when running the program. How to do this? I will tell you below.
  • If the device interacts somehow with the external world, or even the user, then you can feed randomSeed the current time since the start of the program, i.e., millis() or micros() functions when some hardware random events happen (button presses, sensor actuation, data acceptance, etc.). This is a great solution, by the way! We call randomSeed(micros()) and that’s it.

Arduino Random Number Generation Using random()

For this, we will need:

  • Arduino Uno / Arduino Nano / Arduino Mega
  • The random (min, max) function allows you to return a pseudorandom number in the range given by min and max values. But, first, let’s look at examples with different data types.

Arduino Random Number Generation Using random Function

Arduino Random int

In the presented example, the selected data type is a byte, which stores integers in the range from 0 to 250. You can also use other data types: int, long, unsigned long, unsigned int, and others. The desired range (min, max) is set accordingly.

byte data;

void setup() {
   Serial.begin(9600);
}

void loop() {
   data = random(100, 200); // arduino random number in range
   Serial.println(data);
   delay(250);
}

Arduino Random float

The microcontroller can only generate integers. Therefore, to get a float data type with two decimal places, you must generate an integer separately and add decimal fractions to it. An example of such a program:

float data;
float data1;
float data2;

void setup() {
   Serial.begin(9600);
}

void loop() {
   data1 = random(0, 10); // generate the integers
   data1 = random(0, 100); // generate the numbers after the decimal point
   data = data1 + data2 / 100; // sum the resulting values
   Serial.println(data);
   delay(250);
}

Arduino Random Numbers Using randomSeed()

Note that the random sequence of numbers is repeated each time the program is restarted in all of the examples above. This can be avoided by using the Arduino randomSeed function. randomSeed allows you to place a variable in the random function. Then, use millis, analogRead, or other options to randomize the number generation.

int data;

void setup() {
   Serial.begin(9600);
   randomSeed(analogRead(A1)); // nothing is connected to pin A1
}

void loop() {
   data = random(100, 200); // arduino random number in range
   Serial.println(data);
   delay(250);
}

Each time the program is restarted, the pseudorandom number generator will be initialized with randomSeed(analogRead(A1)); from a random value due to “noise” on the port. You can use any free port for this since all analog outputs pick up random noise from the environment – radio waves, electromagnetic interference from computers, cell phones, etc.

Related Video: Using Random Numbers with Arduino

Final Words

In conclusion, it is essential to have a good understanding of the types of random numbers that are used in Arduino programming. It is also important to know which type of random number generator to use in a given scenario. In most cases, a pseudorandom number generator is sufficient for generating realistic-looking but repeatable data.

The post Arduino Random Number Guide for Beginners appeared first on NerdyTechy.

The truth is, we never entirely got to grips with Arduino documentation. Until now. Now there’s a new standard for gathering together product info, tech specs and tutorials, that we’re calling Arduino Docs. We’re excited to share it with the Arduino community who’ll soon be able to help it grow.

Arduino Docs is now live

It began with the Uno

When the Arduino Uno was launched around 15 years ago, its detailed documentation was a vital part of its success. It wouldn’t be at all unreasonable to say that its online resources were a driving factor in the establishment and growth of the primordial Arduino community.

But you’re probably quite aware of Arduino’s history, and the rapid growth that followed. Creating, organizing and maintaining that level of documentation around each and every board became a huge task. The complexity was one thing, but the open-source nature also meant that a lot of third party content was generated. Which is great, and is still very much encouraged, but it also muddied the waters of supporting content. 

So getting all that essential info together in one place, while providing a great experience for the users, has been a passion project for a lot of people at Arduino. And now, it’s ready.

Which brings us back to today, and the launch of a whole new approach to the online presence of Arduino boards. Welcome to Arduino Docs.

The All New Arduino Docs Site

The new Arduino Docs site launches with a detailed, but easy-to-use breakdown of everything you ever wanted to know about the official boards and products.

Every product will get its own page, broken down into standardized sections so you have instant, easy access to what you need.

  • Overview: You’ll begin here when you take a look at a board on the Arduino Docs site. It’s a bird’s-eye-view of the board’s description and purpose, its main features, tech specs, revision logs (where applicable) and compatibility options.
  • Essentials: This section gets you started with using the board in question. Here you’ll find quick start guides, suggestions for libraries, and useful basics on using Arduino. Perfect for newcomers or anyone needing a refresher.
  • Tutorials: Any and all tutorials connected to the board will be marshalled here. You’ll never have to go hunting when you’re looking to build something awesome. These tutorials will showcase the different features of each board, giving you a full understanding of what’s possible.
  • Resources: This is where we’ll keep the datasheets, downloads, pinout diagrams, schematics and other useful documents and files.
Pinout Diagrams on Arduino Docs

It’s been no small feat collating all this information, and reformatting into something that’s as useful for beginners as it is for experts and engineers. It’ll kick off with over 130 tutorials, dozens of boards, and a great selection of shields, all given a brand new home.

But it’s not just about the hardware. The new Arduino Docs site aims to be the most encyclopedic resource we’ve ever compiled, so it includes sections for software (such as the IDEs), Cloud (for the web editor and other Arduino Cloud tools) and a great asset for understanding the foundations of Arduino’s approach to electronics.

Cool Community Content

Lots of companies say they’re all about community. But in our case it’s actually true! Arduino isn’t a company or a board or a platform. It’s a community.

You guys created much of the content, tutorials and documentation out there. That’s not going to change now that we’ve launched Arduino Docs. GitHub is home to the whole system (we’re tech nerds, we can’t help it). That means members of the community will soon be able to add, edit and influence the Arduino Docs content.

Resources for all boards on Arduino Docs

The content team will review and approve submissions and branches made through GitHub. So what you’re seeing right now is the embryonic stage of Arduino Docs. We envisage amazing things once the community is able to get involved. Sign up to our newsletter so we can keep you posted on when that becomes possible, and about updates, leaks and more.

We’re very proud of the work that the various internal teams have done in making this happen. We hope you are too, and as always we really want any and all feedback you have on this new and valuable Arduino resource.

Please go and take a look, and do stop by the forums to tell us all about your experience.

The post Arduino Docs has all the info you ever need about Arduino boards appeared first on Arduino Blog.

SubmitProject_blogpost

The Arduino Project Hub (powered by Hackster.io) is a community dedicated to discovering how fun and rewarding tinkering with electronics and software can be, so any project made with Arduino and Genuino boards is welcome! Each day, the Arduino Team will select some of the best tutorials and highlight them on our social channels.

The Arduino Project Hub is also a great place to keep your latest projects and easily share them with your friends, students and the rest of the community!

If you have tutorials and articles on other platforms, we’ve got some good news! There is a cool import function so you can just paste the link and we’ll take care of the transfer. When you click on ‘New Project’ you will be presented with two options, create a tutorial from scratch or import one via URL.

importProjectHub

Read this tutorial to learn more.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook