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

4x4x4 Rainbow LED Cube (hardware)

Materials:

  • 64 LEDs – 3mm
  • Resistors (you can calculate the amount of resistance you need, I used 200ohm)
  • a through-hole generic PCB board
  • Wooden board (not huge, just big enough to stick the LEDs in to solder the layers)
  • Hookup wire
  • Male-to-male jumper wires
  • Craft wire (I used 0.8mm)
  • Jumper wires
  • Elegoo Uno (I bought the Elegoo knockoff of an Arduino since I didn’t have a ton of money, it works exactly the same!)
  • A LOT of solder

Tools:

  • Soldering station
  • Drill (with 3mm OR 1/8in drill bit)
  • Wire cutters and strippers
  • Round nose pliers
  • crocodile clips (very, very useful)

 

Step 1: Measure out equidistant holes in your wooden board. It’s really important that they’re as equal as you can get it, or else your LEDs are going to stand all wonky, and it’ll be hard to solder them all together.

I measured the holes about 1/2in apart.

Step 2: Drill the holes!
img_5054.jpg
It helps to have an LED right next to you to make sure it’ll fit nicely in each hole.

Step 3: Solder the LED strips.
Take all the LEDs and bend the cathode (the short, negative lead) in such a way that it doesn’t touch the anode (the longer lead), and make sure when you fit them into the holes on your wooden board that the cathodes overlap each other so you can solder them together, like so:

Once you solder all the strips, lay them out in each set of holes, (with all the cathodes pointing the same way), and….

Step 4: Cut some craft wire and solder it across the LED strips to make it a square!

At this point I recommend using a 9V battery with a resistor on the positive (red) lead, and with the black lead touching the craft wire, go through and test all the LEDs to see if any burnt out or aren’t working. Trust me, it’ll save a LOT of time if you have to replace one now rather than later.

Step 5: Solder the layers!
Line the layers up on top of each other (one at a time), and remember that you’re *only soldering the leads pointing up*.

img_5061
If you’re having a bit of trouble keeping the cube upright or the layers stable, the crocodile clips come in handy to steady the design.

img_5058
The above picture was actually a mistake, I accidentally flipped the layer around the wrong way and had to desolder it because all the cathodes weren’t pointing the right way. (The cathodes being the shorter leads that you bent earlier) I wanted to show an example of the crocodile clips, though.

Once that’s completed, you can turn the cube right side up!

img_5062
You can trim all the excess craft wire off. As for the cathodes sticking out on the sides, I cut them in a stepping-stone fashion like this tutorial said, which will make things easier once we hook the LEDs up to a PCB.

Step 6: Get the right PCB

img_5063
I bought this PCB kit for…about $11, I think. It was a really good deal, these PCBs seem to work very nicely. They weren’t as big as they needed to be, though, so I hot glued two of them together.

This was probably the trickiest part of the whole project: getting 16 LED leads into tiny holes all at the same time. Round nose pliers were my best friend when I did it. Once you get them all in, solder all the joints at the bottom so all your hard work will stay in place!
img_5064

Step 7: Put the resistors in.

Round nose pliers were super handy for this step as well. I chopped the leads of the resistors to be tinier than usual, then with some pliers I stuck them in the holes and soldered them in.

img_5065img_5066
With the leftover resistor leads I used them as mini hookup wire to connect the resistors to the LEDs on the bottom of the board.
img_5067

Step 8: Cut up some more craft wire and solder it to the negative stepping-stone leads, and wire them down to the PCB. img_5069img_5070
Step 9: Get some hookup wire, strip the ends, and pull them all towards the oval pads to connect to the jumper wire GPIO thingies.
img_5075

I would recommend starting with the smaller hookup wires, I found it hard to solder around the bigger ones already in place without almost melting the insulation stuff. img_5077

Step 10: Solder the jumper wires to the board!img_5078
As you can see, I color coded the wires based on which resistor it was connected to. That way, I’ll have an easier time connecting the jumper wires to the GPIO pins on the Uno.

I still have to get some small wire or just use solder to connect the hookup wire to the actual resistors and GPIOs, so the signals will actually flow through the circuit. But otherwise, the big job is finished.

And that’s it! I followed this tutorial the whole time: http://www.makeuseof.com/tag/how-to-make-a-pulsating-arduino-led-cube-that-looks-like-it-came-from-the-future/

Next time, I’ll put up a post on the Uno, loading the code, and getting it all to run.

{thallia}

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!

Project Hype: RPi Terminal

Over the past week or so, I’ve been ordering and collecting parts for two projects I’ve been itching to build since I went to my local barcamp. And now that I’ve learned to solder, I can dive in head first.

The first project I’m going to complete is a Raspberry Pi powered Linux laptop. This is a tiny, nintendo DS sized laptop that mainly runs terminal commands and code, but you can run video and audio on it and it’ll work just as well!

