The smallest esp32 module (so far…)

Some months ago, Espressif announced the production of a new chip, named ESP32-PICO-D4.

esp-pico-001

It’s a complete SiP (System in Package), that is a chip which integrates the esp32 microcontroller, a 4Mbit flash memory, a crystal oscillator, filter capacitors and RF matching links. The chip datasheet is available on the official website.

Using this chip, it’s possible to create very small modules. I recently received one of those from Aliexpress:

esp-pico-002

esp-pico-003

To better understand how small it is, let’s compare its size with a “classic” ESP-WROOM-32 module and with a 1 euro coin:

esp-pico-004

The module includes a chip antenna; it’s also possible to connect an external antenna thanks to the presence of an I-PEX connector.

In conclusion, the availability of the ESP32-PICO-D4 SiP makes it possible to use the esp32 chip in applications where the available space is very small…

First look at JQ6500 modules

For some time, on different chinese webstores (for example Banggood) there is a module called JQ6500 for sale:

jq6500-001 jq6500-002

it’s often described as a voice sound module or as an MP3 player sound module.

Actually JQ6500 is the name of the main chip hosted on the module:

jq6500-003

The chip is manufactured by a Chinese company named JQ. A datasheet for the chip is also available, unfortunately only in Chinese (but Google Translate can help to understand what it contains).

On the other side of the PCB, the module houses two additional integrated circuits:

  • a 16Mbit flash memory (25L1606E)
  • a 3W audio amplifier (HXJ 8002)

When you connect the module to your computer via USB, it is detected as a CDROM drive. If you browse the content of the CD, you can find the MusicDownload.exe application that allows to upload audio files in the flash memory:

jq6500-rec-007

The software is in Chinese but its use is very simple: by moving to the second tab you can select the MP3 files to be uploaded. If you now move back to the initial tab, you can start the upload process clicking on the only available button. In the video at the end of this post you can see how it works…

You can control the JQ6500 chip in different ways. The easiest one is using external buttons connected to pins K1-2-3-4-5:

jq6500-004

When you press a button, the chip plays the corresponding audio file. For example if you press the button connected to pin K1, the chip plays the audio file named 001.mp3.

The onboard amplifier (HXJ 8002) is a mono IC and its output is connected to pin SPK+ and SPK-. You can therefore connect to those pins a small speaker. If you want a stereo audio, you can instead use pins ADL_L (left channel) and ADC_R (right channel) and connect them to an external amplifier.

Conclusions

This module is an excellent and inexpensive solution to add audio to your projects. The use of an internal flash memory has the advantage of not requiring SD cards or other media to store your audio files; in contrast its capacity (16Mbit = 2MByte) makes it more suitable to reproduce sound effects / guide voices than to make a music player.

In the next articles I will show you how to interface the module with Arduino … meanwhile here is a video showing my first tests:

 

 

 

BLE with Bluno Beetle

Some time ago my friend Mauro Alfieri showed me an interesting development board produced by DFRobot and called Bluno Beetle (now Beetle Ble). It seemed the perfect board to start “playing” with the Bluetooth Low Energy (BLE) technology; therefore I ordered  one board directly from the DFRobot store.

I expected to receive the usual anonymous parcel with the board inside an antistatic plastic bag; DFRobot instead sends its products in an elegant cardboard box, protecting them with foam:

bluno-011 bluno-012

Bluno Beetle is really small and therefore perfect for wearable projects:

bluno-013 bluno-014

But what is it? Simplifying is a board, Arduino Uno compatible (it hosts the ATmega328P microcontroller) to which has been added the CC2540 chip from Texas Instruments to act as USB and BLE controller. The two chips communicate via a serial interface:

bluno-001

The CC2540 chip is actually a real microcontroller that runs a firmware developed by DFRobot. This firmware can be configured using AT commands. Normally the firmware runs in transparent mode, that is it acts as a “bridge” between the USB/BLE interfaces and the ATmega microcontroller. If you then connect the Bluno to your PC and activate the serial monitor, each character you type is forwarded to the ATmega and viceversa.

To send AT commands, first you have to enter the AT mode of the firmware, sending the + character 3 times (without appending a line ending). The firmware confirms the new mode with the sentence “Enter AT Mode”:

bluno-006

Now you can send the commands, appending the Windows line terminator (CRLF). For example to display the firmware version:

bluno-007

To exit the AT mode and go back to transparent mode, you have to send the AT+EXIT command.

Drivers

It may happen that – if it’s the first time you connect the Bluno Beetle to your Windows PC – it is not correctly recognized:

bluno-003

The correct drivers are shipped with the Arduino IDE. You only need to do a manual installation specifying the path where you installed the IDE:

bluno-004

Windows will identify the new device as an Arduino Uno:

bluno-005

Arduino

As explained above, if the firmware running on the CC2540 chip is in transparent mode, using the USB connection you can talk directly to the ATmega328P microcontroller. This means that you can program the microcontroller using the Arduino IDE without any problems… just choose Arduino Uno as board and select the correct serial port:

bluno-008

BLE and transparent mode

In transparent mode Bluno transmits via BLE each byte it receives from Arduino (the ATmega microcontroller) and – viceversa – it sends to Arduino each byte it receives from BLE.

In this first post let’s explore the demo application DFRobot provides; in a future post I’ll explain how to develop your application to interact with Bluno Beetle via BLE.

If you have an Android smartphone, you can directly install the apk file for the application named BlunoBasicDemo (application of which the source code is also available). In the same Github repository you can also find the source code of the iOS application, you have to compile by yourself.

Compile and upload the following sketch on the board:

unsigned long previous_time = 0;
 
void setup() {
  Serial.begin(115200);
}
 
void loop() {
 
  if (Serial.available() > 0) {
    int incomingByte = Serial.read();
    Serial.print("New byte received: 0x");
    Serial.println(incomingByte, HEX);
  }
  unsigned long actual_time = millis();
  if(actual_time - previous_time > 10000) {
    Serial.println("Hello world!");
    previous_time = actual_time;
  }
}

The sketch reads the incoming bytes (coming from the app) and sends back to the app their hexadecimal value. Every 10 seconds moreover the sketch sends to the app the text Hello world!.

Launch the app. After having clicked on the Scan button, you can choose your Bluno board from the list of detected devices:

bluno-009

Every 10 seconds you should see a new HelloWorld! string appear. You can try to send a character (for example the letter “a”); you’ll receive an answer from Arduino (0x61 is indeed the hex code – in the ASCII table – for the letter “a”):

bluno-010

HID mode

Bluno also supports the HID (Human Interface Device) mode. When running in this mode, Bluno simulates an input peripheral (keyboard, mouse…) connected via BLE.

The AT command that enables this mode is:

  • AT+FSM=FSM_HID_USB_COM_BLE_AT

After having enabled the HID mode, you can send one or more “keys” with:

  • AT+KEY=

you can send up to 3 different keys at a time, concatenating their codes with the + character. The codes to be used, according to the type (page) of the HID device, are listed in the USB specification.

The AT+KEY command notifies the pressure of a key on the keyboard.  It is therefore necessary, after a few moments, to send the AT+KEY=0 command to indicate that the key has been released; otherwise on the PC associated with Bluno you’ll see the character appear repeatedly!

Debug mode

Using two different AT commands you can enable the debug mode of the firmware. This mode allows to receive – via the USB connection – a copy of all the data sent and received through the BLE connection.

The two commands are:

  • AT+BLUNODEBUG=ON (copies the messages sent by the ATmega)
  • AT+USBDEBUG=ON (copies the messages received from BLE)

bluno-002

By default the first debug mode is active, while the second is disabled. You can verify it if you upload the sketch listed above: in the serial monitor you’ll see the Hello World! sentences but not the characters sent by the app.

SIM800 GSM module

Today I received from  Banggood a GSM module based on the SIM800 chip by SIMCom. I’m going to use this module in a future Arduino project that will allow me to remotely control devices. In this article I’ll show you how to test the module.

The SIM800 is a quad-band (850/900/1800/1900MHz) chip and allows to trasmit/receive voice, SMS and data (using the GPRS network).

The small module (about 3x4cm) has the SIM800 chip and most of the components on one side, while on the other side you can find the sim card connector:

gsm-005 gsm-004

I chose to buy the module with an external antenna… in addition to the module you therefore receive the antenna and a short (about 20cm) cable to connect it:

gsm-006

The module is powered with 5V, offers a serial interface and you can control it using AT commands.

It is very important to connect the module to a power supply able to provide up to 2A, otherwise you may face problems on the stability of the GSM connection.

To verify if the module works you can therefore connect it to your PC using a simple USB – serial converter and send the correct AT commands as the manual explains. Be careful to invert the TX and RX pins: the TX pin of your adapter must be connected to the RX pin of the GSM module and viceversa:

gsm-008 gsm-007

The simplest test is to send and receive an SMS. For simplicity first configure the text mode (=1) with the command AT+CMGF=1. The module will answer with the command you send (without the starting AT) followed by OK.

Now you can specify the recipient of the message with the command AT+CMGS=”number. After having sent the “carriage return” character, the module will send the prompt, after which you can type the text of the message. End the message with the character 0x1A (CTRL-Z); the module will answer with the command you sent followed by the number of characters in the message (26):

