Carte USB Shield Batterie 2×18650 3V/5V. 5v battery for esp32

Carte USB Shield Batterie 2×18650 3V/5V pour Arduino ESP32 ESP8266

Rester toujours brancher pour avoir des Coupons

  • Livraison via Aramex

Le courrier Aramex livrera à l’adresse indiquée

Carte USB Shield Batterie18650 3V/5V pour Arduino ESP32 ESP8266

La carte USB Shield Batterie 2×18650 3V/5V est un module conçu pour être utilisé avec les microcontrôleurs Arduino, ESP32 et ESP8266.

Il permet de fournir une alimentation stable et portable à ces cartes de développement en utilisant deux batteries rechargeables 18650.

La carte dispose d’un port USB qui peut être utilisé pour recharger les batteries ou pour alimenter les microcontrôleurs. Il y a également des connecteurs pour les sorties de tension 3V et 5V, ce qui permet une utilisation flexible selon les besoins de l’utilisateur.

L’ensemble de la carte est équipé d’un système de protection de batterie intégré pour assurer une utilisation sûre et fiable.

La carte USB Shield Batterie 2×18650 3V/5V est un choix populaire pour les projets d’Arduino et d’ESP qui nécessitent une alimentation portable et fiable.

Bouclier de batterie au lithium 18650 bidirectionnel Module de carte d’extension d’alimentation mobile V8 5V/3A 3V/1A Micro USB pour alimenter votre Arduino, ESP32, ESP8266, NODE MCU, etc.

Même vous pouvez recharger votre mobile – ce module est donc considéré comme un module de banque d’alimentation à faible coût.

ESP32 vs. Arduino Uno: Which One Should You Get?

When you’re starting out with microcontrollers, you may read about ESP32 vs. Arduino Uno. One is a fancy board filled with functionality to the brim. The other is an iconic tool that’s inspired countless roboticists around the world. Here we look at both ESP32 and Arduino Uno to see which one you should choose.

What Is a Microcontroller?

A microcontroller is a tiny computer on a chip. That computer connects to pins, plugs, and/or other pieces of metal called “peripherals” that give and receive inputs and outputs.

Both the Arduino Uno and ESP32 have bits of metal on them that do just that. But the Arduino has female header pins that bite on the metal ends of male header pins. On the other hand, the ESP32 typically has male header pins that do the opposite.

What Is an Arduino Uno?

For many hobbyists, the Arduino Uno (or any of its cheaper Chinese knockoffs) is their first introduction to microcontrollers and embedded systems. It’s a cheap machine, reliable enough to run 24/7 and durable enough to stay usable in the hands of most clumsy, inexperienced students.

The Arduino Uno is the most iconic of all the Arduino products. It’s meant as a learning aid for electronics students. Nowadays, the Arduino Uno you see in stores should be the R3 version or third revision to the original Arduino Uno.


  • Removable microcontroller chip: the Arduino Uno comes with a removable ATmega328P microcontroller chip. With just a pair of tweezers, you can literally just pull the chip off the board. That’s useful for when you’ve worn down the chip after 10,000 memory writes.
  • Has plenty of shields: a shield is a separate board that fits on top of the Arduino board to give it more functionality. You can have a motor shield that acts as a driver for multiple motors, for instance, or wireless connectivity with the Wi-Fi shield.
  • There’s a community behind it: because it’s made by the first company to make the first educational development boards, there’s already a large community around the Arduino Uno. There are industries, companies, and even individual hobbyists centered around this board and the whole concept of Arduino.


  • It’s power inefficient: while Arduino Uno is good for beginners, it eats up too much power. Most of it goes to the stuff that makes it durable for students. It’s not particularly the best board to run off a battery, even if it does get the job done.
  • Not enough pins: anyone who’s made larger projects on the Arduino knows the pain. With only 14 digital I/O pins, there’s only so much to work with after you add in a 16×2 LCD display.
  • Hard to remove broken male header pins: It’s not a universal problem but is when it becomes one. When a male header pin breaks and gets stuck, it’s going to be a pain to take it out. Sure, it’s a rare occurrence, but the chances of it happening tend to go up in a classroom with more of these boards being passed between students’ hands.

What Is an ESP32?

The ESP32 may be the next step to studying embedded systems and has everything – as long as you know how to use it. The board has Wi-Fi connectivity, Bluetooth, and over 30 I/O pins to fit as many modules as it can. It’s a beast among hobbyist boards and small enough to fit in a tiny box.

Actually, the ESP32 is not just a single board. It’s a series of boards developed by Espressif. For the most part, the kind of board you get doesn’t matter much because they’re more or less the same, especially for beginners. But here we are talking about the NodeMCU32S, built on top of the NodeMCU framework.


  • I/O pins: compared to the Arduino Uno, the ESP32 can fit more sensors and modules because it has more GPIO pins. This also means that it has more PWM and analog pins.
  • Much cheaper: the ESP32 is also much cheaper – in fact, it’s about five times cheaper than the Arduino Uno, even if you don’t include the price for the Wi-Fi shield. For a board with twice the number of GPIO pins, that’s quite impressive.
  • Built-in Wi-Fi and Bluetooth support: it’s perhaps the main reason to switch to the ESP32. With the built-in interconnectivity support, you can send information wirelessly without having to buy shields. This way, you could save on hardware costs and battery life on your ESP32-based IoT projects.


  • The boot button: unfortunately, the ESP32 isn’t perfect. You have to press the boot button every time you upload code. While that shouldn’t be much of a deal-breaker, it’s definitely a hassle, especially when you’re still learning how to code.
  • It uses 3.3v logic: Having 3.3v logic means that each pin registers a “1” or “high” when it reaches 3.3 volts. It also means that 5 volts on a pin will kill it. Unfortunately, some modules won’t work right on 3.3 volts, shrinking your choice of modules, despite the larger number of pins.
  • Pinout changes depending on the board: to be accurate, the ESP32 is just a chip. The pinout can change depending on which design you have. Some don’t even have programmable internal LEDs, for instance, and others might not even have mounting holes.

What They Have in Common

With knowledge of the differences between the ESP32 and Arduino Uno, let’s talk about what they have in common.

Coding Standards

First of all, the Arduino IDE supports both boards. You could upload the same Blink code to each board, and there wouldn’t be anything different on the output side.

Perhaps the best thing about these boards is that they’ll work with any language as long as the IDE supports it. Whether you use OpenMV or PlatformIO, both boards can run MicroPython right off the bat!


Next up, both boards will support the same hardware as long as they:

LEDs, potentiometers, and resistors are good examples of hardware that don’t care whether it’s 3.3v or 5v. They’ll work as long as there’s electricity running through them.

On the other hand, many sensors won’t mind the voltage difference. This includes the common ones you’d find in sensor bundle kits. Some do, though, so you’re better off checking the schematics if they use 3.3v, 5v, or both.

Power Supply

Lastly, and probably the most critical, is the power supply. Both boards can handle 5 volts and 500 mA from a USB port power supply and slightly more – that is, as long as they’re through the regulated ports.

carte, shield, batterie, 18650, battery, esp32

For the Arduino Uno, that’s the Type-B USB port. And for the ESP32, that’s the micro-USB port. There’s a regulator in these ports that only allows what their respective boards need.

Both also support unregulated power supply sources. The “Vin” pin in each board is meant to take up as much electricity as it needs, but you’ll have to regulate the electricity in that pin or risk breaking the board.

How Can You Know What You Really Need?

We’re at the important part now. Should it be the Arduino Uno? Or should it be the ESP32?

Despite its price and lack of extra pins and features, every electronics student should at least invest in an Arduino Uno. It’s a board meant for students who’d probably break something along the way.

On the other hand, the more experienced ones should try the ESP32 for its extra features. It shouldn’t be read by those who can’t read schematics, let alone a freshman who doesn’t know how Ohm’s law works.

Frequently Asked Questions

Why am I seeing so many Arduino clones?

There’s only one reason for this: open-source hardware. You can legally make your own Arduino board, improve on it, and sell it. That’s how Seeeduino, Ruggeduino, and LilyPad Arduino came into being.

How do you test whether each board works?

