Monday, 31 December 2018
Friday, 28 December 2018
Electronics of the future: A new energy-efficient mechanism using the Rashba effect
Thursday, 27 December 2018
Discovery of topological LC circuits transporting EM waves without backscattering
Sunday, 23 December 2018
Development of MEMS sensor chip equipped with ultra-high quality diamond cantilevers
Friday, 21 December 2018
Looking at molecules from two sides with table-top femtosecond soft-X-rays
Thursday, 20 December 2018
Study on low noise, high-performance transistors may bring innovations in electronics
Scientists use magnetic defects to achieve electromagnetic wave breakthrough
Update: It moves! [VIDEO]
This weekend I went to a Colombian wedding.
And Jefferson went to Barranquilla.
So we decided to cancel this week’s Club de Arduino meeting.
Club de Arduino is a club we started in Medellin, Colombia for beginners or advanced people who want to meet up and build projects together.
I thought I’d share the latest development of the robot.
We can now control the robot with a cell phone:
Next, we need to add in some intelligence and make it do stuff on its own.
Christmas is coming up, so it’s gonna be really hard to get the full group to gather in the following weekends.
But we’ll try!
I’ve recorded a lot of video from Colombia.
And I’m in the process of making a vlog-episode very soon, sharing some of the things I’ve experienced so far on this trip.
Do you think it looks fun to build a robot?
It is.
And you can do it too, even if you’re starting from scratch.
Sign up for Ohmify, and you’ll get step-by-step instructions on how to build a simple robot…
…along with lots of other courses to learn electronics from scratch.
I have a special offer on now – a Christmas bundle – packed full of content to help you learn electronics fast.
Check out the details here:
https://ohmify.com/xmas-bundle/
Keep On Soldering!
Oyvind @ build-electronic-circuits.com
Copyright Build Electronic Circuits
Wednesday, 19 December 2018
Holey graphene as Holy Grail alternative to silicon chips
Tuesday, 18 December 2018
Assessing the promise of gallium oxide as an ultrawide bandgap semiconductor
Technique allows integration of single-crystal hybrid perovskites into electronics
Monday, 17 December 2018
A box of components for Christmas?
Christmas will be different this year.
I’m in Colombia with my wife.
Together with a local group, we’re building an Arduino robot.
It’s warm.
And there’s no snow.
Although I miss the Norwegian Christmas with lots of snow, I’m enjoying the Colombian Christmas very much.
But sometimes I like to think back on good memories from my Norway Christmases.
Like the time I got components for Christmas.
I still remember the excitement.
Under the Christmas tree at my parents’ house, I found three boxes with my name on them.
As I opened them, I got more and more excited.
One contained resistors.
One contained ceramic capacitors.
And one contained electrolytic capacitors.
I absolutely loved it!
But, I guess a box of resistors and capacitors isn’t everyone’s cup of tea…
So what else can you give to an electronics interested son, daughter, parent or grandparent for Christmas?
How about a gift card to learn electronics?
What about a starter’s component kit?
I’ve created a Christmas bundle that I think every electronics-interested kid, adult or grandparent would love:
It includes:
* one year of electronics courses online at Ohmify
* two ebooks to build and learn electronics
* a beginner’s component kit sent to his/her house
To give the gift of learning, choose the “Give As Gift” option below:
https://ohmify.com/xmas-bundle/
Keep On Soldering!
Oyvind @ build-electronic-circuits.com
Copyright Build Electronic Circuits
My death jump game
A great way to learn, especially if you don’t have a lot of time to learn all the basics, is to modify things.
That’s how I learned to program by myself as a teenager.
For example:
I found code examples to show an image on the screen.
I tried modifying the numbers in the code, and the image appeared at a different position.
“Aha!”, I thought to myself.
I replaced the image with an image I drew myself of a man on skis.
And I repeated the code several times, just changing the position of the image.
Suddenly I had a man on skis, moving around on the screen.
Next, I found code examples for receiving input from the keyboard.
And little by little, I developed a ski jumping game.
To add suspension I called it “Death Jump”.
I loved the ego-boost I got when seeing the faces of my friends while showing off my game to them.
They were really impressed.
Now, 2019 is right around the corner.
Have you given any thought to what you’d like for your life in 2019?
Maybe it’s time to get started on some of those resolutions that will actually benefit you.
Like finally learning to build those Christmas lights you’ve always wanted to build.
Or that automatic cat feeder project.
Or maybe you have a business idea and you need to create a prototype before you can go further with the project.
If you join Ohmify, you’ll get the chance to build those projects.
You can go through the basics, step-by-step, or you can jump right into building circuits.
Because you’ll also get practical instruction that you can use straight away.
As in, within minutes.
Is your project a bit outside of the topic of the courses – well, then I’m there to help with any questions you might have.
Learn more about Ohmify and the bundle that is available until Christmas:
https://ohmify.com/join/
Keep On Soldering!
Oyvind @ build-electronic-circuits.com
Copyright Build Electronic Circuits
Pressure tuned magnetism paves the way for novel electronic devices
Microtube with built-in pump
Thursday, 13 December 2018
Computer chip vulnerabilities discovered
Data use draining your battery? Tiny device to speed up memory while also saving power
High-efficiency discovery drives low-power computing
Monday, 10 December 2018
Shape-shifting origami could help antenna systems adapt on the fly
Topological material switched off and on for the first time
Topological matters: Toward a new kind of transistor
Nanoglue can make composites several times tougher during dynamic loading
Saturday, 8 December 2018
Engineers invent groundbreaking spin-based memory device
That’s what I call Christmas lights
Christmas is definitely coming up.
And the Christmas lighting here in Medellin is just unbelievable.
Here’s a peek:
Do you have any plans for building Christmas lights this year?
Why not set aside an hour or two to build a blinking Christmas lights circuit?
The circuit is easy to build and it’s something you can put to use right away.
I built this when my wife (then girlfriend) and I were living in a basement in Australia.
And she loved it!
The blinking part of the circuit is made up of only 4 components.
And you can add as many lights as you want:
I’ve decided to repeat the Christmas Bundle from last year.
The ultimate package for learning electronics.
Sign up for the ohmify yearly plan and get two ebooks and a beginner’s component kit as a bonus.
It’s also possible to buy it as a gift to someone else – just choose the gift card option:
https://ohmify.com/xmas-bundle/
It will be available until Christmas.
Keep On Soldering!
Oyvind @ build-electronic-circuits.com
Copyright Build Electronic Circuits
Friday, 7 December 2018
A new 'spin' on kagome lattices
3D-printed glucose biosensors
New traffic rules in 'Graphene City'
Thursday, 6 December 2018
High-temperature electronics? That's hot
Wednesday, 5 December 2018
Reflecting antiferromagnetic arrangements
Using graphene to detect ALS, other neurodegenerative diseases
What is an H-Bridge?
An H-bridge is a simple circuit that lets you control a DC motor to go backward or forward.
You normally use it with a microcontroller, such as an Arduino, to control motors.
When you can control two motors to go either forward or backward – you can build yourself a robot!
H-Bridge concept
Here’s the concept of the H-bridge:
A DC motor spins either backward or forward, depending on how you connect the plus and the minus.
If you close switch 1 and 4, you have plus connected to the left side of the motor and minus to the other side. And the motor will start spinning in one direction.
If you instead close switch 2 and 3, you have plus connected to the right side and minus to the left side. And the motor spins in the opposite direction.
The H-Bridge circuit
You can build an H-bridge with four transistors.
If you’re not sure how the transistor works, I recommend you read the article How Transistors Work first. From there you’ll learn that the transistor can work as a switch that you can open and close with the voltage on the base.
Since the transistor can be a switch, you’ll be able to make the motor spin in either direction by turning on and off the four transistors in the circuit above.
Usually, you control the transistors from a microcontroller, such as Arduino.
What Transistors To Use?
The transistors you choose must:
- Handle enough current
- Use PNP (or pmos) at the top
- Have a low voltage drop between collector and emitter
Current
The most important thing is that all the transistors can handle enough current for the motor. Otherwise it will burn out.
For example, if the motor draws 1 Ampere of current, you need transistors that can handle a minimum of 1 Ampere.
PNP (or pmos) transistors at the top
Next, you see I have chosen PNP transistors on the top, and NPN transistors on the bottom.
What turns the transistor on or off is the voltage difference between the base and the emitter.
With PNP transistors at the top, you can use a higher voltage for VCC than you use for the base of the transistors.
For example, you can use 3.3V outputs from a microcontroller and 9V for Vcc.
That won’t work if you have NPNs at the top since the emitter will be 0.7V lower than the base. Because that turns into 3.3V – 0.7V = 2.6V at the positive side of the motor, no matter what VCC voltage you choose.
Low voltage drop between collector and emitter
While building a robot in Colombia, I tried to make this circuit using TIP120 and TIP127 transistors.
That did not work.
TIP12x transistors give a 2V drop from the emitter to collector.
In such a configuration, you’d end up with a loss of 4V over the transistors. I was trying to connect this to an Arduino, using its 5V supply, but failed because it was only 1V left for the motor!
Here’s a nice article/rant about the topic: Stop using antique parts!
Basically, it says that the TIP transistors are antiques that you shouldn’t use anymore exactly because of this huge voltage drop.
Choose transistors with low voltage drop. For example BD135/BD136 or MOSFET transistors.
Protection diodes and PWM mode
A side-effect of how a motor works is that the motor will also generate electrical energy. When you disable the transistors to stop running the motor, this energy needs to be released on some way.
If you add diodes in the reverse direction for the transistors, you give a path for the current to take to release this energy. Without them, you risk that the voltage rises and damages your transistors.
You can read more about this – and what to keep in mind if you want to use a PWM signal to control the speed of the motor, this article.
The resistors going into each base is there to reduce the current to each transistor. Not sure how to calculate it? If you’re using a microcontroller to control them, start with 1k and adjust if that doesn’t work.
Questions or comments?
Have you built an H-bridge before? Or do you have questions about the H-bridge? Let me know in the comments field below:
Copyright Build Electronic Circuits
Club de Arduino – Week 3: H-bridge and the Bluetooth
We made progress on our robot this week! Check out the video at the end of this post.
This is what happened:
During this week I figured out that our H-bridge design did not work as intended.
The problem was the TIP12x transistors. They have a huge voltage drop from collector to emitter of 2V. With two of them in the H-bridge design, there was only 1V left for the motor.
I thought the problem was the design. That we needed to increase the current or something to reduce the voltage, but I was unable to do it.
I did some Googling around and came across this article/rant: Stop using antique parts!
Basically, it says that the TIP transistors are antiques that you shouldn’t use anymore exactly because of this huge voltage drop.
I started looking for other transistors, but then I came across this H-bridge module. I discussed it with Eduardo and we decided to buy it instead of using another week attempting to build one.
After all – we’re in week 3 and we don’t have a lot of time.
I bought a couple of samples, tested them, and they worked perfectly.
When we met up again on Saturday, we were ready to move on.
We connected the H-bridge module and created test-code for Arduino. We had some problems at first, but it turned out we had a few defective breadboard wires.
We replaced the wires and the motors moved, just like we wanted to!
Testing Bluetooth communication
Next up was the Bluetooth.
We created a simple mobile app with four buttons using MIT App Inventor. The app connects to the Bluetooth module and sends a letter to it, depending on which button was clicked:
Click to download our App Inventor file
Below is the Arduino code we used to test the Bluetooth communication.
It just waits for something to arrive on the Serial port. When one of the following characters arrives, it turns one motor on in one direction: “A”, “B”, “C” or “D”.
#define A_IA 5 #define A_IB 6 #define B_IA 9 #define B_IB 10 char valor; void setup() { // Setup serial communication Serial.begin(9600); // Set as output pins pinMode(A_IA, OUTPUT); pinMode(A_IB, OUTPUT); pinMode(B_IA, OUTPUT); pinMode(B_IB, OUTPUT); // Stop all motors digitalWrite(A_IA, HIGH); digitalWrite(A_IB, HIGH); digitalWrite(B_IA, HIGH); digitalWrite(B_IB, HIGH); delay(500); } void loop() { // Check if something is available on the serial port if (Serial.available()){ //Read data from the Bluetooth module valor = Serial.read(); // Motor A forward if (valor == 'A'){ digitalWrite(A_IA, LOW); digitalWrite(A_IB, HIGH); digitalWrite(B_IA, HIGH); digitalWrite(B_IB, HIGH); } // Motor A backward if (valor == 'B'){ digitalWrite(A_IA, HIGH); digitalWrite(A_IB, LOW); digitalWrite(B_IA, HIGH); digitalWrite(B_IB, HIGH); } // Motor B forward if (valor == 'C'){ digitalWrite(A_IA, HIGH); digitalWrite(A_IB, HIGH); digitalWrite(B_IA, LOW); digitalWrite(B_IB, HIGH); } // Motor B backward if (valor == 'D'){ digitalWrite(A_IA, HIGH); digitalWrite(A_IB, HIGH); digitalWrite(B_IA, HIGH); digitalWrite(B_IB, LOW); } } }
Testing the robot
Check out the video below for our first test of the robot, using the app to control it. Unfortunately, we forgot to add a stop button!
What’s next?
The robot moves! That’s a great step forward.
Next week we’ll continue to develop the code for the robot to move properly. (Right now it just spins.)
Go back to the overview of Club de Arduino
Copyright Build Electronic Circuits
First observation of a square lattice of merons and antimerons
Science: High pressure orders electrons
Monday, 3 December 2018
Club de Arduino – Week 2: Building an H-Bridge
Today we tried to build an H-bridge to control the motors.
An H-bridge is a circuit that makes it easy to control a motor to go backward or forward, for example from an Arduino.
We used TIP120 and TIP127 transistors and built the following circuit using 5V as VCC:
It did not work.
We are not sure if there was a problem with the connections – or if the circuit design itself as the problem.
What’s next?
Until next time, I will check the connections of the circuit and do some measurements. Eduardo will look at simulations to see if he can find any problems with the circuit there.
We’ll meet up in one week to continue building the robot.
Go back to the overview of Club de Arduino
Copyright Build Electronic Circuits
Club de Arduino – Week 1: Initial meeting and planning
We started out as a group of three people.
Eduardo, Jefferson, and me.
Today, we discussed what to build.
We wanted to build something that would be fun, and that we could finish within the time frame I’m going to stay here (~2 months).
And it should be based on an Arduino.
Jefferson wanted to build a CNC mill.
But such a machine is a bit complex, so we decided to discard that for now.
Then Eduardo suggested building a sumo robot.
We watched some videos on YouTube and got really excited.
A sumo robot it is!
What we decided to get
-An Arduino (https://amzn.to/2zEpJGK)
-A platform with wheels and two motors, to make it possible to turn (https://amzn.to/2PbQpDX)
-An ultrasonic sensor (https://amzn.to/2Q6YmPY)
-A Bluetooth module for communicating with a mobile phone (https://amzn.to/2DWvnXX)
-8 TIP120 transistors to make an H-bridge for each motor (these were discarded later…)
What’s next?
Until next time, we will buy the components needed.
Go back to the overview of Club de Arduino
Copyright Build Electronic Circuits
How to build a robot – Club de Arduino
It was sunny and hot.
I was wearing a backpack and I could feel the sweat building up on my back.
But I had to walk fast.
Because I was late.
And because the locals had told me to be careful in the center.
I had emailed with Thomas, the founder of the makerspace Göra, before coming here.
We had discussed electronics workshops but decided that it would be better to meet in person to figure out the details.
I did not know what to expect.
Across the street, I saw it.
The Göra sign that I had seen in the street view of Google maps.
I met with Thomas and some of the other members.
And I got the grand tour.
I especially liked the machine for printing your own t-shirt design.
But they didn’t have much of an electronics section.
Thomas told me that at the moment, they didn’t have a big group of electronics people.
Instead, he asked me if I wanted to help out with an Arduino club.
To help start attracting more electronics people.
I accepted.
And that’s how I became a part of Club de Arduino in Medellin.
Every week, I’ll be sharing my notes from the previous week.
Check out the notes released so far:
- Week 1 – Initial meeting and planning
- Week 2 – Building an H-bridge
- Week 3 – Connecting the H-bridge and the Bluetooth
- Week 4 –
- Week 5 –
- …
Copyright Build Electronic Circuits
Borophene advances as 2D materials platform
Colloidal quantum dots make LEDs shine bright in the infrared
Robots in the rain
It’s raining a lot these days.
So, it’s nice to be inside building robots!
These last days I’ve been tinkering with an H-bridge, which is a part for a robot we’re building.
I’m in Medellin and as a part of “Club de Arduino” at Göra Makerspace we’re building a sumo robot.
A sumo robot is a fighter robot.
It is built to try and push another robot out of a ring:
The H-bridge is a circuit to control a motor to go forward or backward.
And it makes it easy to use from a microcontroller such as an Arduino.
I’m writing an article on how to build one as we speak – that I hope should be out within a few days.
Ultimately, this NEEDS to become a new Ohmify course.
I’ll keep you updated as we go along.
Not sure what Ohmify is? Learn more here:
Keep On Soldering!
Oyvind @ build-electronic-circuits.com
Copyright Build Electronic Circuits
Graphene unlocks new potential for 'smart textiles'
Saturday, 1 December 2018
DFRobot FireBeetle ESP8266 Review
In this project, I will review the DFRobot FireBeetle ESP8266 IoT Module and see how to set it up in order to use it in our IoT Projects. In the process, I will demonstrate a simple hook-up guide using the Arduino IDE.
Unboxing DFRduino and DFRobot FireBeetle ESP8266
I have received two modules from DFRobot: one is the DFRduino UNO R3 and the other is the DFRobot FireBeetle ESP8266 IoT Module. The package is neatly packed with two boxes and also stuffed with packing foam.
DFRduino UNO
First, let me unpack and give a brief overview on the DFRduino UNO board and later, I will unpack the DFRobot FireBeetle ESP8266 IoT Board and review it thoroughly.
The first box consists of the DFRduino UNO Rev 3, which is an Arduino UNO Compatible board from DFRobot. It is packed in an anti-static bag and once you cut open the bag, you can see the DFRduino UNO in its black PCB.
The DFRduino UNO has all the features of a regular Arduino UNO i.e. a DIP ATmega329p, headers for Digital I/O, Power, Analog IN, USB-to-Serial, 16MHz Crystal etc.
If you notice the DFRduino UNO board, the female headers are color coded, which is kind of a cool and unique feature.
- Green: Digital I/O Headers
- Blue: Analog IN Headers
- Red: Power Headers
DFRobot FireBeetle ESP8266
Let me now proceed with unpacking the item of interest, the DFRobot FireBeetle ESP8266 IoT Module. Like DFRduino UNO, it is also packed in an anti-static bag but you get a second bag with a bunch of male and female headers.
Opening the package, you get the DFRobot FireBeetle ESP8266, which is a Arduino Nano sized black PCB with gold colored antenna trace and header mounting holes. Also, in the other pack, you get 18 pin Female and Male Headers (couple of each).
As the pins of the board are not soldered with any headers, you can solder yourself either male or female header as per your needs. Unless you are using the GPIO’s or the other peripherals, there is no need for any soldering tasks as you can plug-in the MicroUSB cable and start using it.
Apart from the regular ESP8266 related stuff, you get an additional hardware for charging Li-Ion Batteries. I will show all the components on the DFRobot FireBeetle ESP8266 board a little later.
Overview of DFRobot FireBeetle ESP8266 IoT Board
The DFRobot’s FireBeetle is a series of low-power development board aimed for Internet of Things (IoT) implementation. DFRobot FireBeetle series has mainly two boards: one is based on the ESP8266 and the other is based on ESP32.
DFRobot FireBeetle ESP8266, as the name suggests, is an ESP8266 based IoT development board based on the ESP8266EX SoC from Espressif Semiconductors.
If you are following ElectronicsHub for some time, you might have come across my implementation of IoT projects using ESP866 ESP-01 Module. Even though the ESP-01 Module is also based on the same ESP8266EX SoC, the main disadvantage is its lack of sufficient I/O and various protocols.
The DFRobot FireBeetle ESP8266 Module succeeds in this aspect by including the regular WiFi Connectivity, TCP/IP Stack, UART along with numerous GPIO Pins, ADC, SPI, PWM, I2C and even I2S.
NOTE: The above picture says 16MB of Flash but it is actually 16Mb.
Another important feature is it has 16Mb of External Flash interfaced through SPI. This is in contrast to 8Mb Flash on my ESP-01 Module.
The USB-to-Serial Conversion is taken care by the CH340 IC, which can also be found in various Arduino clones as well. Also, the FireBeetle ESP8266 features auto reset. This means that you don’t have to around the Reset and the GPIO0 pins (as those two pins are responsible for enabling flash mode or normal mode).
All this stuff i.e. GPIO Pins, Flash, Interfaces etc. is directly associated with ESP8266. But there is one other important feature that is included in the DFRobot FireBeetle ESP8266 Module. The feature is a dedicated IC for charging Li-Ion Batteries.
The famous Li-Ion Battery Charger IC TP4056 is integrated on the board with dedicated connector for the Battery. The maximum charging current that is supported by this board is 500mA (although the TP4056 is capable of handling charging current up to 1A).
A dedicated charging LED is provided on the board. If the battery connector terminals are open i.e. when no battery is connected, the LED blinks. It becomes stable when the board is charging a battery and turns off when the battery is fully charged.
Coming to the software part of the module, it is compatible with Arduino Programming environment (Arduino IDE) and hence, programming the DFRobot FireBeetle ESP8266 Module will not be an issue.
Additionally, the DFRobot FireBeetle ESP8266 Module also supports MicroPython, and RTOS SDK as well (if you are interested).
Features and Pin Description of DFRobot FireBeetle ESP8266
Features
I have already discussed some of the features of the DFRobot FireBeetle ESP8266 Module but here is a list of all the features as specified by the manufacturer (DFRobot).
- Based on ESP8266EX (which is based on Tensilica L106 MCU)
- Supports Arduino IDE, MicroPython and RTOS SDK in Linux
- Has integrated WiFi (IEEE802.11b/g/n @2.4GHz) and TCP/IP Stack
- Hardware support for charging Li-Ion Battery (with max current of 500mA)
- Includes 11 Digital IO, 1 Analog IN, SPI, I2C and I2S
Pin Description of DFRobot FireBeetle ESP8266 Module
The following image gives a general idea on the pin description of the DFRobot FireBeetle ESP8266 Module. The module has 36 Pins (18 on the either side) out of which most of the pins are NC.
Now that we have seen the features and pin description, let me proceed with hooking up the board with the computer and programming it. In the process, I will also show you how to setup the Arduino IDE for the DFRobot FireBeetle ESP8266 Module. So, lets get started with that.
Setting Up the Arduino IDE
Before setting up the Arduino IDE, first, connect the FireBeetle ESP8266 to the computer with the help of a USB to MicroUSB Cable. Assuming you are using a Windows Computer, it should automatically detect the device and download the necessary CH340 Drivers from the internet, which happened in my case.
If your computer, for any reason, doesn’t detect the device and automatically install the drivers, then you can manually install by downloading the driver from this link.
Let us now proceed with setting up the Arduino IDE. In that, the first step is to install the FireBeetle Board through the board manager. So, first, copy the following link and place it in the “Additional Boards Manager URLs” in preferences (File -> Preferences).
NOTE: If you already have an URL in that field, you can add extra URLs by separating them with comma. In my case, I already have ESP8266 related Link.
Now go to Tools -> Board -> Boards Manager.. and search for “FireBeetle”. You can see the “FireBeetle-ESP8266 by DFRobot” option. Click on install.
After the Boards Manager installs the FireBeetle, you need to select it by once again going to Tools -> Board -> FireBeetle-ESP8266 (from the bottom of the list).
You can also select the appropriate COM Port number below the Board option and leave the rest of the settings as it is.
Uploading Code to DFRobot FireBeetle ESP8266 Module
Now that you have set the Arduino IDE for programming DFRobot FireBeetle ESP8266 Module, let us upload two sample codes for testing out whether the board is functional or not.
Blink Code
The first code is a simple Blink Sketch, where the LED connected to GPIO Pin 2 of the FireBeetle ESP8266 Module will start to blink.
WiFi Scan Code
The second code is for scanning the available WiFi Networks in range and displaying a list in the serial monitor of the Arduino IDE.
Conclusion
In this project, I have started working on the DFRobot FireBeetle ESP8266 Module after unboxing, setting up the programming environment and uploading some sample codes.
Few points to note about the DFRobot FireBeetle ESP8266 Module:
- The module has on-board USB-to-Serial Converter, MicroUSB Port and voltage regulator. This is important for me because of my experience with ESP8266 ESP-01 module, where I had to design a perf board to insert the module and add level converter for RX and TX (UART) pins.
- Also, the module comes with 16Mb of flash, which means you can program it with RTOS SDK.
- The on-board Li-Ion Battery Charger is an additional feature (which I may end up not using it).
- As of now, I’m not sure about the firmware aspects of the Module i.e. the version, how to update (although the DFRobot page says the module supports OTA Updates) and how to communicate through AT Commands.
- I will try to update on the AT Commands aspect as they are important (at least for me).
The post DFRobot FireBeetle ESP8266 Review appeared first on Electronics Hub.
How to Send an Email using ESP8266 WiFi Module?
In this project, I will show you how to Send an Email using ESP8266. For this project, I will be using the DFRobot FireBeetle ESP8266 IoT Board. Sending an e-mail with the help of the ESP8266 Module will be a step forward in the IoT Implementation.
Introduction
With Internet of Things (IoT) expanding, the scope of the IoT applications is growing from controlling appliances to monitoring devices (like sensors) and sending e-mails.
By sending e-mails from you ESP8266 Module, you can know the status of any sensor you are monitoring or you can receive an emergency e-mail in case of burglary or an intruder alert.
So, without further delay, let me show you all the steps required to Send an Email using ESP8266 WiFi Module.
ESP8266 Board
As said earlier, I will be using the DFRobot FireBeetle ESP8266 board in this project to send e-mails. You can use any ESP8266 Module and I have tested this procedure with my ESP-01 ESP8266 Board and it worked just fine.
Since the DFRobot FireBeetle ESP8266 board has all the required components like the MicroUSB Port, 3.3V Regulator, etc. I don’t need to make any extra connections with respect to the board.
All I need to do is to plug-in a MicroUSB cable in the port and connect it to a computer (with the drivers being already installed and Arduino IDE is already setup).
This is one of the main reasons for choosing the DFRobot FireBeetle ESP8266 board over my regular ESP-01 Module.
So, I suggest you to go through the hook-up guide of the DFRobot FireBeetle ESP8266 board as described in the following project: DFROBOT FIREBEETLE ESP8266 REVIEW AND HOOK-UP GUIDE.
SMTP Server Setup
In order to send e-mails from ESP8266 Module, you need to follow the SMTP protocol. Hence, an SMTP Server is required to send the e-mails and the ESP8266 will act as an SMTP Client.
I have tried the Gmail’s SMTP Settings several times to send email using ESP8266 but it was not fruitful. So, I have decided to use a third-party SMTP Server and I found “SMTP2GO” as a reliable choice.
So, go to the SMTP2GO website and register with a free account. After creating an account, the first step is to create the SMTP Username and SMTP Password. In fact, the moment you confirm your e-mail address and first login to SMTP2GO, this is the information that you’ll get.
Leave the username as it is i.e. the e-mail address and change the SMTP Password with your own choice. Note that this is SMTP Password and is different from the SMTP2GO Login Password.
Make a note of the two i.e. SMTP Username and SMTP Password.
Now, enter the dashboard of the SMTP2GO app and on the left access bar, click on “Settings” and then on “Users”.
In that, you can see the information regarding the SMTP Server and PORT number. It is usually as follows:
- SMTP Server: mail.smtp2go.com
- SMTP PORT: 2525
Note down this information as you need to use this data in the code.
Encoding Username and Password
You need to encode your SMTP Username and SMTP Password to Base64 format with ASCII Character Set. For this, you can either use an Arduino Library or a website called BASE64ENCODE.
Enter your SMTP Username and Password separately and note the encoded content. For example, if your email address is test@gmail.com, it would be encoded as dGVzdEBnbWFpbC5jb20=.
And if your password is “testpassword” (excluding the quotes), it would be encoded as dGVzdHBhc3N3b3Jk.
Code
Now, let me show you the necessary code in order to Send an Email using ESP8266.
In the code, make necessary changes like SSID, Password of your WiFi Connection, Sender and Receiver E-Mail Address, Base64 Encoded SMTP Username and SMTP Password.
Explanation of the Code
The initial section of the code is simple used to connect the ESP8266 WiFi Module to the Internet. If the connection is successful, you will get an IP Address.
Next is the actual code for sending the e-mail. The code can be divided into 8 stages.
Stage 1: In stage 1, you will be connecting to the SMTP Server on a PORT. This is done using the command client.connect(SMTP_SERVER, SMTP_PORT). In response, you will get a 220 code.
Stage 2: Greet the SMTP Server with EHLO Command (Previously HELO Command). The command is client.println(“EHLO www.example.com”);
If the connection is successful, you will get a 250 Response Code.
Stage 3: Stage 3 is to authorize the user with AUTH LOGIN Command. The command is client.println(“AUTH LOGIN”);. You will get a Response 334 for success.
Stage 4: Send the encoded SMTP Username and Password one after the other. The commands are client.println(“Base64, ASCII encoded username”); and client.println(“Base64, ASCII encoded password”);.
If the authentication is success, you will get a 235 Response.
Stage 5: Now its time to send the mail from string where you have to enter the sender’s email address using the format MAIL FROM:<”+String(from)+’>’;.
The command is client.println(“MAIL From: sender@gmail.com”);
Stage 6: Then send the rcpt to string using the format RCPT TO:<”+String(to)+’>’;. The command is client.println(“RCPT To: receiver@gmail.com”);.
Stage 7: Send the “DATA” followed by the Message body of the e-mail. The commands are
client.println(“DATA”);
client.println(“To: receiver@gmail.com”);
client.println(“From: sender@gmail.com”);
client.println(“Subject: ESP8266 test e-mail\r\n”);
client.println(“This is is a test e-mail sent from ESP8266.\n”);
client.println(“Second line of the test e-mail.”);
stage 8: Finally, terminate the mail with “.” and send the quit command.
client.println(“.”);
client.println(“QUIT”);
All these commands and responses will be shown in the serial monitor of the Arduino IDE.
If you follow all the mentioned steps, you will be able send an email using ESP8266 successfully.
The post How to Send an Email using ESP8266 WiFi Module? appeared first on Electronics Hub.
Tiny, wireless antennas use light to monitor cellular communication
Researchers developed a biosensing technique that eliminates the need for wires. Instead, tiny, wireless antennas use light to detect minute...
-
In this project, we will learn about the MCP2515 CAN Controller Module, how to interface the MCP2515 CAN Bus Controller with Arduino and fin...
-
Interfacing DC motor to the microcontroller is a very important concept in many industrial and robotic applications. By interfacing DC motor...
-
Do you need a MOSFET gate resistor? What value should it be? And should it go before or after the pulldown resistor? If you’re a bit impati...