Here are the supplies, and the supply list: 

All of these came out to approximately ~$140, which my grandma generously helped me pay for. We bought from ebay, Amazon, Sparkfun, and Arrow. I had little to no knowledge about many of the things used in this project, so I’ll go over each item before writing out my to-do list.

The Raspberry Pi and I have had plenty of previous experience with each other, it’s the little computer powering the whole thing.
The Adafruit PiTFT is a little touchscreen perfect for the size of computer I’m building.
The Lithium Ion Polymer battery was a confusing buy, since I’d never heard of the term mAh before. mAh stands for milliamp hours, which measures the amount of coloumbs (electrical charge) stored inside of it. (if you do the math like I had to, it helps make sense.)
The wireless keyboard I got off of Amazon for about $10, it has bluetooth capability, but says it only works with certain operating systems. We’ll see about that.
The 5.5V to 3.3V step down converter was probably the hardest thing I had to find, but I got a good deal on eBay for one thanks to my friend Gector.
The Adafruit Powerboost 1000c is I think what helps recharge the battery that powers the RPi and the keyboard.It’s super tiny, and actually really cute.

I got most of the other stuff off of Sparkfun, two little 3-pin switches, the female USB connectors, the audio/video jack, and the wifi dongle.

As for the case, in the tutorial this guy uses cheap HDD cases. I could not find any that fit to my liking, they were all either the wrong size or shape, or they came from China and I was too impatient to purchase one from there. That’s when I was struck by a brilliant idea. Why not 3D print the case? (I know, great idea.)

I attempted to teach myself Sketchup, but quickly realized that I was too inexperienced to try and model something myself. Gector offered to help, and he made an awesome case for me that I’m getting 3D printed by one of my other friends.

Here’s a preview of the case before I print it!rpilaptopcaseOnce I get it all 3D printed I’ll post more pictures with the dimensions.

According to the tutorial, my next steps are to desolder all the components off of the RPi, Adafruit PiTFT, and wire everything up to the keyboard and battery. I gotta solder new wires onto the USB, Audio/Video, and HDMI ports, and get the MicroSD of the RPi set up.

I definitely have my work cut out for me, but once this project is physically done, I want to write an OS (operating system) for the Raspberry Pi specifically to accompany this project.

I’ll update soon as I start working on this!

 

LightShow Pi ~ Early Tech Behind the Laminar Fountain

Today was awesome. I made huge progress in the tech side of the laminar fountain project.

I found a software called LightShow Pi, which was originally created for Christmas light shows, but many people have used it for smaller projects of their own.

The first step after getting an LED to flash with the Pi was to install the software. First I had to update all the packages ‘n stuff on my system with sudo apt-get update and sudo apt-get upgrade. That took around thirty-minutes to fully install.

Next I cloned the LightShow Pi repository off of GitHub: cd ~
git clone https://togiles@bitbucket.org/togiles/lightshowpi.git

And change to the stable branch of code: cd lightshowpi
git fetch && git checkout stable

Once completed, you install the stuff! Just make sure you’re in the “lightshowpi” directory. Then you can run: sudo ./install.sh.

This part tripped me up, because it took over two hours. Everything installed fine until it started running the line Installing rpi-audio-levels.... My Pi got really hot and stuck, so I rebooted and tried to reinstall, but it kept getting stuck. img_4697

I left it for about 2hrs (with many checks in between) before seeing that it had finished. Then I rebooted as the instructions said.

After that, the next step would be to build the actual LED setup on my breadboard. Initially I tried following this link, but only for a generic idea of how to wire the breadboard. I didn’t have a breakout board, so I went back to basics and made a simple circuit like the one in my last post, but with eight LEDs instead of just one. Next I attached the pins of the Raspberry Pi (3.3V and Ground) to the breadboard:img_4706

Next step was to figure out what GPIO pins the Pi was using for the project, the google doc said GPIOs 0-7. I used this chart to locate them.

img_4708

img_4712

Lovely mess, ain’t it? The pins are attached to their respective LED, and each LED is also connected to ground.

Finally, I could plug it all in and test this thang! To test it and make sure you have all the right channels, you run sudo python py/hardware_controller.py --state=flash

Each LED blinked twice, and I knew I had the right setup.

To play music, there were a few more steps I had to take. First, to make sure I had audio output, I connected my audio jack to a portable speaker I had (that’s the blue thing). Next I had to actually find the music. Using a Lexar USB, I pulled some mp3 files from my music collection and put them on the USB, which I connected to the Pi. Then using the command sudo python py/synchronized_lights.py --file=/home/pi/Desktop/Music/singles/shelter.mp3

With --file=, you continue the command with the file path of where your music is located.

After all that work, I got this wonderful result. https://youtu.be/oHTUvcA52Bo

Next step, to try it with RGB LEDs. Until next time!