Monday, December 30, 2013

LCD 16x2 RGB Display

I got this display for my next project. It will be displaying two variables that are being measured with the Arduino. The RGB display can have various colors by grounding the RGB pins (16,17,18). It is a nice display and I'll have it working dynamically updating every few seconds. The project will also have a calibration button and instructions will be displayed on the LCD screen.

LCD RGB 2x16 Display

Adafruit has a great tutorial on hooking this bad boy up. Again, 17 and 18 are connected to ground to get the different colors on the RGB. That is not covered in the tutorial. Rest of the components for the project get in at the end of the week!


Tuesday, December 24, 2013

7 Segment Display from Adafruit!!

Its been awhile. I have a few projects I am working on now but taking my good ol' time. The one I would like to build using the Raspberry Pi utilizes the 7 segment display from Adafruit. I think they look really well on any project and are really easy to use.


This has the I2C backpack and they have a great tutorial on using them. Only need 4 connections and you'll be up and running. 

+3.3V, GND, SData, SClock
The other project I did has a lot of design work and I am starting to acquire and build the parts, pretty excited and I'll be posting on that in the near future. Uses some strain gages with an Arduino.

Saturday, September 14, 2013

ATX Bench Power Supply

I had an interesting failure the other week. I use a 12 Volt battery pack to power some steppers when I am developing a project. At some point the positive and negative lead touched and the next time I went to use it, the end terminals on the pack had melted through the plastic. I decided to upgrade myself to converting an ATX power supply into a bench top power supply to supply +3.3, +5.5, +12 and -12 volts.

There are a bunch of references for building them. First thing I did was find a supply laying around I could use. You can reference the diagram below for the color coding of the ATX supplies.


The same color lines should be soldered together for wiring the supply to get the max amount of current the supply can provide. Once you get the ground and voltage wires together you are a left with a few others. My supply did not have a -5 V. The BROWN wire is the +3.3V sense with needs to be tied in with the +3.3V line. The GREEN wire is soldered to the switch on my supply. The PURPLE wire attaches to the red LED and the GRAY wire attaches to the green LED.

The schematic would be as follows. I did not utilize the fuses in line. The resistors are required for the LEDs and I bought a round switch. Wiring for all other components is correct. I used 2 5 Watt resistors in series in place of the one 10 Watt. Some supplies require an initial load in order to turn on.


I had difficulty using binder posts with the amount of ground wires my supply had. I decided to not utilize all of them as most of the things I will use my supply for do not draw a significant amount of current.

I used a project box from Radioshack and layed out what I wanted my box to look like.


I cut the project box out using a template and installed all the components. I soldered all the wires to the appropriate place and still need to create labels. It is important to heat shrink all the wires so the do not contact at any mount. 

The red led will turn on when the ATX supply is plugged in. The green led will signify the switch is turned on, supplying power to the rails. Everything worked great and I was very pleased with how everything turned out.


Reference to links I used can be found below:






Thursday, August 1, 2013

Does the cooling fan make a difference? Yes...

Quick answer to if the cooling fan made a difference is yes. I made the famous octopus yesterday and it was the first time I had consistent extrusion throughout the print.

Clean octopus print from utilizing my cooling fan

I can't really think of a con to adding a cooling fan to your hot head. Even if you don't have issues majority of the time. The plastic stays cooled higher above the nozzle so
  • I did not get the extrusion issues on my hob bolt with material getting soft
  • The plastic is melted only at the nozzle so it makes it less "stringy" and I had cleaner lines and layers
  • Possibly prevent ever overheating (flow is pretty low though)
I have not tried with ABS but this helped my PLA prints. Originally I was a little worried it would cool too much and the resistor would not keep up but my mount is high enough it does not flow over the metal nozzle and there were no issues at all. Overall I say a small $ for the benefits. The fan only costed me about $3-4 and I had rest of material laying around.

Monday, July 29, 2013

Makerfarm Prusa i3 Fan Mount

