Useful ESP12E-DEV Prototype Shield

ESP-12E Prototype Shield

In answer to quite a few requests for a prototype shield, similar to my ESP32-S Dev Prototype shield, but for use with the ESP-12E DEV board, I have decided to do a quick design, and make it available publicly

This is the MakerIOT2020 ESP12E-DEV Prototype Shield. It is similar in purpose to the above-mentioned ESP32-S Dev Prototype shield, but I have also added some additional cosmetic changes to make it a little easier to use as well.

With many of my prototype designs, I tend to sometimes leave out something, as I usually use it for my own purposes only, but with this design, as many people specifically asked for it, I took a bit more care, as it is no longer just a prototype, right?

What has changed?

The most obvious is the increased prototyping area. The initial ESP32-S version had a 60-hole breadboard-style prototyping area. The new design has 128 prototype holes.

There is also a dedicated power input header, something that I somehow left out on the ESP32-S version… The Flash and Reset push-buttons were also moved inline, and to the bottom of the shield, making it more comfortable to use.

The design retains the plated through-hole design on the prototype area with connecting tracks on both sides of the PCB to allow for a bit more current.

The big ground plane on both sides of the PCB has also been retained.

PCB Design and Schematic

Top Layer Layout
Bottom Layer Layout

The prototype shield is for all purposes a breadboard. I did thus not bother with a formal schematic. I believe that it is easy enough to understand the connections by just looking at the two images above.

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

You can get your own copy here

PCBWay

Some More Pictures of the PCB

RP2040 Scoppy Oscilloscope Analog Front End Shield

This post will look at my prototype Analog front-end for the Scoppy RP2040 Oscilloscope. It is important to state right from the beginning that this circuit is one of the 5 recommended designs from the Scoppy Website. I have only moved it from the breadboard design as published, onto a PCB.

The entire circuit, with all of the original designer’s writeups, is available here

So, why use someone else’s circuit? Well, the reason for this is two-fold.
1) The circuit designer also designed the firmware, so it stands to reason that his circuit will be optimised for use with the firmware.
2) Using his circuit provides a solid reference, making it possible to test the firmware for correct operation, and later on, providing a base for my own design – if and when I do decide it is worthwhile to actually design my own.

As I already have a proper oscilloscope as well as a logic analyser, this entire exercise is purely academic, I find the Scoppy project interesting, and as such, I would like to see how it compares with my commercial products ( while also knowing that it won’t be a very fair comparison ).

With all the limitations, I am however still quite impressed at the level of use that you can get out of this very simple device. It is definitely quite useful for a beginner.

What is on the PCB, and what did I change?

The PCB is a dual-layer shield that is designed to be used with the MakerIOT2020 Raspberry Pi Pico Carrier board. The shield is directly powered by the carrier board.

The original Analog Front-End #3 circuit featured a single channel input, capable of accepting a -18.0v to 18.0v signal input.

My changes were limited to doubling up on that circuit, to provide two channels.

The Schematic


I have redrawn the original schematic, partly to make it easier to understand for myself, as well as to help me with the design of the PCB.

Lets take a look at the schematic ( by using text from the original designer)

The author makes no warranty, representation or guarantees regarding the suitability of this design for any particular purpose. Nor does the author assume any liability arising out its use and specifically disclaims any and all liability, including without limitation special, consequential or incidental damages.


All text below is quoted from here

This design builds on Design 2 and adds over and under voltage protection to the analog front end. After all, we won’t have a cheap oscilloscope if we keep frying our components!

I’m assuming here that the minimum and maximum voltages that will be applied to the input of the scope will be -18V and +18V respectively. It has been tested from -18.5V to 18.5V (two of my 9V batteries in series) but of course If you decide to use this design you are doing so at your own risk. I personally wouldn’t use Scoppy with an expensive phone/tablet just in case something unexpected goes wrong (better to use an old, obsolete phone that is no longer used for anything else) – especially when dealing with higher voltages – but of course you can do what you like.

Protecting the Op-Amp input(s)

First of all we need to protect the op-amp. In this design we’ll be using an LM324 op-amp, which is very similar to the LM358 but contains four individual op-amps rather than two. We’ll be using three of these op-amps. The reason for this will be explained later.

According to the datasheet for the LM324 the allowed input voltage range goes from -0.3V to 32V. Of course 32V is above the maximum expected voltage (18V) and so we don’t need to worry about over-voltage protection. However we do need to ensure that the voltage at the input pins don’t go below -0.3V. A schottky diode can be used to clamp the voltage to something above -0.3V (D1 in the schematic).

One thing that needs to be considered when selecting the diode is its reverse current. The 1N5817 has a very low forward voltage but high reverse current and this results in a voltage drop at the input of the op-amp (in the order of 100mV). Presumably this is because it draws current through the high value input resistor (Rg1). The 1N5711 has a much lower reverse current specification and I couldn’t discern any voltage drop when this was inserted into the circuit. However, its forward voltage (at the current expected in this part of the circuit) is very close to the minimum allowed voltage of -0.3V. To be safer I prefer to use something like a BAT46. It does result in a voltage drop of a few millivolts but the clamped voltage is more like -0.23V.

Protecting the Pico/RP2040

The Pico datasheet states that:

the ADC capable GPIO26-29 have an internal reverse diode to the VDDIO (3V3) rail and so the input voltage must not exceed VDDIO plus about 300mV

The obvious way to protect the ADC inputs (GPIO26-29) then is to simply insert a schottky diode between the ADC input and VDDIO. However, the RP2040 datasheet says that:

the voltage on the ADC analogue inputs must not exceed IOVDD ...<snip>... Voltages greater than IOVDD will result in leakage currents through the ESD protection diodes

That suggests to me that we shouldn’t be allowing current to pass (leak) through our clamping diode and into IOVDD. I could be completely wrong here – if you think so then please share your thoughts in the forum (Discussions).

Anyway, to be safe we’re going to avoid that situation by sending the current to the output of one of our op-amps (LM324-sink on the schematic). The LM324 is able to sink up to ~10mA so this should work fine if we limit the current from the main op-amp (LM324-amp in the schematic). Given that the maximum voltage expected at the output of LM324-amp is around 4.5V (Vcc – 1V) then we need a resistor of at least 120R to limit the current to 10mA (4.5-3.3 / 0.010 = 120). A 220R resistor should do fine (Rout).

And of course the reason we are using an LM324 rather than the LM358 of the previous designs is that three op-amps are required.

A 1N5817 diode (D2) is used here (rather than a BAT46 – used on the input of LM354-amp) because at the expected maximum current of 10mA the forward voltage drop of the BAT46 is higher than 300mV. The high reverse current of the 1N5817 is not such an issue here because Rout has a low value and so there will only be a small voltage drop across Rout when D2 is reverse biased.

Construction

Schematic
Breadboard

Here are some instructions for assembling this front end on a breadboard. The pin numbers refer to the LM324 PDIP package. Refer to the schematic and breadboard image above. NB. The rail labelled 5V on the schematic is actually VSYS which of course is not necessarily 5V because it depends on how charged the battery is on your Android device.

Connect 3V3 of the Pico to the top red power rail of the breadboard. Connect VSYS to the bottom red power rail. Connect both ground rails of the breadboard to one of the GND pins of the Pico. The fuse as shown in the breadboard image is optional.

Connect the Vcc pin of the LM324 to the VSYS rail. Connect the GND pin of the LM324 to the GND rail. Don’t connect anything to the ADC pin(s) of the Pico yet.

Now we’ll configure each of the 4 op-amps of the LM324 in turn.

Op-amp 2 – Unused
Op-amp 2 (pins 5, 6 and 7 of the PDIP package) is not used so we’ll wire it up as recommended in the TI tech note – How to Properly Configure Unused Operational Amplifiers.

The voltage at the non-inverting input should be approximately VSYS/2 and the output should be the same.

Op-amp 4 – Vref
Wire up this op-amp as shown in the schematic. The voltage at the output should be approximately 1.65V.

Op-amp 3 – sink
Wire up this op-amp as shown in the schematic. The voltage at the output should be 3.3V.

