#i2cinfrared
Explore tagged Tumblr posts
adafruit · 1 year ago
Text
youtube
JOIN US! TONIGHT 9PM ET Sept 3, 2023 - Desk of Ladyada - ChatGPT-assisted driver programming & I2C Infrared Proximity Sensors 🔧🤖🔍
This week at the Desk of Ladyada, we've been on a "try to use ChatGPT every day" experiment to see how to use LLM tools for engineering. This week, we had fun using it to write Arduino drivers for chips by uploading the chip datasheet for analysis and guiding the LLM through how to write an 'adafruit' style driver. After all, it's been trained on hundreds of ladyada-written libraries on GitHub. https://github.com/orgs/adafruit/repositories. 
Here's the chatGPT log for a video we published last night https://chat.openai.com/c/f740eb57-17a6-41e3-ae0a-12da959a1f4c - and here's a previous one that is more 'complete' https://chat.openai.com/share/f44dc335-7555-4758-b2f9-487f9409d556. The amount of time it takes for ChatGPT to write a driver is about the same as it would take manually, and you definitely need to be eagle-eyed to redirect the AI if it starts making mistakes... but we think with some prompt hacking, we can speed things up by front-loading some of our requirements instead. It's still very early in our experiments, and many things are challenging/hard for GPT 4 to do, so you just have to try them!
The Great Search - I2C Infrared Proximity Sensor
The driver that we used ChatGPT 4 to write is for the VCNL4020 https://www.digikey.com/short/dpz897jj, an 'all in one' IR proximity sensor. These sensors work by bouncing bright IR light off a surface and measuring how much returns. The IR light is modulated and relatively resistant to ambient light interaction. One of the first sensors we ever used was the Sharp GP2Y https://www.adafruit.com/product/164. It is famous for its ease of use in the days before cheap microcontrollers provided 5V power, and an analog signal that roughly maps with distance is emitted. While you can still get analog distance sensors https://www.digikey.com/short/d21wnm5c, I2C interfacing lets you get data quickly and adjust for lower power usage. Let's look at some digital IR proximity sensors and other distance sensors (and the differences between them!)
0 notes