The quickest way to test any new microcontroller board is to make it blink its internal LED (if it has one). For most Arduino-based boards, that’s setting D13 to “HIGH.” But for the ESP32, that’s going to depend on the hardware. For instance, the NodeMCU32S uses GPIO 2, but the ESP32-DevkitC has none. In that case, you can try making it send a message through the serial monitor, instead.

There’s a black, tape-like thing at the back of my ESP32, can I remove it?

DO NOT! Never remove that black, tape-like thing at the back unless you’re 100% sure of what you’re doing. It protects the built-in antenna from corrosion.

Get the best of IoT Tech Trends delivered right to your inbox!

Terenz is a hobbyist roboticist trying to make the most awesome robot the world has ever seen! He would have done that already if he wasn’t so busy burning through LEDs.

Popular Posts

5 of the Best Arduino Starter Kits You Can Get A Quick Start Guide

10 of the Best Programming Languages for IoT

All About the Raspberry Pi Pico File System

How to Integrate Arduino with Unity 3D

Never Miss Out

Stay updated with our weekly recap of the latest trends in IoT world.

Interface L298N DC Motor Driver Module with Arduino

While you’ll eventually need to learn to control DC motors in order to build your own robot, you’ll probably need something a little easier to get started – which is where the L298N motor driver comes in. It can control the speed and spinning direction of two DC motors.

In addition, it can control a bipolar stepper motor, such as the NEMA 17. If you want to learn more about it, check out this tutorial.

If you are planning on assembling your new robot, you will eventually want to learn how to control stepper motors. The easiest and inexpensive way.

Controlling a DC Motor

We can only have full control over a DC motor if we can control its speed and spinning direction. This is possible by combining these two techniques.

  • PWM – to control speed
  • H-Bridge – to control the spinning direction

Let’s learn more about these techniques.

PWM – to control speed

The speed of a DC motor can be controlled by changing its input voltage. A widely used technique to accomplish this is Pulse Width Modulation (PWM).

PWM is a technique in which the average value of the input voltage is adjusted by sending a series of ON-OFF pulses. This average voltage is proportional to the width of the pulses, which is referred to as the Duty Cycle.

The higher the duty cycle, the higher the average voltage applied to the DC motor, resulting in an increase in motor speed. The shorter the duty cycle, the lower the average voltage applied to the DC motor, resulting in a decrease in motor speed.

The image below shows PWM technique with various duty cycles and average voltages.

H-Bridge – to control the spinning direction

The spinning direction of a DC motor can be controlled by changing the polarity of its input voltage. A widely used technique to accomplish this is to use an H-bridge.

An H-bridge circuit is made up of four switches arranged in a H shape, with the motor in the center.

Closing two specific switches at the same time reverses the polarity of the voltage applied to the motor. This causes a change in the spinning direction of the motor.

The following animation shows the working of the H-bridge circuit.

L298N Motor Driver Chip

At the center of the module is a big, black chip with a chunky heat sink – the L298N.

The L298N chip contains two standard H-bridges capable of driving a pair of DC motors, making it ideal for building a two-wheeled robotic platform.

The L298N motor driver has a supply range of 5V to 35V and is capable of 2A continuous current per channel, so it works very well with most of our DC motors.

Technical Specifications

Here are the specifications:

Motor output voltage 5V – 35V
Motor output voltage (Recommended) 7V – 12V
Logic input voltage 5V – 7V
Continuous current per channel 2A
Max Power Dissipation 25W

For more details, please refer below datasheet.

L298N Motor Driver Module Pinout

The L298N module has 11 pins that allow it to communicate with the outside world. The pinout is as follows:

Let’s get acquainted with each pin one by one.

Power Pins

The L298N motor driver module receives power from a 3-pin, 3.5mm-pitch screw terminal.

The L298N motor driver has two input power pins: VS and VSS.

VS pin powers the IC’s internal H-Bridge, which drives the motors. This pin accepts input voltages ranging from 5 to 12V.

VSS is used to power the logic circuitry within the L298N IC, and can range between 5V and 7V.

GND is the common ground pin.

Output Pins

The output channels of the L298N motor driver, OUT1 and OUT2 for motor A and OUT3 and OUT4 for motor B, are broken out to the edge of the module with two 3.5mm-pitch screw terminals. You can connect two 5-12V DC motors to these terminals.