Op-amp 1 – amp
Wire up this op-amp as shown in the schematic, including the under-voltage protection diode on the input (D1) and the current limiting resistor (Rout) and over-voltage protection diode (D2) on the output. Don’t connect the output to the Pico yet.

Testing and initial operation

You should now be able to safely apply any voltage at Vin1/Vin2 of between -18V and +18V. Test that the voltage at the input of the LM324 (Vampin) doesn’t go below -.3V and the voltage at the output of op-amp 2 after Rout (Vadc) doesn’t go above 3.6V.

Once you’ve confirmed that all of the op-amps have been wired correctly you can connect the output of Rout to the ADC pin of the Pico.


The author makes no warranty, representation or guarantees regarding the suitability of this design for any particular purpose. Nor does the author assume any liability arising out its use and specifically disclaims any and all liability, including without limitation special, consequential or incidental damages.

Designing the PCB

PCB Design and Layout

Manufacturing the PCB

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

Assembly

The PCB was assembled with help of a stencil to ease and speed up the solder paste application. The components were then hot-air soldered.
As this is only a prototype, I chose to only place 2.54mm header pins on pins that are required for operation, as well as all the ground pins, to ensure a proper ground plane.

SMD Stencil to speed up assembly

Conclusion

This was quite an interesting project. While everything works as expected, resolution and frequency are limited. ( of course, it is…) The project is however still useful, and will definitely give you some useful results in a pinch.

The logic analyser is by far more useful, but once again, a commercial device will be way more accurate and useful for professional use. Hopefully, the designer will add some protocol filters etc in future.

This device will not replace a proper oscilloscope or logic analyser, but it will definitely give enough accuracy and resolution on low-frequency applications to satisfy some of the basic needs of a beginner or student just starting out with electronics.

It is also important to note that you should be safe, and not try to connect this to high voltages etc. Also, don’t connect this to your expensive phone or tablet, use an old one instead, as accidents may happen, and we don’t want to damage our valuable handheld devices…

An Easy RP2040 Logic Analyzer Shield – Scoppy Scope Part 2

Scoppy Scope Logic analyser Shield with Logic Probes

As part two out of a series of three articles (part 1), This is the Scoppy RP2040 Logic analyzer shield, for use with our Raspberry Pi Pico Carrier board and the Scoppy Oscilloscope firmware for the RP2040.

In Part one, we took a very quick look at the installation of the firmware, as well as the basic limitations for use of this very useful project.

In this part, I want to take a quick look at my Logic Analyser shield, for use with this project, as well as the Raspberry Pi Pico Carrier Board. In part one, we saw that the logic analyzer inputs are limited to 3.3v by the RP2040 GPIO pins. This shield is a prototype attempt to overcome those limitations by using logic-level conversion.

What is on the PCB ?

The PCB is designed to be an add-on shield for the Makeriot2020 Raspberry Pi Pico Carrier Board. (Get your own here) It is in the same form factor as the Arduino Uno shields, but with pinputs specific to the RP2040 and Raspberry Pi Pico.

8 Ch Logic analyser Shield for use with Scoppy and MakerIOT2020 Pico Carrier Board

All Raspberry Pi Pico pins are broken out and labelled, as well as all of the pins specific to the Scoppy App have been clearly labelled. The board are stackable onto the Pico Carrier board, via standard 2.54mm Male Headers, or extra long, stackable female 2.45mm headers, similar to those found on common Arduino shields.

The use of stackable headers will allow simultaneous use of the logic analyser shield and the Analog frontend shield, introduced in part 3 of this series.

In addition to that, a 2×8-way 2.54mm Male header provides access to the 8 logic converted logic analyser inputs.

Logic conversion is done with a simple circuit, comprising a Bss138 N-Channel Mosfet and two 10K resistors per channel.

The shield is powered directly from the Pico Carrier board, which is in turn powered from the OTG cable to the Android Phone or tablet used to display the captured data. ( see Part 1 for installation instructions and other details regarding the Scoppy Project)

The logic level converters allow the use of a 5v logic signal, which is an improvement over the original design, which allowed only 3.3v inputs.

The Schematic and PCB Layout

Logic analyser shield schematic


PCB Layout

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

Some more pictures of the device

Installation instructions (repeated from Part 1)

Scoppy Scope Installation

