Hackster will be offline on Friday, March 1 from 9pm to 10pm PST to perform some scheduled maintenance.

Dr. DIY's Digital Level Is Built Based on ChatGPT's Source Code and Wiring Instructions Outputs

Using a TDK InvenSense MPU-6050 for a digital level isn't novel, but relying entirely on ChatGPT for the wiring and source code is.

Gareth Halfacree
2 months ago3D Printing / Sensors / HW101

Pseudonymous YouTuber "Dr. DIY" has built a digital level to assist with some household projects — turning to OpenAI's controversial ChatGPT large language model (LLM) for the code required to get the device up and running.

"While I was working I had an idea: I thought it would be really cool to have one of those digital levels that I had seen online and in hardware shops, just to make things a little bit easier," the good doctor explains. "Then I had another idea: I thought to myself that I could use my 3D printer and some really basic electronics to make my own level, which means that my readings would be more accurate, easier to read, and most importantly it just sounds like it would be good fun to do."

Dr. DIY's suitably do-it-yourself digital level is built around a TDK InvenSense MPU-6050 three-axis accelerometer and gyroscope, as found on the popular GY-521 breakout board. This sends its readings to an Arduino Nano board, with an OLED panel providing the resulting angle measurement — all housed in a custom 3D-printed case designed for easy pocket-carry.

Coded by ChatGPT, with some "trial and error" by its human prompter, this digital level uses a TDK MPU-6050 sensor. (📹: Dr. DIY)

Rather than write the code himself, though, the doctor turned to a different tool: OpenAI's controversial ChatGPT, a large language model (LLM) originally built for conversational use but capable of churning out code snippets in a variety of languages modern and ancient — based, critics note, on hoovering up source code from projects under a variety of licenses with little regard to how the output will be used.

"After a bit of trial and error," Dr. DIY admits, "I was able to get the exact program that I had in mind," including information on wiring everything together. "Once I had all the instructions from ChatGPT, I wired everything up as it instructed. [Then] I fired up Fusion 360, made a little mock-up of the circuit board and the battery pack, and then modeled the case to go around everything, which I then sent off to the 3D printer."

The full project build is detailed in the video above, and on Dr. DIY's YouTube channel.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles