DIY LoveBox OLED

by Danni_Innit in Circuits > Gadgets

1394 Views, 7 Favorites, 0 Comments

DIY LoveBox OLED

image0.jpg

Do you know someone who lives far away and do you want a fun way to communicate with each other? Then this is the ultimate guide for you! We're going to make the screen connect to Adafruit IO to control all the messages.

Supplies

3d printer. (Doesn't matter which one. And it's optional if u want to make your own enclosure.)

Wemos D1 mini: Amazon: https://amzn.to/3w3xtws (NOTE: This is a 3 pack!), AliExpress: https://bit.ly/2Ta6ZfC

Mini OLED Screen: Amazon: https://amzn.to/3hhfGN1 (NOTE: This is a 4 pack!) AliExpress: https://bit.ly/3y0zVW3 (NOTE: Color doesn't matter, as long as it has 4 pins.)

Cables For Connections: Amazon: https://amzn.to/3AdsIUC , AliExpress: https://bit.ly/2UeqvHC

Wiring the Components

Schematic.png
93f5c962-fae1-4ecb-977e-d9d1ac073284.jpg

To make everything work we need to wire everything.

You can follow the image diagram or use this:

G = GND

5V = VDD

D1 = SCK

D2 = SDA

You can solder the cables afterwards to make it compact but this is for testing if it works.

Setting Up the Libraries.

Library.png

First we need to download the Adafruit SSD1306 library.

1. So we're going to go to Sketch>Include library>Manage Libraries.

2. Search 'SSD1306' and select Select Version and click version 1.3.0 and install.

3. Search GFX and select Select Version and click version 1.5.6 and install.

4. Search Mqtt and install ArduinoMqttClient and Adafruit MQTT Library.

5. Close the library window and go to File>Preferences and paste https://arduino.esp8266.com/stable/package_esp8266com_index.json in the Additional Boards Manager URLs, press OK and close the preferences menu. Open the library menu again (step 1) and search ESP8266 and scroll down to Adafruit ESP8266 and install it. Make sure its on version 1.10 incase it updates and breaks something.

The Code

Changing the Code.

AdafruitSettings.png

To make the minicomputer connect to your Wi-Fi and Adafruit IO we need to change some code.

In the code scroll down to

/************************* WiFi Access Point *********************************/

#define WLAN_SSID "MyWifiNetwork"

#define WLAN_PASS "MyWifiPassword"

/************************* Adafruit.io Setup *********************************/

#define AIO_SERVER "io.adafruit.com"

#define AIO_SERVERPORT 1883 // use 8883 for SSL

#define AIO_USERNAME "xxxx"

#define AIO_KEY "xxxx"

/********************************************************************************/

Change the WLAN_SSID to your Wi-Fi name/ssid. For example "MyWifiNetwork".

Change the WLAN_PASS to your Wi-Fi password. For example "MyWifiPassword".

Then we'll need to make a profile on https://io.adafruit.com/

When you made your profile you can make a dashboard.

Press New Dashboard if you're in the dashboard menu, name it for example "MessageDashboard" and make the key that name as well.

In the dashboard add a new block and name the feed ShortText and in the settings change it to the settings in the given image. (NOTE: Make sure u call the feed name exact the same as given, otherwise it won't work.)

Next make a block called LongText and in the settings change it to the settings in the given image but change the name to LongText. (NOTE: Make sure u call the feed name exact the same as given, otherwise it won't work.)

When that's done go to the "My key" tab on the top and copy your key in the "#define AIO_KEY "xxxx" " and change the #define AIO_USERNAME "xxxx" to the username you made.

Uploading.

BoardSelector.png

Now we're going to upload the code to the Wemos D1 mini.

Before we upload the code we need to verify that the code doesn't have any errors. You can do that by pressing the check button in the top left corner.

If that confirms your code is good then we can upload the code. You can do that by first plugging your Wemos D1 mini in your pc with a Micro-USB cable. Then going to Tools> Board> ESP8266 Boards> NodeMCU 1.0 (ES{-12E Module). And then select a port and the port is probably the second one but if u don't see it, use another cable or try using this tutorial to install the Wemos D1 mini drivers Tutorial for Wemos D1 mini Drivers.

When u have selected the right board and port you can upload it! (The right facing arrow next to the verify button)

Making a Enclosure!

Now you're done making you're screen you can make a little house for it!

You can 3d print something for it or make something from cardboard!

3D file for enclosure for 3d printing from Thingiverse

Done!

And you're done!

Now you can make another one and make a second account for the second screen and change the Wi-Fi credentials.

Have fun!