MEMS and Sensors

ChatGPT prompts for electronics engineering and PCB design

08 August 2023
New capabilities for ChatGPT allow users to get much more specialized data than when the system first came into existence last year. Source: Gerd Altmann/Pixabay

It’s been about a year since the release of ChatGPT in 2022. Once the platform opened itself up to public access, every industry began looking at the use of AI-based systems to increase productivity, including electronics engineering. This skill-heavy and knowledge-heavy area of engineering requires extensive knowledge synthesis and hands-on experience, so one might wonder where a generative system like ChatGPT can fit into this field.

Unfortunately, without a bit of prompt engineering and pushing for clarification at overgeneralized answers, generative AI models like ChatGPT will give overgeneralized or wrong results. The accuracy problem with highly technical information generated from a generalist system like ChatGPT is well-known. Although the results are not perfect, there are simple things a user can do to force ChatGPT to give more useful results in highly specific tasks.

What can you engineer with ChatGPT?

Before looking at what you can create with ChatGPT, it’s important to know what ChatGPT can do. When the system was originally opened to the public, it was possible to tweak custom models and carry on conversations with ChatGPT. That meant the results you were able to pull from ChatGPT were heavily dependent on prompt engineering. In other words, you would need to provide the following information:

  1. Clearly state what the information is that you are seeking and what you are not seeking
  2. State what the system should and should not do (more specific is better)
  3. State how the answer should be formatted (word length, tables, bulleted lists)
  4. State the tone of the answer (professional, informal, advanced versus simplistic)

This leads to a lot of very useful knowledge generation, but the results were perpetually based on knowledge delayed by approximately one to two years.

New capabilities in the system now allow users to get much more specialized data and information. The standard model running in the background likely contains the information you need, but it is crowded with noise from generalist information that may not provide actionable advice for an engineering query. The newest capabilities in ChatGPT are provided by Bing, as well as third party plugins:

  • Web search and browsing capabilities
  • Reading specific URLs provided in a prompt
  • Reading PDF files
  • Reading transcripts from videos
  • Retrieving information from scholarly publications
  • Code interpretation and bug finding

Now that we know what these systems can do, and how to engineer prompts, here are some engineering tasks you can perform with ChatGPT and the integrated third party plugins.

Industry standards

One set of data that changes slowly and is likely still encoded in ChatGPT’s dataset is industry standards. While the exact text in industry standards is locked behind a paywall, so much has been written about these standards that ChatGPT can provide a reasonably accurate list of standards relating to ESD testing for commercial products; and a list and short description of test procedures used to determine the dielectric constant of transmission lines on a PCB.

Learning from datasheets and app notes

Now that ChatGPT can be used to search the web, including specific links to PDFs found online, it can be used to gain data from datasheets and app notes. Rather than hoping ChatGPT generates data from your specific app note or datasheet, you can give the system specific URLs and query knowledge from it. Some simple prompts include:

  1. Provide a description of the main functions and features of component <insert MPN> using the information found at this link: <insert URL>
  2. Calculate the range of capacitor values required on Pin X on component <insert MPN> using the information found at this link: <insert URL>

For this application, specificity really matters. You may need to specify much more than the URL and MPN; use component features, specifications and page numbers as part of the prompt to make your request more specific.

Basic calculations

Most engineering tasks require some basic formulas and calculations. These calculations could be surrounding circuit design, component selection, or PCB design. Some examples include:

  1. I have a custom transformer for a flyback converter. Calculate the primary coil inductance, turns ratio, and output voltage/current if my input is mains voltage.
  2. A switching regulator has a total inductance of 10 uH and exhibits significant ringing with 300 mV amplitude. If my switchers are <insert MPN>, how much capacitance do I need to reduce overshoot?

This is best used and verified when the designer already has some experience in the field where the calculations apply but does not have the formulas memorized. The basic calculations used are typically well-known, but there is the possibility that ChatGPT does not use the formulas correctly. For example, it may omit an exponent or apply the wrong formula by mistake. It is your job to vet the results and be able to spot when a formula might look incorrect.

Code generation for embedded systems

Writing and examining code is not new for ChatGPT, but the challenge with embedded systems is that they are heavily syntax specific. Now with the ability to search the internet and read PDFs, it is possible to generate processor-specific code from standard languages with the right set of prompts. This is another area where specificity greatly matters, and your prompts should typically include the following:

  • State the language you wish the code to be in
  • Request that the generated code include all dependencies as imports
  • Request code be generated on a function-by-function basis
  • State the specific data types that will be used as inputs and outputs
  • If the output data is alphanumeric, make sure to specify relevant formatting/encoding
  • Provide links to any libraries, datasheets, code/bringup guides

Code generation sometimes requires a series of prompts, where the user requests tweaks to the code or provides feedback to the model about errors. Code generation also requires the user to compile the results into an application, so you need to have programming knowledge and you should not expect ChatGPT to spit out a ready-to-use codebase.

What about other GPT-based platforms?

ChatGPT remains enormously popular with a simple subscription option that allows access to all the capabilities shown above. In addition, there are third party models and platforms that build on ChatGPT through an API, giving additional capabilities for generative AI. While ChatGPT and these related platforms can’t complete your designs for you, these systems can give you additional capabilities that can become part of your engineering workflow.

Just remember, all of these alternative platforms rely heavily on prompt engineering. If you don’t engineer the prompt properly, don’t be surprised when the results are overgeneralized or inaccurate. As AI platforms gain more ability to communicate with other digital systems and perform interactive tasks, continue to focus on prompt engineering as a way to ensure you get the best results with minimal tweaking and supervision.

To contact the author of this article, email GlobalSpecEditors@globalspec.com


Powered by CR4, the Engineering Community

Discussion – 0 comments

By posting a comment you confirm that you have read and accept our Posting Rules and Terms of Use.
Engineering Newsletter Signup
Get the GlobalSpec
Stay up to date on:
Features the top stories, latest news, charts, insights and more on the end-to-end electronics value chain.
Advertisement
Weekly Newsletter
Get news, research, and analysis
on the Electronics industry in your
inbox every week - for FREE
Sign up for our FREE eNewsletter
Advertisement
Find Free Electronics Datasheets
Advertisement