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.