Each channel on the module can supply up to 2A to the DC motor. The amount of current supplied to the motor, however, depends on the capacity of the motor power supply.

Direction Control Pins

The direction control pins allow you to control whether the motor rotates forward or backward. These pins actually control the switches of the H-Bridge circuit within the L298N chip.

The module has two direction control pins. The IN1 and IN2 pins control the spinning direction of motor A; While IN3 and IN4 control the spinning direction of motor B.

The spinning direction of the motor can be controlled by applying logic HIGH (5V) or logic LOW (Ground) to these inputs. The chart below shows various combinations and their outcomes.

carte, shield, batterie, 18650, battery, esp32

Speed Control Pins

The speed control pins ENA and ENB are used to turn on/off the motors and control their speed.

Pulling these pins HIGH will cause the motors to spin, while pulling them LOW will stop them. However, with Pulse Width Modulation (PWM), the speed of the motors can be controlled.

The module usually comes with a jumper on these pins. When this jumper is in place, the motor spins at full speed. If you want to control the speed of the motors programmatically, remove the jumpers and connect them to the Arduino’s PWM-enabled pins.

On-board 5V Regulator and Jumper

The module includes a 78M05 5V regulator that can be enabled or disabled via a jumper.

When this jumper is in place, the 5V regulator is enabled, and the logic power supply (VSS) is derived from the motor power supply (VS). In this case, the 5V input terminal acts as the output pin, delivering 5V 0.5A. You can use it to power an Arduino or other circuitry that needs 5V power.

When the jumper is removed, the 5V regulator is disabled, and we have to supply 5V separately through the VSS pin.

If the motor power supply is less than 12V, you can keep the jumper in place. If it is greater than 12V, the jumper must be removed to prevent damage to the onboard 5V regulator.

Also, do not supply power to both the VSS and VS pins while the jumper is in place.

Voltage Drop of L298N

The L298N has a voltage drop of approximately 2V. This is due to the fact that internal switching transistors have a voltage drop of approximately 1V when forward biased, and because an H-Bridge requires the current to pass through two transistors, the total voltage drop is 2V.

So, if you connect 12V to the motor power supply terminal, the motors will receive approximately 10V. This means that a 12V DC motor will never spin at full speed.

In order to get the motor to run at its maximum speed, the motor power supply should have a voltage that is slightly higher (2V) than the actual voltage requirement of the motor.

Taking into account a voltage drop of 2V, if you are using 5V motors, you will need to provide 7V at the motor power supply terminal. If you have 12V motors then your motor supply voltage should be 14V.

This excess voltage drop results in significant power dissipation in the form of heat. This is why the L298N based motor drivers require a big heatsink.

Wiring an L298N Motor Driver Module to an Arduino

Now that we know everything about the module, we can start hooking it up to our Arduino!

Let’s begin by connecting the motor power supply. In our experiment, we are using DC gearbox motors, also called “TT” motors, which are often found in two-wheel-drive robots. They are rated for 3 to 12V. We will therefore connect an external 12V power source to the VS terminal. Because L298N has a voltage drop of about 2V, the motors will receive 10V and spin at a slightly lower RPM. But that’s okay.

Next, we need to supply 5V to the logic circuitry of the L298N. We’ll use the on-board 5V regulator to draw 5V from the motor power supply, so keep the 5V-EN jumper in place.

Now connect the L298N module’s Input and Enable pins (ENA, IN1, IN2, IN3, IN4 and ENB) to the six Arduino digital output pins (9, 8, 7, 5, 4 and 3). Note that both Arduino output pins 9 and 3 are PWM-enabled.

Finally, wire one motor to terminal A (OUT1 and OUT2) and the other to terminal B (OUT3 and OUT4). You can swap out your motor’s connections. There is technically no right or wrong way.

Arduino Example Code

The sketch below will show you how to control the speed and spinning direction of a DC motor using the L298N Motor Driver and can serve as the basis for more practical experiments and projects.

The sketch moves the motor in one direction for one revolution, then in the opposite direction. There is also some acceleration and deceleration involved.

When accelerating or decelerating the motor, you may hear it humming, especially at lower PWM values. This is normal; there is nothing to be concerned about. This happens because the DC motor requires a minimum amount of voltage to operate.