One recommendation to me was when printing PLA add a cooling fan to the black section of my hot end. I've had a only a few instances now where my extruder had spotty performance. One instance there was a bulge in my filament that could not go through the diameter. This required an additional disassembly of my extruder. It is my understanding the heat can conduct up the filament and get soft near the hob bolt. To avoid this I purchased a small 40x40 mm fan to provide cooling over the PEEK material of my J-head. Makerfarm recently came out with a new extruder but I have the "older" model so I had no holes in my extruder to mount my fan. I decided to make a fan mount that is retained by the two X-axis bolt holes used for the X-axis stop.

Front View with 2 holes for the fan
Back view where there is an angled section to match the wood
cutout of the X-assembly


I measured up the dimensions of the X-assembly and modeled it. I added 2 bolt holes on the side for the screws that attached it to the X axis assembly and matched the angled section of the X-assembly to prevent it from rotating about the bolts. There was one weal spot in my print where my extruder crapped out for a few layers.

Fan attached to mount
My motor has a 3rd wire which is used on a motherboard as a tachometer. In this case I will not use it but thought it be fun to have if I ever wanted to do anything with it. My motor is 12 V so I can hook it right up to my RAMPS board on the 5A power terminal. It will run all the time but I think I'll put a small switch in the line and mount it to my printer so I can turn the fan off and on. 

Fan mount attached to the X assembly

 I am really pleased with how it turned out. The weak section of my print actually broke on one side but still is really stable. I may print another one later. The fan does not blow over the hot end, only over the black section of my extruder. It is a very small amount of flow and should help. You can download the .STL file for the Fan Mount

Saturday, July 27, 2013

Back with a 3D Printer

It has been over a month now since I wrote my last blurb. Life has been rather busy but I ended getting the Prusa i3 8" Printer from Makerfarm.

It comes as a kit but it was a lot of fun to build. Only additional items you will need are a piece of glass to print on and an ATX computer power supply to run 12V to power the board and printer. I assembled mine and did a few of the initial test prints to see how well I did assembling. I am completely new to this so I was not familiar with print temperatures and calibrating so my first prints were very crude. I contact Colin at Makerfarm for some pointers and he was very helpful and quick to respond. I checked the calibration and did some maintenance on my machine. It ended up I had to completely disassemble my extruder but this was rather painless. When I originally built it, I had a tough time putting the components together. In my case the plastic idler did not contact the filament and I did not have enough preload on my springs to extrude the plastic so I ended up with a few good layers of print, then a few bad and back to a few good.You can see in my print how spotty it was and offset.


My new prints are much improved now that I trimmed some material off my extruder and the fits are much better. I am working on my first large scale object but I printed a small piece last night that turned out very well. It has nice edges and a great radius on the one section.


I am still learning how to more effectively use Sli3er which creates the Gcode for the printer. Overall I love my printer and I think it was a great buy for the price. It took some work getting it honed in but you get to become more familiar with the machine itself. Highly recommend this printer to anyone else. I'll continue to post projects that I am working on and parts that I create. I'll manage a way for everyone to access my .STL files as well.

Thursday, June 27, 2013

I've Been M.I.A

I have not posted in awhile but I have not forgot about da Yetti Cave. I will have new posts soon and I will be getting a 3D printer (finally)!!!!! This will be huge for me because I don't have room for a legitimate workshop. However, I did come across this awesome MakerSpace in San Diego which I may have to pay a visit to. Links below:

Saturday, June 8, 2013

BeagleBone 1.8V Analog Logic

Intro

Unlike the Arduino which uses 5 V logic, the analog pins on the BeagleBone Black require a 1.8 V signal for the Analog to Digital converter (The device itself is 3.3V. I always have concerns doing something new with my devices with the fear of destroying them. Not being an expert in electronics, I tend to ask a lot of questions and before I make a move. The two things I wanted to get answered in the case of using the analog pins on the BBB were

1. What if a sensor does not have a datasheet or specified output voltage; is it or would it be less than 1.8 V for the BeagleBone?

2. If it is over 1.8 V, how do I use the sensor?

I'll answer both these.

Finding a sensors output voltage

This  I think was the most intimidating part of using the analog pins on the BeagleBone. I have data sheets for most my sensors but out of curiosity I did not know the best way to figure out what the output voltage would be for the maximum in put voltage. I posted the question on Google + and got a response from Jason Kridner, who is the BeagleBone aficionado from TI. He suggested I purchase the DSN Nano Oscilloscope from SeedStudio.


What advantage will this give? Almost all devices specify an input voltage on the data sheet. Using an oscilloscope will allow you to vary an input voltage to a sensor and measure the output voltage of the device. (You could do the same with a multimeter but I wanted to add an oscilloscope to my toolbox). 

Using Analog on the BeagleBone

Hipstercircuits had a great write up on how to enable the driver for the analog pins. Follow this link. The BeagleBone Black has specific pins that are analog. They are physical pins 33,35,36,37,38,39,40 and 41 is analog ground. I used my TMP-36 temperature sensor for my first analog project because it outputs 1.8 V. This is the maximum allowable for the Analog to Digital converter on the BBB. Here is a shot of how it was hooked up. Red is 3.3V, Black is ground and Blue goes to one of the analog pins. A cheat sheet can be found below for the physical pins and I labeled the analog pins.



The BeagleBone will give the measured values in mV so the values you will read from the low hundreds to about 1800. To acccess a specific pin you can execute the following command:

TMP-36 Sensor Wiring
cat /sys/devices/ocp.2/helper.14/AIN1

This will access AIN1 which is physical pin 40. Just as I did in my Blink.py example I wrote a python script to read the analog value and convert it to a temperature based on the information Adafruit provides for with the data sheet for the sensor.

The python code can be found at this link TMP-36.py

On my particular device the path is "helper.14" but I have seen others with a different # on their directory. If 14 does not work for you just type "helper." then tab and it will fill in auto complete.

I'll answer the question of "If it is over 1.8 V, how do I use the sensor?" in my next post.

Thursday, June 6, 2013

Up and Coming!

Sorry its been awhile since the last post. I am working on discussing analog inputs for the BeagleBone Black and the analog 1.8 V logic. I'll post on it this week with an example. Also I'm working on a homemade Breathalyzer I'll be sharing. Some other projects are postponed because I need a 3D printer!!! Then I dont have to relie on others for special parts. Scanner is on hold for that reason but I did get some wood to build the base and can start mounting.

Monday, May 27, 2013

Blink an LED on the BeagleBone Black using Python

Using Command Terminal


Probably the most basic example you could do but its a great start for using digital output on your device. Before I attempted this in Python, I turned and LED on simply through the command terminal. This begins with defining the pin you are going to use. This creates a directory by executing the following command

cd /sys/class/gpio
echo ## export

The ## being which pin you will be using as the digital pin on the BBB

This will create the directory for the pin you have specified. Next is to define it as an INPUT or an OUTPUT pin.

This pin will be an "out" as we are turning off and on and LED controlled by the device.

echo out > direction


Using Python

The same concepts are utilized when executing the commands in python. Rather than using "echo" to write values to the pin files, you use python to write the commands to the files on the BeagleBone.

The link to the code is located at Blink.py

I will explain it in segments,

1. The first setup is to define which pin will be used, just as we did before.
2. The second setup is to define whether it is an INPUT or an OUTPUT, as we did before
3. We then open the value file so we can write to it. Because this is a digital output we will write a "1" for on and a "0" for off.

We then just create a loop that turns the LED off and on in 1 second intervals.

The except is for when we want to end the program. You have to unexport the pin that was being used so you execute the command

/sys/class/gpio/unexport

This will occur when the user uses Ctrl+C in the terminal window to end the python program.


This is a great start to understanding how to use digital input and output on the BeagleBone Black. From here you can use this to turn on much more than just and LED.



Wednesday, May 22, 2013

Setting up Nano the Lightweight Editor for Any Syntax

Previously you may have seen my post on how I connect to my Beaglebone. I generally don't program everyday in my line of work so I have not put in the effort to lean Vim or emacs. I'd most likely learn all the shortcuts and forget them a week later. As I mentioned, I generally like using an IDE and transfering my files over. Then there are times I want to make quick changes right within the terminal. This is what I like using nano for...


It is lightweight and can be navigated easily, similar to opening a text file in Notepad for instance. One thing it was originally lacking was syntax highlighting which I enjoy a lot. I had to set this up on my laptop so I wanted to talk everyone else through it. The general setup file for nano is a hidden file that should be located in your home directory. If not you can create it and call it .nanorc. The link below is an example of a file you can use and modify to your preference. Rename this to the .nanorc and copy it to your home directory. 


From here, you can add the syntax setup to the main file or create separate files for specific coding and scripting languages. I prefer this route so if I want to change what my syntax looks like I only have to go to a file with 8 lines in it.

This example will setup highlighting for python. Line 245 in the link above is where you uncomment the code

include "/usr/share/nano/python.nanorc"

Save this file and cd to /usr/share/nano. If the directory does not exist, create it. Then create a file python.nanorc. This goes for any language you want to create custom syntax highlighting for. Edit this file similar to the code below

## Here is an example for Python.
##
syntax "python" "\.py$"
icolor brightblue "def [0-9A-Z_]+"
color brightcyan "\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>"
color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''"
color red "#.*$"

When nano starts, the .nanorc file will look for this python setup file and syntax highlight according to how you want it. These colors will appear for the variables you define in the "". That is what each line has in common. This makes it easier to make those quick changes to code as you are tinkering in the terminal.


Sunday, May 19, 2013

Transfering Files to the BeagleBone

iTerm2

I recently got using iTerm2 because as I was trying to set up the regular terminal on my mac, there were a few more features I was wanting. A great feature is the ability to save window arrangements.  This allows the user to configure profiles and save them as a "Window". In each window you can start the shell with a command giving you a head start. When I use the Beaglebone I have one shell start with

ssh root@192.168.7.2

which starts the ssh to access my Beaglebone. In the other window I have the command

cd /Documents/Beaglebone

which is where I contain files that I use a favorite IDE on my Mac or Linux to copy over to my Beaglebone. I saved these two shells in my "Beaglebone" window arrangement.  I am not to familiar with Vim or eMacs because I do not program everyday so I have not invested the time to learn. This make it easy to start up the iTerm2 and get right into working on my Beaglebone.

SCP (Secure Copy)

Once I have my terminal all set, I use SCP to copy files from my Mac to the Beaglebone. The command is as follows

scp test.py root@192.168.7.2:~/Python

The first argument is the file you want transferred. Next is the the Beaglebone user and IP address followed by a colon and the path to where you want to transfer the file.

The iTerm allows me to work entirely from the terminal. I have also reconfigured the light weight editor nano to syntax highlight for python files so I can do quick corrections without going to my favorite IDE everytime. I'll place another post how I configured nano for the syntax highlighting.

Sunday, May 12, 2013

Laser Wood Burning

I usually complete my projects about 85-90% before moving on to the next one. As I mentioned before, I wanted to do a laser wood burner. The idea is you would take a gray scale image with has the data stored in a particular way. Regardless of how your program would interpret the data, there is a scale from light to dark.

Gray Scale Range

I want to use this stored data in an image file to control a laser. It would ride on a X-Y carriage as the laser is controlled maybe by pulse width modulation. This would effect how long the laser burns and at what intensity to get contrast on the image.

Pulse Width Modulation

I think this would be a cool project to do where you can have 
  1. An image processed
  2. Converted to data for the laser to interpret X,Y and power
  3. Have a microcontroller or computer control the burning process
The end result would hopefully be something along the lines of

Hopefully final result for the laser wood burning project
If this can be done by hand why not have a computer do it :-) I think it would be a pretty cool challenge . Any suggestions are appreciated.



