Can Google’s New AI Read Your Datasheets for You? [Hackaday]

View Article on Hackaday

We’ve seen a lot of AI tools lately, and, of course, we know they aren’t really smart, but they sure fool people into thinking they are actually intelligent. Of course, these programs can only pick through their training, and a lot depends on what they are trained on. When you use something like ChatGPT, for example, you assume they trained it on reasonable data. Sure, it might get things wrong anyway, but there’s also the danger that it simply doesn’t know what you are talking about. It would be like calling your company’s help desk and asking where you left your socks — they simply don’t know.

We’ve seen attempts to have AI “read” web pages or documents of your choice and then be able to answer questions about them. The latest is from Google with NotebookLM. It integrates a workspace where you can make notes, ask questions, and provide sources. The sources can be text snippets, documents from Google Drive, or PDF files you upload.

You can’t ask questions until you upload something, and we presume the AI restricts its answers to what’s in the documents you provide. It still won’t be perfect, but at least it won’t just give you bad information from an unknown source.

The Hackaday Badge

To try it out, we decided to see how good it would do if you were too lazy to read the programming manual for the 2023 Hackaday Badge. Once you’ve signed into NotebookLM, you create notebooks. Each notebook has its own set of references and notes. In this case, we have only a single source — the PDF manual.

We’ve called AI “the worst Summer intern ever,” and this isn’t far off here, either. My first question was how to make some code run every two seconds. The first two answers advised me to use asyncio.sleep(2) , which isn’t technically wrong, but it assumes I have control of the CPU to start with. Of course, I know the answer I’m looking for, so it is easy to dismiss it, but if this were something I really needed help with, it might take me some time to realize this is a dead end.

A more specific question helped:

How do I have VectorOS run my code perodically?

You can use the Timer class to schedule a function to run periodically. The timer’s base rate is set in vos_launch (timer_base_rate in milliseconds). All timeouts are computed against that base rate. The base rate should not be too fast (e.g., 10 milliseconds is probably too fast, and you will get recursion errors as the timer’s loop overruns itself). The default is 100 milliseconds.

Here is an example of how to use the Timer class to run a function every second:

import timer

def my_function():
  # Do something

timer.add_timer(1000, my_function)
The whole transcript of my badge queries.

Interestingly, I asked essentially the same question twice and got correct, but subtly different, answers both times. The first time I used “How can I…” instead of “How do I…” and the program provided more detail. It also suggested ten references in the document for the first question, but only one for the second question which seems odd given that the only difference in the query was using do instead of can.

On the other hand, it did get there. I then asked it what a slot was. I think that was a good example, because, in the real world, a slot could mean any number of things, but for VectorOS it has a very specific meaning. Here’s what the AI had to say about that:

A slot is a function that takes a single argument, a Vectorscope object. The Vectorscope object is used to produce analog voltages for display on the oscilloscope screen. When you create a slot, you register it with VectorOS by editing the vos_launch.py file. The entry must be in the vectorscope_slots dictionary. Slots named slotA, slotB, slotC, and slotD will run when you press the A, B, C, or D button from the menu screen.

Slots can be launched from other programs as well. To do this, call vectoros.launch_vecslot with the name of the slot.

Of course, all of this is in the manual. But it is nice to be able to just ask and let it sift through the nearly 50-page document. In this case, we only have one source, but the program does give you a short summary of the source and lets you enable or disable certain sources whenever you like.

Upgrading Printers

I did a 3D printing class for 8th graders last summer. To support that, I bought a “returned” Ender 3 V2 Neo printer and spruced it up so I’d have an extra cheap printer for the kids to use. But now I’m thinking of upgrades for it. It would be cool if the notebook could search the Web — it is from Google, after all. But it can’t.

I took a few different approaches to loading in sources. First, I found the Ender 3 manual and uploaded it as a PDF. I also grabbed a few websites and either pasted text in or printed them as PDFs to load. In most cases, I used reading view to strip away all the extra stuff before I printed the PDFs on the assumption that would help.

In the end, I had seven different sources. One was a Reddit thread that didn’t print out very nicely but had some good information.

I asked the notebook to tell me about some simple upgrades I could do to the printer. It came up with a reasonable list, including using better tubing, a quieter fan, and some others. It also provided three links that were relevant. However, don’t make the mistake of thinking it really understood what was going on. For example, it offered auto bed leveling as a suggestion. However, the V2 Neo already has bed leveling. It also suggested replacing Bowden tubing and using a direct drive extruder. Nothing wrong with either of those suggestions, but you would not do them together. It also suggested several mods to a hot end that isn’t stock on the printer without clarifying that those would only apply if you had already upgraded the hot end.

To be fair, this is the “bad summer intern” effect. The AI doesn’t know anything about this topic except what we tell it via the sources. I’m sure the sources talked about all those things. So if you told some newbie to read all those documents and then asked questions, you might get the same kind of answers.

The Pi Pico

There are many PDF files related to the Raspberry Pi Pico, so that seemed like a good notebook to create. However, trying to add the main RP2040 datasheet dies with no error message. I suspect it is too long at around 700 pages. I was able to add several other documents, though, including the PDF version of the Arduino package documentation. Finally, I split the datasheet into four parts and that seemed to do the trick. Sadly, you can’t upload multiple files, so it took four separate uploads to get it going.

In the end, I had ten different documents to sift through (although four of them were the large datasheet). The notebook was able to answer basic questions like how many DMA channels were available, what was the smallest DMA transfer possible, and if the pins were TTL compatible.

It was also able to answer some tougher questions, like which Arduino functions use the PIO system. Before you get too impressed, though, it later informed me that the RP2040 doesn’t have an I2C slave mode, only a master mode. Then, in the next answer, it told me that the I2C slave mode runs at 100 kHz, and the chip does not have an I2C master mode. Those answers were in response to it telling about the SPI clock limitations when I had asked about the master clock. Not its finest hour.

Granted, you at least can click on the references it provides to see what part of the document it is misinterpreting. But if you have to do that much work and — more importantly — know that much about it to begin with, maybe the tool needs some work. True, this is an early release so it will probably get better.

Garbage In, Garbage Out

There is no doubt that a tool like this can only be as successful as the data you put into it. However, the errors we saw here were more misinterpretations of the provided data that a human would have been less likely to make.

Impressive? Sure. But think about the use case. If you already know a lot about the RP2040, for example, you might have just done a web search for those questions. Or even searched for keywords in the PDF. It probably would have been as fast once you deduct the time deciding if the answer seems legit or not. The real power of this kind of tool would be for people who don’t know the topic and don’t have the background to think about how to find things like this. Imagine a ship at sea with no doctor an AI version of the Merck Manual. You hope it would do better than this.