// Motor A connections int enA = 9; int in1 = 8; int in2 = 7; // Motor B connections int enB = 3; int in3 = 5; int in4 = 4; void setup // Set all the motor control pins to outputs pinMode(enA, OUTPUT); pinMode(enB, OUTPUT); pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); pinMode(in3, OUTPUT); pinMode(in4, OUTPUT); // Turn off motors. Initial state digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW); void loop directionControl; delay(1000); speedControl; delay(1000); // This function lets you control spinning direction of motors void directionControl // Set motors to maximum speed // For PWM maximum possible values are 0 to 255 analogWrite(enA, 255); analogWrite(enB, 255); // Turn on motor A B digitalWrite(in1, HIGH); digitalWrite(in2, LOW); digitalWrite(in3, HIGH); digitalWrite(in4, LOW); delay(2000); // Now change motor directions digitalWrite(in1, LOW); digitalWrite(in2, HIGH); digitalWrite(in3, LOW); digitalWrite(in4, HIGH); delay(2000); // Turn off motors digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW); // This function lets you control speed of the motors void speedControl // Turn on motors digitalWrite(in1, LOW); digitalWrite(in2, HIGH); digitalWrite(in3, LOW); digitalWrite(in4, HIGH); // Accelerate from zero to maximum speed for (int i = 0; i 256; i) analogWrite(enA, i); analogWrite(enB, i); delay(20); // Decelerate from maximum speed to zero for (int i = 255; i = 0;.-i) analogWrite(enA, i); analogWrite(enB, i); delay(20); // Now turn off motors digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW);

Code Explanation:

The Arduino code is fairly simple. It does not require any libraries to work. The sketch starts by declaring the Arduino pins that are connected to the L298N’s control pins.

// Motor A connections int enA = 9; int in1 = 8; int in2 = 7; // Motor B connections int enB = 3; int in3 = 5; int in4 = 4;

In the setup section of the code, all of the motor control pins, including the direction and speed control pins, are configured as digital OUTPUT. And the direction control pins are pulled LOW to initially disable both motors.

void setup // Set all the motor control pins to outputs pinMode(enA, OUTPUT); pinMode(enB, OUTPUT); pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); pinMode(in3, OUTPUT); pinMode(in4, OUTPUT); // Turn off motors. Initial state digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW);

In the loop section of the code, we call two user-defined functions with a one-second delay.

void loop directionControl; delay(1000); speedControl; delay(1000);

    directionControl – This function causes both motors to spin at full speed for two seconds. It then reverses the spinning direction of the motors and spins for two seconds. Finally, it stops the motors.

void directionControl // Set motors to maximum speed // For PWM maximum possible values are 0 to 255 analogWrite(enA, 255); analogWrite(enB, 255); // Turn on motor A B digitalWrite(in1, HIGH); digitalWrite(in2, LOW); digitalWrite(in3, HIGH); digitalWrite(in4, LOW); delay(2000); // Now change motor directions digitalWrite(in1, LOW); digitalWrite(in2, HIGH); digitalWrite(in3, LOW); digitalWrite(in4, HIGH); delay(2000); // Turn off motors digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW);
void speedControl // Turn on motors digitalWrite(in1, LOW); digitalWrite(in2, HIGH); digitalWrite(in3, LOW); digitalWrite(in4, HIGH); // Accelerate from zero to maximum speed for (int i = 0; i 256; i) analogWrite(enA, i); analogWrite(enB, i); delay(20); // Decelerate from maximum speed to zero for (int i = 255; i = 0;.-i) analogWrite(enA, i); analogWrite(enB, i); delay(20); // Now turn off motors digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW);

Introduction to ESP32 Wi-Fi LoRa

About: Do you like technology? Follow my channel on YouTube and my Blog. In them I put videos every week of microcontrollers, arduinos, networks, among other subjects. About Fernando Koyanagi »