Saturday, May 11, 2013

I want a real work shop!!!!

I really want  a designated area for a workshop which apartments are no good for. I have a few cordless tools and it gets me by but I want the works. Large bench, shelving, table saws room for a 3d printer, etc. I am talking about a shop that is similar to the one below.


As I have mentioned previously in my blog, I am working on a "barn door" tracker for my astrophotography. I struggled to cut out the "doors" for my tracker on my small second floor patio. One day, I'll have the workshop I want. 

Wednesday, May 8, 2013

Beagle Bone Black Up and Functional

I have had limited time as of late but I wanted to confirm that after updating to the latest Angstrom distro that my Beagle Bone Black is functioning. I can properly SSH into the device so this weekend I plan on getting more involved with it...time permitting. Hope others are enjoying the Beagle Bone!

Sunday, May 5, 2013

Beagle Bone Black SSH Issue

I bought some new toys for my beagle bone black and wanted to get started this weekend. Unfortunately there is a SSH problem with the release distribution of angstrom. I could not connect to the board through the SSH but apparently it is fixed with the latest. I found the a forum on the discussion posted below.

Link to solution

Now I need to get a bigger micro SD card to get going...guess I have to wait :-(

Tuesday, April 30, 2013

Getting Started with Beagle Bone

I am relatively new to the Angstrom distribution on the Beaglebone Black. Compared to the Arduino and Raspberry Pi, the Beaglebone has a tremendous lack of tutorials and documentation. This makes learning on the platform much more difficult. I have linux Mint 14 on my laptop and my desktop so I am familiar with commands and navigating linux. The whole GPIO is a bit intimidating on the new boards so I decided to pick up a copy of Getting Started with the Beaglebone by Matt Richardson. It is only a $10 book and Matt has had the Beaglebone for some time prior to its release. It is currently in its raw version and does not have all the chapters released but I got the electronic copy so as the chapters are published I get notified and just download the document again. I think it will be a great help

In addition to my scanner I have done some astrophotography. I was working on a barn door tracker which rotates with the earth to give longer exposures. The Beaglebone would be great to control my DSLR or even better capture and process the images for my 3D scanner. Here is a picture of the Orian Nebula I captured awhile back.

Sunday, April 28, 2013

3D Scanner


A friend of mine has a 3D printer and we have discussed my scanner several times. He is going to send me an object he recently printed and I am going to attempt and we will replicated the piece. Also he is going to print me a piece for the stepper motor to glue my rotating deck on. I'll take a picture of the piece when its done. Here is an image of the Buddha statue he replicated.

BeagleBone Black!!!!

I purchased a BeagleBone Black and I am very excited it will be arriving tomorrow. I have a Raspberry Pi which all I ever do is SSH into it. I was a little disappointed at first with the Raspberry Pi but it has grown on me. Analog is a feature I with it had, otherwise you tend to just turn on LED's all the time, I do have a A-->D converter I just have not played with it yet. I am excited for the BeagleBone as I think it is a more "mature" device than a learning device, plus its a power house.

Monday, April 22, 2013

3D Scanner Theory

Theory

This entry I will cover some of the theory behind the laser. The first image is the concept on capturing the image with the webcam.
The webcam and the laser will have a fixed angle between them. The webcam will capture a 2D image with laser outlining the profile of the object. The picture will have captured the distance from the center of the image to the laser which is defined as 'B'. Knowing the angle between the webcam and laser and measuring the distance B from the captured image, the 'R' can be calculated from trig using sin(Beta)=B/R. This distance B and R is captured for each image taken, for mine its 200 images. The larger the angle between the webcam and the laser, the less error you will get with the depth. Taking a 2D image will profile the image in a perpendicular plane. The smaller the distance between the perpendicular plane and the laser, the less error you will have from te depth of the object being captured in a 2D image.

After the 'R' value is determined, this has to calculated to the X,Y and Z coordinates. The picture below explains.
'R' is a distance defined in the X-Y plane, shown my the large red dot. The red plane is where the line laser acts. If we know 'R' we can again use trig to calculate its location in the X-Y plane. The Z coordinates simply goes by the height of the object. To convert to Cartesian coordinates, the following equations are:
x = ro * cosinus( fi )
y = ro * sinus( fi )
z = z

Code

All my calculations come from how python stores the images. The JPEG's store R,G,B values so my program looks for the brightest Red value because I have a red laser. The pixel location is easy is is stored in a 2-D matrix starting with pixel location 0,0 and ending, for a 620x480 image at 620,480. I chose to look for the brightest red pixel so its ok to scan with some ambient light and it does not have to be done in the dark. My code is in the link below.