Skip to content

AI-X-Pico / W5100S + Pico + Arducam

AI bot that "tweet" what it sees

Alan

Published August 22, 2023

AI-X-Pico / W5100S + Pico + Arducam

Components

Hardware components

Project description

I worked on an interesting project. 

It's a project to post what Pico saw on Twitter. It looks as if Pico is alive.

 

I was inspired when I saw the project that Benjamin worked on.

The link below is a project that captures an image, analyzes the image with AI, and presents it as a text. Please refer to the link below for more information.

Translating Visuals into Words: Image Captioning with AI

AI-X-Pico / W5100S + Pico + Arducam

I have to send the text from this project to GPT and send the data to "X". GPT API is simple to use.

W5100S Ethernet Connection

Let's send the data to the device via Ethernet communication before we trim it slightly in Chat GPT.

W5100S Ethernet Connection
 

https://github.com/Wiznet/RP2040-HAT-MicroPython/blob/main/Ethernet%20Example%20Getting%20Started%20%5BMicropython%5D.md

The library using the Wiznet Ethernet Chip on the RP2040, Pico's MCU, is located at the link above.This library allows you to simply attach W5100S to Pico.

Replicate

It's detailed in Benjamin's project. It's using an API, but you need to issue an API key. The function is set like this.

W5100S Ethernet Connection

And code as below. Saves the text received through the API to x_message.

W5100S Ethernet Connection

Chat GPT API

First, you need to get an API key. You can simply get it issued from the link below.

GPT API

W5100S Ethernet Connection

Code for GPT. I'll simply decide on the role.

W5100S Ethernet Connection

Combine the text I received from the reply I received earlier with the text I will send to GPT. I asked them to leave a simple sentence on SNS.

W5100S Ethernet Connection

IFTTT

You can easily proceed by checking the link below.

Writing discord messages / W5100S + Pico
Writing discord messages / W5100S + Pico

Instead, "Then" selects "Post a sweet with image" as shown in the image below.

Writing discord messages / W5100S + Pico

And add Value1 and Value2 respectively. complete!

Writing discord messages / W5100S + Pico

Twitter has created a new sub-account. The above IFTTT is linked to this account.

Writing discord messages / W5100S + Pico

And you can use IFTTT like this.

Writing discord messages / W5100S + Pico

image url enters the capture url of Arducam.

Complete

It's done! I'm going to do the move now. Unfortunately, it is difficult to show this child a good view.

When a child is born, wouldn't it be better to see the father first, just like the parents first?

I'll show you the father of the child. The CEO of Raspberry Pi is Eben Upton. I'd say he's the father of the Pico board.

Fortunately, there is a picture of him on Twitter.

Writing discord messages / W5100S + Pico

Show the father's face to the child. I'm really curious what kind of answer he'll give.

Writing discord messages / W5100S + Pico

He answers with great fun. hahaha.  Even the tag is perfect. 

Writing discord messages / W5100S + Pico

That was an interesting AI-X-Bot project.

Documents

Comments

Comments