Let’s go to the second video of our Introduction playlist. This time, we’ll talk about the ESP32 Wi-Fi LoRa. This one is very special because it has 3 wireless features: Bluetooth 4.2, Wi-Fi 802.11, and the LoRa, which is a type of network with the reach of 3.6 km through a simple antenna. All of this can be used at the same time, which makes it magnificent. We will then introduce the Heltec Wi-Fi LoRa 32, using the Arduino IDE, and then we’ll present a practical example to perform a digital reading and digital performance.

Step 2: What Exactly Is the Heltec Wi-Fi LoRa 32?

It is a development board that integrates a SoC ESP32-D0WDQ6.

It has a W25Q32FV Serial Flash Memory (SPI / QPI) chip with approximately 32 megabits (4 megabytes) of storage.

A SX1278 LoRa chip is controlled by ESP32.

The USB-Serial interface uses a CP2102 from Silicon Labs.

In addition to an MCP73831 / 2, it comes with a Lithium Ion (Li-Ion) or Lithium Polymer (Li-Po) battery charge controller.

And it features a regulator AP2112-3.3 to provide 3.3V and a minimum of 600mA.

The board has two crystals, one from 26MHz to the ESP32, and another from 32MHz to the SX1278.

It has a 0.96 OLED display, also controlled by the ESP32.

Step 3: Wiring Diagram of the Heltec Wi-Fi LoRa 32

This same wiring diagram serves both the Heltec chip and the TTGO.

Step 4: Pinout of Heltec Wi-Fi LoRa 32 Card

I point out that if you take the traditional ESP32, unlike this image, it will not have the display and the SX1278, which is the Semtech chip.

Step 6: Circuit

In this circuit, we will detect the push of a button through the GPIO34 (pin 34 of the board), and we will drive the relays of the module through the GPIO22 and 23 (pins 22 and 23), respectively.

Step 7: Plate Installation

To install the board, we can follow the instructions of the Heltec itself in its GIT.

Step 8: Source Code

When you’re referring to the ESP32 pin, what matters is the GPIO. In this step, therefore, we point out that the pin that is connected to the button, as well as the ones that are connected in the relay module. We also have the variable to store the state of the second relay.

//Pino ligado no botãoint btn1 = 34; //Pinos que são ligados no módulo de relés int rele1 = 22; int rele2 = 23; //variável para guardar o estado do segundo relé boolean rele2_Ativo = false;

carte, shield, batterie, 18650, battery, esp32

The setup function must be run once before the loop. We set the pins of the buttons as input, relays as output, and we open the serial port, setting the data rate to 9600 bps.

//A função setup é executada uma vez antes do loopvoid setup //Seta OS pinos dos botões como entrada pinMode(btn1, INPUT); //Seta OS pinos dos relés como saída pinMode(rele1, OUTPUT); pinMode(rele2, OUTPUT); //Abre a porta serial, definindo a taxa de dados para 9600 bps Serial.begin(9600);

As for the loop function, it executes after setup and is repeated continuously. Check if the button was pressed and, if so, we will print this status on the screen. We then turn on relay 1, invert the state of variable relay2_Active, and then we change the state of relay 2. We wait for 1 second and turn off relay 1.

//A função loop é executada após o setup e é repetida continuamentevoid loop if (digitalRead(btn1) HIGH) //Caso o botão 1 foi pressionado //Exibe no monitor serial a mensagem entre aspas Serial.println(Botão pressionado); //Ligamos o relé 1 digitalWrite(rele1, HIGH); //Invertemos o estado da variável rele2_Ativo rele2_Ativo = !rele2_Ativo; //Mudamos o estado do relé 2 digitalWrite(rele2, rele2_Ativo ); //Aguardamos 1 segundo (1000 ms) delay(1000); //Desligamos o relé 1 digitalWrite(rele1, LOW);

Step 9: Doing the UpLoad of Code

With the IDE open, open the file with the source code by double-clicking the.ino file or through the File menu.

With Heltec connected to USB, select the menu Tools = Card: Heltec_WIFI_LoRa_32

Still in the Tools menu, select the COM port on which the Heltec is connected.

And wait for the conclusion:

Step 10: Verifying Execution

After recording, we check the execution, click the button to open the Serial Monitor, and then we set the baud rate to 9600.

Press the button, in addition to activating the relays. The following message should appear on the Serial Monitor.

Be the First to Share

Did you make this project? Share it with us!