All credits for the development of the Scoppy firmware goes to fhdm-dev. This shield is a modification made by MakerIOT2020, and thus belongs to me. In the spirit of the original project, It will however be released to the public as a free open-source project ( free as in free download, free schematic, free design ). The PCB manufacturing files will be made available for free at a later stage, or can be ordered from PCBWay from this link

RP2040 Oscilloscope and Logic Analyser

Oscilloscopes and Logic analysers are essential instruments for every serious electronics hobbyist. They are however quite expensive, and thus beyond the reach of many people starting out with electronics. Today, I will show you a cheap solution, an RP2040 Oscilloscope and Logic analyser…

Before we get started, we need to clear up a few things first:
1). This is not my own project. It was designed and built by someone else.
2). This is not a professional grade Oscilloscope or Logic analyser
3). The range of input voltages, as well as the frequencies that you can measure, are limited.

What is this, and why do I bother with it?

This post is about the Scoppy Occiloscope Firmware, designed by fhdm-dev. I have no affiliation with him/her, I came across this recently and found it useful in the sense that it may help others gain access to instrumentation to greatly help them with electronics.

I did design some derived pcb components that works with this project, in order to take care of some limitations that I saw in the original project. More on that in two follow-up posts, in which I will show you two PCB’s that I designed to use with this project, and analog Frontend ( based on a public design by fhdm-dev, as well as a Logic analyser shield, of my own design

before we do this, we need to look at the basic Scoppy design and its firmware.

Getting Started

You will need a few things to make use of this project, the most important will be the Scoppy App ( available from the Google Playstore ), and an Android Phone.
You will also need a USB OTG Cable/hub for the phone, as well as a Raspberry Pi Pico or Pico W

The Installation and Getting Started Guide is very well documented, and as such, I will not spend a lot of time on that.

My own Setup

I have decided to use my own Raspberry Pi Pico Carrier board for this project, as it will allow me to get away from the breadboard, as well as serve as a platform for easily expanding on the project via expansion shields, as you will see in later articles.

Makeriot2020 Raspberry Pi Pico Carrier Board

This PCB, in Arduino Uno form Factor, will make putting the entire project into a case quite easy, as well as hopefully keep the number of floating hookup wires to a minimum. ( hopefully reducing some notice and other stray signals from interfering too much with our signals)

After installing the application, which is quite easy, we need to load the firmware onto the RP2040. This is also extremely easy is you follow the guide at the top.

Please note that the Android app has two modes, a freeware mode, limited to one channel, and a paid version, with no limitations. I recommend that you consider buying the paid version, as it only costs a few dollars ( I paid $USD2), and will motivate the developer to keep working on the project, and improving it.

Scoppy Application, Main Interface – Oscilloscope
Scoppy Menu
Scoppy Logic Analyser Screen

As we can see, the interface is quite clean, and easy to use.

What are the limitations?

There are quite a few limitations, namely frequency and voltage input.
From what I can understand, the frequency limit seems to be around 25Khz, with the voltage level limit being 0.0v to 3.3v ( as per the limit of the RP2040 ADC

Please make sure that you follow all instructions on the original page, as you can very easily damage your Android device as well as the Pico if you apply a voltage outside of the allowed range.

On the logic analyser side, It is also important to note that you should stay in the 0.0v to 3.3v range of the Pico GPIO’s.

While these limited ranges will definitely limit what you can do and measure, It will still be a very useful project. In the next part of this article, I will show you how I have solved the logic analyser voltage range issue… Allowing you to analyse 5v signals as well.

A versatile easy to use XIAO RP2040 LoRa Fusion

In this post, we will look at a versatile easy-to-use XIAO RP2040 LoRa Fusion. The SEEED Studio Xiao RP2040 should, by now, no longer be a stranger to any of us makers and electronics enthusiasts. At its heart, it contains the same RP2040 processor that is used on the Raspberry Pi Pico.



What makes, the Xiao RP2040, special is its size, only 20.00mm x 17.5mm, as well as the carefully curated combination of GPIO pins, single-sided board construction and castellated pads to make incorporating it directly into a design an absolute pleasure.

Features

  • Powerful MCU: Dual-core ARM Cortex M0+ processor, flexible clock running up to 133 MHz
  • Rich on-chip resources: 264KB of SRAM, and 2MB of onboard Flash memory
  • Flexible compatibility: Support Micropython/Arduino/CircuitPython
  • Easy project operation: Breadboard-friendly & SMD design, no components on the back
  • Small size: As small as a thumb(20×17.5mm) for wearable devices and small projects.
  • Multiple interfaces: 11 digital pins, 4 analog pins, 11 PWM Pins,1 I2C interface, 1 UART interface, 1 SPI interface and 1 SWD Bonding pad interface.

Specifications

ItemValue
CPUDual-core ARM Cortex M0+ processor up to 133MHz
Flash Memory2MB
SRAM264KB
Digital I/O Pins11
Analog I/O Pins4
PWM Pins11
I2C interface1
SPI interface1
UART interface1
Power supply and downloading interfaceType-C
Power3.3V/5V DC
Dimensions20×17.5×3.5mm

The AI-Thinker RA-02 also need no introduction from me, as I have used it extensively in quite a few projects before.

With the worldwide chip shortage, building solutions around the easily available RP2040, and RA-02 makes perfect sense, as these two modules are also super cheap.

For this project, I have also decided to try out a fully factory-assembled PCB to compare quality, as well as the convenience of being able to focus on software without doing assembly first, not that I mind assembling my own boards though… More on that experience later…

What were my intentions with this project?

I had the following goals/needs:
1. A modern, easily obtainable processor, that is not only cheap but also energy efficient. The RP2040, in the form of the Xiao RP2040, fits that goal perfectly.
2. An as-small-as-possible footprint for the main processor, without having to resort to manually designing a Pi Pico derivative – The RP2040 chip is a bit tiny for my eyes
3. The minimum of external supporting components to make the design function
4. Flexible power options ( 3v or 5v )

As to my use intentions, I use quite a few LoRa devices for various different purposes, so adding another option seemed like a good idea.

In the current design, providing that the Arduino libraries stay compatible, the new design will support not only LoRa but also FSK and OOK, with all the advantages of those.

By changing the position of only 3 jumpers, I can also use the PCB for a general-use RP2040 development platform, or another RP2040 project.

Taking all of this into consideration, the device will thus be ideal for any remote sensor application, as well as using it on the bench-top for prototyping

What features are on the PCB?

  1. All of the Xiao RP2040’s pins and pads are broken out onto the PCB, including the SWD port.
  2. The Xiao also has a user LED, and a NeoPixel on-board, which can easily be used for signal indication.
  3. Level shifted 5v I2C port, in addition to the standard 3.3v I2C, because all of our sensors are not always 3.3v compatible, and using external level shifters is not always so convenient.
  4. Access to the RA-02’s GPIOs (DIO1-DIO5) is provided, but most people won’t need to worry about these.
  5. Jumpers to connect some of the Xiao RP2040 GPIO to the special use GPIO on the RA-02, for example, GPIO1 and GPIO2, sometimes used with some of the more specialised LoRa libraries.
  6. Provision or powering the device via a dc barrel connector, or screw-terminal, as well as via the 3v input pins (make sure your supply has a capability of more than 300mA)
  7. A power management chip to reset the Xiao RP2040 when the supply voltage falls below 3.0v – To prevent unstable operation and possible lock-up.

The Schematic

PCB Design and Rendered Images

PCB Design, 2 Layer board
PCB 3D-Render

Manufacturing and Assembly of the PCB

For this project, I have decided to try out SEEED STUDIO’s Fusion Service.
They are after all the manufacturers of the Xiao RP2040 Module that I used, so, when they contacted me a few weeks ago with an invite to try out their Fusion service, I decided to give it a go.

Se​eed Fusion offers one-stop prototyping for PCB manufacture and PCB assembly services, and as a result, they produce superior quality PCBs and Fast Turnkey PCBA in as little as 7 working days. When you prototype with Seeed Fusion, they can definitely provide Free DFA and Free functional tests for you!

So, what was my experience like?

From a design point-of-view, nothing much changed, except that I had to spend a bit more time focusing on the BOM, as my usual go-to for components is LCSC. I, therefore, had to make a few small substitutions on some passive components to ensure that everything was in stock and available.

I also chose to only have the SMD components on the PCB factory assembled. Soldering a few header pins is no trouble anyway.

Manufacturing and shipping lead times were not too long, and I received the assembled boards in about 7 working days from the time of order.

Using the PCB

The Xiao RP2040 has great support for Micropython, CircuitPython as well as the Arduino IDE. There is an excellent article on getting started with the XIAO RP2040 available here , with sections on all three supported development languages and environments.

You can also try out some machine-learning projects with TinyML

As mentioned above, most of the 11 GPIO pins on the XIAO RP2040 were broken out to headers on the PCB, with the exception of those needed for dedicated control of the RA-02 LoRa Module ( D1, D2, D8, D9, D10). In addition to this, some other GPIO, like the I2C pins (D4 and D5) may be accessed on H1 (labelled as SCL/SDA) [3.3v logic] or alternatively on H2 (as SCL/SDA) [ note that this header is level converted to 5.0v ]

To accommodate some other special use features of the RA-02 LoRa Module, J1 and J2 can be jumpered in two positions to connect D3 to DIO1 on the RA-02, and D6 to DIO2 alternatively. Most people will however not need to do this.

When using the Hardware UART on the Xiao RP2040, the jumper at H4 needs to be set to D7/Rx->D7 in order to receive Data, and J2 should be in the default D6/Tx->D6 position

PCB Layout – Showing Jumpers and Headers

Testing the PCB with LoRa

In order to test the functionality, I have written a very simple sketch to test the communication between the PCB and another LoRa device, running a similar sketch…

#include <SPI.h>       // include libraries

#include <LoRa.h> // I used Sandeep Mistry’s LoRa Library, as it is easy to //use and understand


const int csPin = D7;     // LoRa radio chip select

const int resetPin = D1;    // LoRa radio reset

const int irqPin = D2;     // change for your board; must be a hardware //interrupt pin

byte msgCount = 0;      // count of outgoing messages

int interval = 2000;     // interval between sends

long lastSendTime = 0;    // time of last packet send

void setup() {
Serial.begin(115200); // initialize serial
while (!Serial);
Serial.println("LoRa Duplex - Set spreading factor");
// override the default CS, reset, and IRQ pins (optional)
LoRa.setPins(csPin, resetPin, irqPin); // set CS, reset, IRQ pin
if (!LoRa.begin(433E6)) { // initialize ratio at 433 MHz
Serial.println("LoRa init failed. Check your connections.");
while (true); // if failed, do nothing
}
LoRa.setSpreadingFactor(8); // ranges from 6-12,default 7 see API docs
Serial.println("LoRa init succeeded.");
}
void loop() {
if (millis() - lastSendTime > interval) {
String message = "Testing Xiao RP2040 - LoRa "; // send a message
message += msgCount;
sendMessage(message);
Serial.println("Sending " + message);
lastSendTime = millis(); // timestamp the message
interval = random(2000) + 1000; // 2-3 seconds
//msgCount++;
}
// parse for a packet, and call onReceive with the result:
onReceive(LoRa.parsePacket());
}
void sendMessage(String outgoing) {
LoRa.beginPacket(); // start packet
LoRa.print(outgoing); // add payload
LoRa.endPacket(); // finish packet and send it
msgCount++; // increment message ID
}
void onReceive(int packetSize) {
if (packetSize == 0) return; // if there's no packet, return
// read packet header bytes:
String incoming = "";
while (LoRa.available()) {
incoming += (char)LoRa.read();
}
Serial.println("Message: " + incoming);
Serial.println("RSSI: " + String(LoRa.packetRssi()));
Serial.println("Snr: " + String(LoRa.packetSnr()));
Serial.println();
}

Please note that the sketch uses callbacks on receiving messages.

In conclusion

This project was quite interesting, and I am very much impressed with the quality of the assembly done by SEEED Studio’s Fusion Service. The Xiao RP2040 is also a pleasure to work with, and I hope that with future iterations of this prototype, I may be able to produce an even more compact PCB, that will still pack some serious performance punches while being power efficient as well