gsm-001

When a new SMS is received, the module sends the +CMTI message. You can read the messages with the AT+CMGL command and you can also specify a filter (for example REC UNREAD, that is all the messages received but not read yet):

gsm-002

The filters available are listed in the manual:

gsm-009

After having verified that the module works, you can now realize a more complex project, for example interfacing it with your Arduino…

gsm-003

 

 

ESP32 Modules Popping Up Everywhere, In Stock Almost Nowhere

We know what it’s like to wait for newly released electronic parts. Clicking refresh every day at your favorite online retailers, reading reviews published by the press who got preview units, and maybe even daring to order implausibly cheap devices from foreign lands. The ESP32 has many of us playing the waiting game, and we’ll level with you — they’re out of stock most places. But, if you look hard enough you can find one. At least, you could find them before we wrote this quick roundup of ESP32 hardware. If hearing about parts that are just out of reach is your sort of thing, then read on, you masochist!

Espressif

Espressif, the company that makes the ESP-32 chip and its support firmware, is also making modules and development boards to support them. Their module is the ESP-WROOM32, is not just the first module out there, but it also serves as the hardware design reference (zip file) for the chip. They also provide a datasheet (PDF) for the module. It’s all there, so you could run their Gerbers and source the parts yourself if you wanted to.

tojvkfzv9gpnqcpo8walvn2bAlternatively, you could order them directly from Espressif, which we’ve never tried before, or you can try to get them many places online. Seeed was one of the first to stock them, but they’re now out. Elecrow claims to have them in stock.

Espressif also makes a simple development board, which is what we received for testing. These are in stock at Adafruit (limit 1 per customer) and out of stock (again) at Olimex but we hope that’ll change soon enough. With Espressif’s own modules in short supply, it’s a darn good thing that they’ve published a reference design and the clone producers have stepped up. Let’s take a look at what the rest of the world is offering.

All-in-One Boards

Whether you think of these as being development kits or ESP32 breakouts, a complete minimal design that would be ready to start programming on should include a power regulator, a USB/serial converter, flash memory, the ESP32 chip and antenna.

nano32_3From the look of things, Gravitech and Maker Asia took Espressif’s demonstration board and module apart and reconstructed it on a single PCB. This means that they’re able to pump out boards without being bottle-necked by the availability of modules. The Nano32 is currently being manufactured in Thailand, so we have no idea how long they’ll take to get to you.

In the US, Sparkfun has entered the ring with their ESP32 Thing which has just come out of backorder. You should bookmark their very nice getting-started guide. Their twist on the basic board is to add in a LiPo battery charger. We haven’t been able to put the chip through a power test yet, but the folks at Espressif suggested that they’ve added a few power-saving tricks to the firmware, so there’s hope that a battery-driven WiFi solution isn’t far away.

In Europe, Pycom has two boards that are apparently in stock now, and both shipping with their MicroPython firmware. Their WiPy 2.0 isn’t all that much different from the other boards, but the LoPy is unique, pairing a LoRa radio with an ESP32, giving you three radio protocols for the price of one and a half, or something. If you need a LoRa bridge, or you need an ESP32 right now, check these folks out.

Pycom's WiPy Sparkfun's ESP32 Thing A Wildcard: the ESPea32, aimed at the Internet of Gardening

There are more than a few other development boards, or at least designs, out there. Click on over to ESP32.net and scroll down to the bottom of the page for a list. If any of you have one of these in your hands, or are the developer of one, let us know in the comments?

Modules

cwdi6eiviaa3lcu_thumbnail
ESP32S Sitting on top of ESP-WROOM32. Perfect match! (Via [Angus Gratton])
If you bought a bare ESP-XX module (ESP-01, ESP-07, ESP-12S…) chances are fairly decent that it was made by AI-Thinker. This is an entirely unscientific poll, but they account for 100% of the sample of bare modules that we’ve bought online.

Their earliest draft of an ESP32 module, called the ESP3212, has been scrapped and replaced with the ESP-32S, with a pinout that’s identical to Espressif’s WROOM32, according to [Angus Gratton] of Espressif. AI-Thinker started up production in early October, and there are modules available for around $8 on Taobao.com.

We’re stoked to see a second source for modules, because all of the stock-outs and backorders are getting a little bit old. And we’re doubly stoked that they’re using the same footprint as Espressif. That’s one more thing that we won’t have to worry about.

Summary

At the moment who has what in stock is in flux, but if you look a little deeper, you can find an ESP32 development board or module. This is all bound to change over the next few weeks, so let us know what, where, and for how much you find yours. We look forward to these modules and development boards being as ubiquitous and easy to use as their predecessor.


Filed under: Featured, Microcontrollers, Skills