OLED HAT with LEDs

So, I thought I’d try my hand and designing and putting together a PCB.

This is the template I’ve come up with, I’ve just ordered the PCB and components and will update this thread with progress.
It may fail, it may work :slight_smile:

I’m hoping it works. If it does I will make the PCB files available for download / share them with Dmitri to add into this amazing project :slight_smile:

PCB

2 Likes

Woah, that looks awesome! I would love to add it to the project. Heck, I’d even make one for myself! I look forward to updates on your progress. Thanks Paul!

Kind regards,
Dmitri

If it works, then everyone is welcome to download the files (don’t want to upload them until I’ve tested my one :slight_smile: ). They’re created in EastEDA and you can order straight from their site through JCLPCB. Which is convenient :slight_smile:
The parts are going to be a couple of weeks in total and then time to make sure I solder it correctly etc.

If I manage to get a Pi Zero at any point I might try and do a HAT for one of those to. Although (if this works) this one should work as the GPIO is the same.

Next step will be to design a case around this layout :slight_smile:

1 Like

Any news? I really look forward to seeing the result. :slight_smile:

Hi.

I’ve got some of the parts (PCB etc), but I’m waiting on the connectors. I’m also looking into moving away from having a connector that loops round the board, as I’ve realised now (that I’ve ordered everything etc) that I should be able to use VIA’s instead. The joys of learning something new :smiley:

Once I’ve got it put together and tested I’ll upload another shot.

1 Like

Thank you very much for the update, Paul! Good luck with the project, and I can’t wait to see the final result.

Small update on this. I have decided to order V2 of the board, before getting V1 up and running.
As on further investigation I realised I missed a resistor off of the Activity Light LED, and when I researched this I found it can cause issues with burning out the board / GPIO.
So I’ve now added a resistor on this LED as well. And also changed the design so you should only have to solder the GPIO pins and OLED.
I’m hoping that this is a better long term solution. A costly mistake, but at least I didn’t damage my Pi :slight_smile:

Anyway, I also now have a Pi Zero. So if this HAT works, that will be my next project.

1 Like

So. After much waiting. I have progress. V2 of the board was delivered today.
I need to add some coding in for the LED’s, but here is what it looks like!
Please excuse the messy desk :slight_smile:
Green LED I was intending as Activity (Right LED) and Red = Power (left LED).

I connected them to GPIO17 & 22 (17 = LED1 = Power, 22 = LED3 = Activity)

1 Like

My only criticism is that I used a generic template for the 0.96" OLED, and the holes for the standoffs don’t line up.

Without the OLED or LED’s lit, and without soldering (I ordered 10 of the boards, so have a few spares)

1 Like

I love it!

1 Like

I’ll forward you on the EasyEDA files. I had it manufactured by JLCPCB and had them do the surface mount LEDs, then just soldered the GPIO pins and OLED :slight_smile:

1 Like

Progress update on this. Gen 3 of the board is being shipped as we speak.
I’ve changed the way I do it, so that all of the components are manually soldered. My view on this is that it will give the person producing the board greater control over the components (e.g. LED colour etc).
It also includes a fan cutout for a 30mm 5v fan.
Once I’ve received the boards, I’ll solder one up and test it and then post pictures and provide the Gerber files to Dmitri to include (if he wishes :slight_smile: ) in the project.
I’ll also provide a parts list (recommended).

5 Likes

Are the Gerber files for the OLED board posted somewhere?

Hi Tom,

The Gerber files for version 3 as yet aren’t publicly available as I’m just ensuring the end result works as expected. Testing so far seems A-OK, so I will provide them to Dmitri once I’m happy with them.

V2 I think may already be available, but as this is Dmitri’s “baby” I’m not 100% sure. I’m hoping to have the files available soon. As the tests seem fine so far.
I’m going to provide some photos with the Gerber’s to Dmitri once all is OK.

Hope this clears it up for you Tom :slight_smile:

It’s been a while since I posted an update. But I’ve still been working away.
Have been trying to add / write some of my own code to do little extras. This is my current setup.

Fan running from GPIO, temp control to kick in at a given temp. Bar LED for storage space usage (e.g. 10% 1 LED = lit, 20% 2 LEDs lit, etc). The storage usage control is done by the Pi, but offloads the LED lighting to the Pico. I started running out of GPIO headers, so this seemed logical.

Now using a Pi 4 2gb model, and a USB 2 > Sata adapter, whilst there are faster options (I have a USB 3 M.2 container) the trade off of speed over storage space seems worthwhile. And as it’s still USB, I can swap out at any point :slight_smile:

The next step is going to be a larger PCB to connect this all up to (about the same size as a 2.5" SSD) and then installing it into a case.

Wow, that’s really impressive! I’d be interested in seeing the code used to display storage usage. :wink:

And I really look forward to seeing the final result!

Kind regards,
Dmitri

The code is quite simple, and could be adapted to use GPIO (as this is how I originally used it).

This is the basics to check the space available (Python script):

Start

import os

total = 100
#disk = os.statvfs("/media/pi/UBUNTU 20_0")
#totalBytes = float(disk.f_bsizedisk.f_blocks)
#totalUsedSpace = float(disk.f_bsize
(disk.f_blocks-disk.f_bfree))
#totalPercent = round((totalUsedSpace / totalBytes) * 100)
totalPercent = 0 # USED FOR TESTING LEDs WORK, UNCOMMENT THE ABOVE TO USE LIVE :slight_smile:

print("total %: ", totalPercent)

if totalPercent >= 95:
os.system(‘ampy --port /dev/ttyACM0 run “[Folder Location]/Pico/95_perc.py”’)
exit()

Then in the relevant .py file

from machine import Pin
diskspace0 = Pin(16,Pin.OUT) # CHANGE TO WHICHEVER PIN
diskspace0.on()

Please note this IS NOT my code, I can’t recall the source. I have the page saved and will add the relevant credit before I use it.

1 Like

Thank you! :slight_smile: