ArkenPi – Origins (hardware)

Final list of materials:

  • Raspberry Pi 3 Model B
  • MicroSD Card (32GB)
  • Adafruit PiTFT 3.5″ PLUS Touchscreen
  • Lithium-Ion Polymer Battery (1200mAh)
  • Wireless Bluetooth Keyboard
  • 5.5V to 3.3V step down converter
  • Adafruit Powerboost 1000c
  • Female USB Connectors
  • Male USB Connectors
  • MicroUSB POWER ONLY Cord (short)
  • Power switch
  • Wifi Adapter (optional)
  • 2x 3mm LEDs
  • 2x 200ohm resistors
  • A 3D Printed case OR hack your own out of hard drive cases

Tools:

  • soldering station
  • pliers (round nose)
  • tweezers
  • knife
  • wire cutters
  • solder
  • hookup wire (stranded recommended)
  • electrical tape
  • hot glue gun + glue
  • (opt) helping hands
  • patience

Before assembling anything, I had to get the Pi3 to boot with the Adafruit PiTFT plus, which was a pain in the butt. The adafruit website declared,

“The display uses the hardware SPI pins (SCK, MOSI, MISO, CE0, CE1) as well as GPIO #25 and #24. GPIO #18 can be used to PWM dim the backlight if you like. All other GPIO are unused.”

I found that to be false info. I scratched my head trying to figure out how to find which pins were being used and which ones weren’t, and I came up with the brilliant and monotonous idea of connecting 40 jumper wires from the PiTFT to the Pi 3. I disconnected each pin one at a time to see if it would boot correctly, then removed the jumper wire if it wasn’t needed. In thirty minutes, I had the right pins to get the Pi to boot onto the TFT.

https://openclipart.org/image/2400px/svg_to_png/280972/gpiopinsv3withpi.png

Using the chart above helped a lot (credit to whoever’s chart it is), and here are the GPIO pin numbers I came up with, and their functions:

pin 1 - 3.3V PWR

pin 2 - 5V PWR

pin 9 - GND

pin 18 - GPIO24 (GPIO_GEN5)

pin 19 - GPIO10 (SPI0_MOSI)

pin 21 - GPIO9 (SPI0_MISO)

pin 22 - GPIO25 (GPIO_GEN6)

pin 23 - GPIO11 (SPI0-_CLK)

pin 24 - GPIO8 (SPI_CE0_N)

pin 26 - GPIO7 (SPI_CE1_N)

pin 27 - ID_SD (I2C EEPROM)

pin 28 - ID_SC (I2C EEPROM)



Assembly:

img_5217

I had to wait three to four days for the case to finish drying, but boy, was it worth it!

I started by desoldering the Li-Po battery from the inside of the bluetooth keyboard, attaching to the leads the 5.5V to 3.3V step down converter.

img_5183

The Vout of the step down I soldered go to the 5V and GND through-holes on the Adafruit Powerboost 1000c.

I left the original USB port on the adafruit powerboost and permanently soldered it to the board.

img_5184.jpg

I figured it would be easier to use a well off microUSB cord than to play around with making my own with hookup wire. Fortunately, I had an older (and shorter) microUSB cord that was just for power, not data transfer, so I used that. I wasn’t able to fit the microUSB cord through the holes in the case, so I stripped off the plastic cover to reveal the wires, and I soldered those onto the Pi. I checked with a multimeter which pads were 5V and GND, so I knew where to solder.

img_5185img_5172.jpg

In the end, I decided to forget attempting to get 12 hookup wires through the holes in the case, and I resoldered a 2×20 GPIO header onto the Pi and connected the PiTFT on top of those (like it was intended to be used).

In the case, I drilled two holes for a power light and a low battery light. All of these I soldered from the adafruit powerboost, so I rigged up my 3mm LEDs.

img_5186
I wrapped a 200ohm resistor around the stripped wire, soldered the two joints, then trimmed the wires.

I accidentally burned out an LED before realizing that the resistor was in parallel, therefore not allowing the full resistance to get to the LED. I trimmed the wire after that. (below)

img_5190
My solder joints are pretty ugly, I know. But I promise I made them nicer! I also covered that part of the wire in electrical tape.

img_5191

Next was to solder hookup wire to the male USBs:

I made each one a different length, since the female USBs were different lengths away.

img_5218.jpg
Hot gluing the solder joints was a life saver for me, because if you bent the connections/wires too much the joints would break off.

After putting each USB in, I had to bend and twist the wires so the Raspberry Pi and PiTFT still fit snugly in the case, with the wires bent around it.

I soldered the 3 green wires to the Vs, EN, and GND through-holes and connected them to the power switch (not shown). The USB cable soldered to the pi I plugged into the socket, and in the top right hand corner I used a multimeter to find the polarities of the Low Battery LED pads, and soldered one of the 3mm LEDs to that.

Under that swarm of wires I placed the LiPo battery and taped it to the bottom with electrical tape.

Soon after, all I had to do was plug in the LiPo to the Powerboost 1000c, put the bevels in place, and watch the magic happen (the tape is on the top because I haven’t decided on a good way to secure the bevel yet).

img_5227.jpg

img_5232.jpg

Viola!! My very own portable linux computer. SO EXCITED!!

And yes, that is Doctor Strange as my background. 😉

I’m feeling very accomplished about this, and I hope this walk-through has entertained you or inspired you to make one of your own.
If you have any questions about things I did, don’t hesitate to contact me!

Until next time.

{thallia}

Advertisements

ArkenPi ~ the touchscreen (Adafruit PiTFT Plus 3.5”)

After hours of errors, outdated repos, and problem solving, I have finally gotten ArkenPi’s screen working!


Here’s how I did it:

First, install the most recent form of Raspbian. Turns out, the kernel is already updated to work with the Adafruit PiTFT 3.5″ PLUS, so you don’t have to download it from the outdated, unauthorized apt.adafruit.com repositories (thank goodness).

Boot into your Raspbian OS and make sure you’re connected to a network, either way of ethernet, wifi adapter, or wirelessly (if you have a Pi 3). Go ahead and change your root password with passwd, then get into the raspberry pi configuration station.

Enter raspi-config into your terminal, and here’s what we’re gonna do:
1) Expand the filesystem
2) Change the default Pi account password
3) Enable Boot to Desktop (already signed in)
4) Enable Wait for Network at Boot
5) If you so wish, change your timezone
6) Set your hostname (the name of your pi)
7) Enable SSH (very handy if you run into errors)

Then select finish, reboot, and you’ll be set to go!

Once your Pi has rebooted, login as root sudo -s, and head back to raspi-config.
Head to Update, and update all the raspberry pi config settings. After that you’re free to exit.

Next, in a terminal, run apt-get update && apt-get -y upgrade.
Then you’re going to download some code from github.

Use wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source to download it and put it somewhere.
We’re going to use chmod to make it executable like this:
chmod +x /usr/bin/rpi-source
then /usr/bin/rpi-source -q --tag-update.

After that, the guide I linked to in the previous post told me to wget some more driver code, but that code was outdated and removed from the repository. I didn’t really understand what the code was for, but I’m glad I looked.

The code was to initialize a GPIO pin as a power switch. That was a great idea and all, but I have another way of doing it hardware-wise which was much easier to figure out.

Next, we’re going to cd back to the Home directory and install the adafruit helper:
wget https://github.com/adafruit/Adafruit-PiTFT-Helper/raw/master/adafruit-pitft-helper
chmod +x ./adafruit-pitft-helper
and to run it, ./adafruit-pitft-helper -t 35r
Now, as shown above, the -t stands for type, and then you specify which PiTFT you have for your Raspberry Pi. Since mine was the 3.5″ Resistive touchscreen, 35r was my choice.

Finally, you can run shutdown -h now, set up the PiTFT on your RPi, and reboot to see it working!

Now, if you were like me, a few weird things happened when I started up. First, the Pi was still outputting the desktop onto my HDMI console, and only part of the boot process was actually showing up on the PiTFT.

In my config files, I made sure /etc/X11/xorg.conf.d/99-fbdev.conf had the line /dev/fb1 in it (wherever it was), because fb1 is the PiTFT output.

To fix this, I pressed Ctrl+Alt+*all the Fx keys*. Eventually one of the screens shifted to a login screen to my Pi, but logging in didn’t work. I would enter the right password, the screen would turn black with an underscore in the top left corner, then it would take me back to the login screen.

Turns out there’s a pesky little file you’ve got to delete:

sudo rm /home/pi/.XauthorityOnce I deleted that and rebooted, my PiTFT successfully displayed my desktop screen. Woohoo!!

Many times if I goofed and couldn’t access the desktop because I accidentally enabled boot-to-console, I would SSH into my raspberry pi. I must say I love SSH, I could do it all day. It’s such a cool thing to do. 😀

The only thing I’m struggling with now is actually getting the touchscreen calibrated the right way, which isn’t working.
I’m taking a break from the software side of this project to get oriented with how I’m going to put it all together in my 3D printed case, which is almost done. We’re getting to the exciting part of this now!