Colors of the Rainbow Contest

Magnets Contest

Комментарии и мнения владельцев

Hi, FernandoIs it possible to work simultaneously Wi-Fi and LoRa on HELTEC esp32 LoRa?The idea is to receive data from the weather station via LoRa and load it into a My WEB-page via Wi-Fi ?!Thanks in advance!

He says at the top of this article that it can support Bluetooth, Wi-Fi, and LoRa at the same time. But he doesn’t seem to be responding here, and I’m looking for the same thing. Would love to know if you found the answer.

Hi,I haven’t found it yet, but that’s on the back burner for now!

HelloI am very interested but my first tests showed me that I could not go down less than 10mA in deep-sleep, do you have this type of problem please?

Is there a better resolution photo of the Charging circuit.- wonder what the supply voltage limits are? Can I use a 9V Alkaline battery? Does the charge circuit accept a 3.4-3.7 V Lithium single cell? Can I use a 3.6 V Lithium Primary cell that only has a maximum discharge of 0.020 Amps?

1) All of the schematics and files are in Github in the link above2) To use a 9V battery you will need to regulate it down to 5V. Although the on board regulator TP4054 can handle 9V, the CP2102 is connected to the 5V bus and will be fried with a direct 9V connection.3) The charging circuit will work with any standard 3.7V lithium battery.4) No, the board needs up to 130 mA while transmitting. That puny 20 mA battery will not work.

Powering Any WS2812b Setup

While one strip is great there are all sorts of awesome projects that call for special LED sizes and configurations. This guide will go over the different types of WS21812b strips, how to figure out how much power you need, and to connect more than one. If you missed it and want to learn more about how these type of LED strips work, check out our main guide here. Learn To Program Custom LED Lights


The type of strip we want are WS2812b. They typically com in IP64, IP65, and IP67. IP64 strips have the least protection from the environment but are the easiest to cut into smaller pieces. They also come with a sticky back that can be used to mount them to all type of surfaces. The IP65 strips also come with a sticky back and have a silicon covering the makes slightly more difficult to solder. The IP67 type are fully enclosed in a silicon casing and have no sticky back.

They also come in different led densities. The main configurations are 30 leds/m 60leds/m and 144led/m. In my experience 30 leds/m is plenty dense as each led can get extremely bright. This gives you the maximum length per cost as well easiest to satisfy power consumption.

Practically all WS2812b LED strips can be cut into multiple smaller strips. Each of the copper pads can be cut in half and used to connect sections together. Wires can be soldered to each end. Just be sure to connect the GND GND, VCC VCC, and DIN DOUT. Here’s a grid of lights we made out of sections of an IP64, 60 led/m strip.


Since everything we’re using runs on 5 volts, we can use the terms power and current interchangeably. The amount of current (amps) that each LED consumes depends on their color and brightness. If only one of the three red, green, or blue LEDs are on, it will use less power. If the pixel is set to white (all three LEDs on) it will use the maximum amount of power.

The defacto advice on the internet is to make the assumption that each of the RGB lights will use at maximum 20mA (the actual value is slightly lower). This give us 20mA 20mA 20mA = 60mA per pixel. Therefore for an entire 150 pixel LED strip we would be using a maximum of 9A of power. This is why we picked a 10 amp power supply for the primary guide where we use a 150 pixel strip.

However while this is a safe approximation, we would only use the full 9A when we have all the LEDs set white at max brightness. If we’re a little clever about how we program our LEDs, we can get away with connecting many more LEDs with a less powerful supply.

As you’ll see, these LEDs are BRIGHT! Setting them to max 255 brightness can make them downright hard to look at without any diffusion. Additionally, when thinking about the power requirement we only have to consider the worst case scenario. This means if we are willing to sacrifice some brightness, we can safely connect more LEDs per amp of current.

The graph below shows the power consumed per pixel (white, RGB all on) at different brightness levels. Rather than just assuming the default 60mA per pixel, we can more accurately match our LEDs and power supply. For example if we have a 5 amp power supply and want to hookup 150 LEDs, that gives us a power budget of 33.3mA per pixel (5000mA / 150). Accord to our graph we can safely run all 150 LEDs as long we don’t set any brightness values over ~170.

The supply we need must be 5 volts, however the shape and amperage they provide can vary greatly. Wall warts (typically 0.5-2 amp) and power brick (typically 1-10 amp) supplies usually come with barrel jack connectors. For large amounts of current they make supplies with their own metal enclosure (typically 1-60 amps). They will require wires directly from a wall plug and provide multiple sets of 5 volt connections.

As a word of warning, it is important to use a quality 5 volt power supply. Many power bricks, especially those that advertise over 5 amps, use cheaper components and cannot actually maintain that level of current. Even on a quality supply I’d recommend giving around 20-30% of headroom to be safe. Trying to pull large amounts of current can cause the voltage to sag, reducing the brightness of your LEDs, or worse damaging them or your power supply.

For those less familiar with the electrical terminology, the voltage can be thought of as water pressure and current as water flow. If we try and turn up the water flow (current) higher then the supply can handle, the water pressure (voltage) will go down. If the LEDs are taking a shower in this analogy, low water pressure is no good.

Every strip has little wires embedded into them to connect one LED to the next. These act like pipes carrying the water (current) through the strip. If we try and set all of the LEDs to max white brightness, it draws too much water (current) for these little pipes to carry. By the time we get to the end of a long strip the voltage has sagged and the brightness and color quality of the LEDs has deteriorated. To fix this we just need to apply the power and ground to both sides of the strip. Many strips even have an extra pair for 5V and GND wires at each end specifically for “injecting” more power.

Similar to reducing brightness, we can also reduce power but turning off all of either the red, green, or blue LEDs in the strip. If we use a combination of two of the three LEDs on each pixel we can reduce the power to two thirds the normal consumption. If we only program our LEDs to be exactly red, green, or blue, we can cut the power consumption down to one third since two of the three LEDs are off. For example, if we know we only want to use yellow (red green) and purple (red blue), at max brightness of 100, the worst case would be 12.5mA per pixel. A brightness of 100 uses about 19mA from the graph, times 2/3 since we know we’ll only be using two of the three colors at a time, give us 12.5mA per pixel.

Depending on how harsh of constraints you impose on yourself, the amount of power you need for each pixel can be greatly reduced. If you know exactly what maximum brightness and colors you need, you can calculate the specific worst case power requirement. Although, it is typically a good idea to give yourself as much flexibility as possible to create a wider variety of animations and colors.


If we only need to power a couple LEDs we can actually get away with using only the Arduino. The USB plugged into our computer can provide 500mA of power. I wouldn’t recommend using much more than 350mA. Accidentally pulling too much power could damage your Arduino or worse your computer. However 350mA is enough to safely power 6 LEDs or more depending if you use the techniques described above.

To power additional LEDs we will need an external power source. For experimentation and programming it will be useful to have our Arduino pulled into the computer. In this case the ground from the power supply should be pulled into the Arduino but NOT the 5 volt wire. The USB will provide the 5 volts power that the Arduino needs.

Once we have the Arduino programmed to our liking. It may be preferential to remove the USB-computer connection. After disconnecting, the whole system can be powered from our 5 volt power supply.

Perhaps you want to use more than one LED strips. For the most part you can just connect the end of one to the start of the next. If you have two, 150 LED strips connected to each other, just define one strip in your controller as 300 LEDs long. Similar to before when we set an entire strip to max brightness, connect so many LEDs in a row will require power to be injected in the middle and/or at the end.

You can even have as many different 5 volt power supplies as you want/need. Just be sure to only connect only their grounds together. The different 5V lines from separate power supplies should not be connected.

The strips can also be connected individually to your controller (in parallel). In this case each strip can be defined as its own set of LEDs in the controller. Each strip gets its own name and data pin.

Lastly for large setups it is important to keep in mind how many LEDs different types of controller can handle. Since each pixel’s color values get store in the controller memory we need enough bits for our strips. An Arduino Uno can handle up to ~600 pixels while an Arduino Mega can handle up to ~2400. There are many other controllers that can operate these LED strips that we may cover in a future guide.

With that, hopefully the setup and powering of these incredibly versatile strips is more clear. For more info check out our main LED guide here. Learn to Program Custom LED Lights

Leave a Comment