Build a Programmable +3.3Volt Compliant Logic Probe
2023-03-28 | By Don Wilcher
License: See Original Project ESP8266 RP2040
Digital circuits are used in electronic devices to show high or low operating states. Other ways of describing digital circuit operating states include “true” or “false” and binary 1 or 0. A Truth Table (TT) is a graphical tool used to test the electrical operation of digital circuits by showing input data and observing their output states. A TT aids makers in building digital circuits by allowing them to inject test data in the device’s input pins and observe the output states using a logic probe.
A Truth Table for a common digital logic gate.
A logic probe is an electronic tester that displays a digital circuit's input and output signals using visual indicators. LEDs are commonly used to show the binary data of a digital circuit. Binary data consists of a logic “1” representing a high state or event and a “0” representing a low state or event. Typical colors used to represent high or low digital data are green or red. A green LED indicates a high binary state or event, while red means the opposite digital value. Some logic probe variations may consist of a seven-segment display capable of displaying the letters H or L for high or low binary data.
A logic probe with H or L visual indicator display.
Figure 3. A logic probe with an LED binary visual indicator display.
In this project, we will build a programmable logic probe that is +3.3V compliant. We’ll use a RoundyFi LCD module as a programmable logic probe. The RoundyFi LCD uses an ESP-12E module with +3.3V compliant General-Purpose Input-Output (GPIO) pins.
With an input-output requirement, the programmable logic probe is a great electronic tester for +3.3V compliant microcontrollers like the Raspberry Pi Pico, the Espressif ESP32 and ESP8266 chips, the Raspberry Pi family of single board computers (SBC), and +3.3V digital logic integrated circuits (ICs). The convenience of using the RoundyFi is the graphics capabilities of the LCD, thus customizing the visual binary state of the device under test (DUT) quite easily.
The Programmable +3.3V Compliant Logic Probe: The Design Concept
The design of a programmable +3.3V compliant logic probe consists of using the RoundyFi module as a binary tester that can display the logic state or event of a digital circuit or microcontroller. A logic state aligns with a digital circuit’s output signal, whereas an event is associated with a triggered input activity. The RoundyFi’s LCD can easily be changed using C++ or MicroPython code to provide unique, aesthetically appealing binary states. The ESP-12E module allows such aesthetics to be visualized quite easily. The below image shows the concept of the programmable +3.3V logic probe.
Programmable +3.3V Compliant Logic Probe.
As shown above, the DUT is represented by a Raspberry Pi Pico W. The W means wireless since the Raspberry Pi Pico W has WiFi and Bluetooth. The Raspberry Pi Pico W uses the RP2040 microcontroller with GPIO pins that are +3.3V compliant. Due to their voltage-compliant requirements, such a DUT will not damage the RoundyFi’s GPIO pins. With the Raspberry Pi Pico W, various digital switching patterns can be programmed, testing the binary detection and transition level capabilities of the RoundyFi as a logic probe.
Wiring the Programmable Logic Probe Prototype
The construction of the logic probe is relatively simple. Place the electronic components on a solderless breadboard and make the appropriate electrical wiring connections accordingly. You can find a circuit schematic diagram and Bill of Materials (BOM) below:
Once you have the components, you can place them on the solderless breadboard. Wire the electronic components together using five jumper wires. See the images below for the placement and wiring of the electronic components on the solderless breadboard.
Note that you will need to solder male header pins to the Raspberry Pi Pico W.
Electrical wiring diagram for the Programmable +3.3V Logic Probe Prototype.
The Programmable +3.3V Logic Probe electronic circuit schematic diagram.
The final hardware build of the Programmable +3.3V Compliant Logic Probe.
Only five wiring connections are required to complete the hardware build phase of this project. Now that we’re done with the hardware, the next step in the project is to add the MicroPython firmware to the Raspberry Pi Pico W!
Adding the MicroPython firmware to the Raspberry Pi Pico W
The Raspberry Pi Pico W is traditionally delivered without MicroPython firmware installed. You will need to add this firmware to the RP2040 microcontroller. The first step is to go to Raspberry Pi’s microcontroller website (which you can access here). You will see the family of Raspberry Pi Pico microcontroller development boards, as shown below.
The Raspberry Pi Pico microcontroller development boards website.
Scroll down on the left side of the page and stop at MicroPython. Click MicroPython to expand the option.
The MicroPython name is selected.
Select What is MicroPython? and you will be sent to the page below.
The What is MicroPython webpage.
Scroll down until you see the MicroPython UF2 firmware file.
The Raspberry Pi Pico W MicroPython UF2 firmware file.
Next, select the Raspberry Pi Pico W MicroPython UF2 file.
Selecting the Raspberry Pi Pico W MicroPython UF2 firmware.
With the MicroPython UF2 file selected and downloaded to your computer, you may proceed with the installation of the firmware onto the Raspberry Pi Pico W microcontroller development board. The directions to complete the installation are on the same web page under the UF2 file.
Follow the directions carefully to complete the installation of MicroPython onto the Raspberry Pi Pico W board. The final step to building the Programmable +3.3V Compliant Logic Probe project is the coding software for the Raspberry Pi Pico W board and the RoundyFi LCD Module.
Coding Software
The construction of the coding software scheme is based on a distributive controller method, where each embedded controller’s software is independent of the connected unit. This coding software alleviates unnecessary resources to perform several processing activities concurrently on one microcontroller. The distributive controller coding software method is illustrated here:
A distributive controller coding software method for the Programmable +3.3V Compliant Logic Probe.
The Blink code is implemented using the Raspberry Pi Pico W as the digital DUT simulator. The Blink code will provide a consistent switching binary signal, alternating between logic HIGH and LOW levels. The Raspberry Pi Pico GP1 output voltage levels will alternate between +3.3V and 0V. Upon detecting the binary level alternations, the RoundyFi will display HIGH and LOW messages on its LCD.
You may use the Thonny IDE to code in MicroPython for the Raspberry Pi Pico W board. Thonny IDE is a simple software package found here. Thonny allows the MicroPython Blink code to be run using the Read-Eval-Print-Loop (REPL) feature or installed on the RP2040 microcontroller’s memory.
Since this is a prototype digital tester, executing the MicroPython using REPL is appropriate. Attach the Raspberry Pi Pico W board to your PC’s USB port. At the lower right corner of the Thonny IDE, you should see the Raspberry Pi Pico W board connected to the appropriate USB communication (COM) port.
MicroPython Blink Code:
import machine import utime LogicProbe = machine.Pin(1, machine.Pin.OUT) while True: LogicProbe.value(1) utime.sleep(1) LogicProbe.value(0) utime.sleep(1)
Note: Although the Blink code is named main.py, REPL may be used to test the code.
If you are unfamiliar with Thonny, the website has a demo video and instructions for downloading and installing the IDE onto your computer. With the Blink code installed on the Pico W, you can program the RoundyFi Logic probe using the Arduino IDE.
The RoundyFi Logic probe software is configured using the Arduino IDE. You may reference the tutorial on How to Program the RoundyFi LCD to Display Messages; set up the Arduino IDE to program the ESP-12E module with the Logic Probe code. The listing for the RoundyFi Logic Probe is shown next.
/* Providing a switching binary logic signal to SCL (GPIO pin 5) will allow High and Low to be displayed on a RoundyFi LCD accordingly by Dr. Don Wilcher 1/28/2023 */ /* Back End GFX resources for initializing the RoundyFi LCD*/ #include <Arduino_GFX_Library.h> #define GFX_BL DF_GFX_BL /*default backlight pin, you may replace DF_GFX_BL to actual backlight pin*/ #if defined(DISPLAY_DEV_KIT) Arduino_GFX *gfx = create_default_Arduino_GFX(); #else /* !defined(DISPLAY_DEV_KIT) */ Arduino_DataBus *bus = new Arduino_ESP8266SPI(2 /* DC */, 15 /* CS */); Arduino_GFX *gfx = new Arduino_GC9A01(bus, 16 /* RST */, 0 /* rotation */, true /* IPS */); #endif /* !defined(DISPLAY_DEV_KIT) */ /******************************************************************************* * End of Arduino_GFX setting ******************************************************************************/ /* Defining and initializing input variables*/ const int Probe_Signal = 5; int Probe_Signal_status = 0; /* Setup of LCD attributes and input device*/ void setup(void) { gfx->begin(); gfx->fillScreen(BLACK); pinMode(Probe_Signal, INPUT); #ifdef TFT_BL pinMode(TFT_BL, OUTPUT); digitalWrite(TFT_BL, HIGH); #endif gfx->setTextColor(YELLOW); gfx->setTextSize(4); } void loop(){ Probe_Signal_status = digitalRead(Probe_Signal); // reading Digital Logic Level status if (Probe_Signal_status == HIGH) { // if a High (+3.3V) logic level is present, display HIGH Message on RoundyFi LCD gfx->fillScreen(BLACK); // prevents combined messages from displaying on RoundyFi LCD gfx->setCursor(85, 100); gfx->println("HIGH"); delay(100); } else{ gfx->fillScreen(BLACK); gfx->setCursor(85, 100); gfx->println("LOW"); // display LOW Message on RoundyFi LCD delay(100); } }
With the logic probe code typed into the Arduino IDE, attach the RoundyFi LCD module to your computer. Select the NodeMCU 1.0 ESP-12E module and upload the code.
NodeMCU 1.0 ESP-12E board and COM port selected.
You should see the LOW text message on the LCD. Run the MicroPython Blink code on the Raspberry Pi Pico W board. The LCD should toggle between binary text messages HIGH and LOW. Here is a reference video that shows the full operation of the prototype logic probe.
There’s lots more you can do here, now that the basic project is complete: consider changing the LCD messages to reflect other ways to convey the binary data. You can also adjust the Raspberry Pi Pico W's blink rate and observe the RoundyFi LCD's response. But, most of all - make sure to congratulate yourself on a project well done!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum