Interfacing Vernier Sensors and Arduino (and vice-versa!)

So, recently I’ve been bored. That’s nothing new really. The up side to the times when i get really bored is that i usually end up starting some sort of electronics project. Since i have an interest in the DIYBIO movement and an interest in DIY chemistry i have realized that it’s really cool (and helpful) when you can use sensors to collect your data. But up until now i haven’t had the motivation (or the money) to really dive into it. But today’s post may be the beginning to turning that tide.

Awhile back i stumbled across this post by David Hay, after noticing this question on adafruit. In it he tinkers a bit with interfacing an older vernier (light?) sensor with an arduino clone.  Since i use vernier sensors in my chemistry classes at school i have come to love them. I wondered if i could do something similar, but what i really wondered was whether i could do the opposite as well. Could i interface other non-vernier sensors (like sparkfun sensors) using an arduino to the fancy LoggerPro software or my TI84+ calculator? It turns i can!

DSCF15033

The LoggerPro software is really good stuff, but i’m cheap whenever i can be. That’s one reason i thought of my TI84+ calculator. I already have one of those, and vernier has released free software for it that can graph data from vernier sensors in real time. The program is called EasyData and can be downloaded here. The second option is to use LoggerPro on Linux. And since i’m already a full time Ubuntu user i get to use the newly updated free LoggerPro beta for Linux! Sweet Beans!

DSCF15011

I’ve already tested both. They both work great. The cool thing is that i was able to hook an arduino to my calculator EasyData program and also LoggerPro on the computer by using a Vernier EasyLink (with an adapter to convert it into a GoLink). I had to get a Vernier Analog Breadboard Cable for it to work, but it was well worth it. I sent some test pwm values using the Arduino example code for the fading led on arduino digital port 9. I used the example pdf from the DIY Light Intensity Sensor example project on the Vernier website to help me out a bit.

DSCF15022

I was also able to do the opposite like what David Hay did with his sensor. I was able to successfully interface a stainless steel temperature probe from Vernier (which is basically just a thermister in a nice case) to my Arduino. I used the example pdf from the DIY Build a Temperature Sensor example project to help me out, along with the values in an equation provided in the manual that came with my stainless steel temp sensor. I also bought this nice Analog Proto Board Connector from vernier which allowed me to do this so quickly. Here is the code i used on my Arduino to calculate the temperature from this thermister.

*/
int led = 13;

#include <math.h>

#define ThermistorPIN 0 // Analog Pin 0

float vcc = 4.91; // only used for display purposes, if used
// set to the measured Vcc.
float pad = 15000; // balance/pad resistor value, set this to
// the measured resistance of your pad resistor
float thermr = 20000; // thermistor nominal resistance

float Thermistor(int RawADC) {
long Resistance;
float Temp; // Dual-Purpose variable to save space.

Resistance=((1000 * pad / RawADC) – pad);
Temp = log(Resistance); // Saving the Log(resistance) so not to calculate it 4 times later
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp – 273.15; // Convert Kelvin to Celsius
Temp = Temp / 2;

// BEGIN- Remove these lines for the function not to display anything
//Serial.print(“ADC: “);
//Serial.print(RawADC);
//Serial.print(“/1024″); // Print out RAW ADC Number
//Serial.print(“, vcc: “);
//Serial.print(vcc,2);
//Serial.print(“, pad: “);
//Serial.print(pad/1000,3);
//Serial.print(” Kohms, Volts: “);
//Serial.print(((RawADC*vcc)/1024.0),3);
//Serial.print(“, Resistance: “);
//Serial.print(Resistance);
//Serial.print(” ohms, “);
// END- Remove these lines for the function not to display anything

// Uncomment this line for the function to return Fahrenheit instead.
//temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert to Fahrenheit
return Temp; // Return the Temperature
}

void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
}

void loop() {
float temp;
temp=Thermistor(analogRead(ThermistorPIN)); // read ADC and convert it to Celsius
Serial.print(“Celsius: “);
Serial.print(temp,1); // display Celsius
//temp = (temp * 9.0)/ 5.0 + 32.0; // converts to Fahrenheit
//Serial.print(“, Fahrenheit: “);
//Serial.print(temp,1); // display Fahrenheit
Serial.println(“”);
digitalWrite(led, LOW);
delay(1000); // Delay a bit…
digitalWrite(led, HIGH);
}

So what does this mean? I think this opens up a whole new world of possibilities. On the one hand i believe i can now use the nice Vernier LoggerPro or EasyData real-time graphing software to interface non-vernier sensors like Arduino’s directly and perhaps others like a Sparkfun Alcohol sensor? (which i have one i would like to try) This should make it easy to interface cheap sensors in chemistry and biology labs that already have vernier equipment. I think it also means that we can now easily use Vernier sensors on non-proprietary devices such as cheap Arduino micro-controllers.

I also look forward to soon tinkering with using an Arduino webserver as a different real-time sensor graphing and data logging device. I hope in the future i can help to create other tools which might be useful for DIYBIO and other DIY science.

Ubuntu 12.04 Preview

Ubuntu 12.04 alpha

I haven’t been giving computers or linux much attention on my blog for awhile. I hope to remedy that situation soon. I am eagerly awaiting the Ubuntu 12.04 LTS release in a few months. It feels like I’ve been waiting forever, but once it is officially released i hope to give it a thorough review.

A few weeks ago i decided i couldn’t wait and i did an early upgrade from Ubuntu 10.04 LTS to the 12.04 alpha release by using the command “update-manager -d”. I’ve been using Ubuntu 10.04 since Canonical replaced gnome with unity (which at the time sucked). Sticking with an LTS release turned out to be an excellent choice and provided a stable production machine. I think it’s something i will do again in the future.

The upgrade appeared to go really smoothly. Actually i think it’s the  smoothest upgrade I’ve ever done. Everything transitioned well into the new environment. A few nice things stuck out when i first started using it. The first was the new and polished unity interface. I must say that this experimental interface has come a very long way since it was first introduced to ubuntu. In fact it has matured so well and works great that i actually now prefer it to the old Gnome desktop. And i was pretty pissed-off when i heard they were ditching trusty ol’ Gnome for a relatively untested and early interface. I actually used the first Unity implementation on Ubuntu Netbook Edition. I thought it was crap, and i haven’t used any form of it until now. I actually think the new and updated Unity interface makes it easier for me to get productivity work done. It just feels right. But I expect to see some changes to it by the time 12.04 is officially released, so we will see.

The second thing i noticed was Firefox. Okay, so Firefox hasn’t changed much, but i finally have an updated version. For some strange reason Firefox in the 10.04 repos hasn’t seen any updates in a while. Although i may start to be liking Google Chrome better. But i still like firefox for some things (like the ability to block flash ads), and the range of add-ons.

The transition from OpenOffice to LibreOffice seems a bit silly, since they are pretty much the same product. I do like the green and white logo though. But, i dont blame the forking of LibreOffice from OpenOffice since there was quite a bit of doubt that Oracle would be playing nice with opensource. I don’t know that much about what eventually happened, but i think Oracle turned OpenOffice over to the Apache foundation, so i would think that the two could merge back together someday. I don’t really care what anyone calls it though, all i care about is if it works well. And it does work fantastically well.

UbuntuOne has also matured, and I’m finally getting the hang of synchronizing folders between computers, which i like A LOT. I’ve never used DropBox before, but i understand the two services are very similar. I choose to use UbuntuOne because of the integration with ubuntu though. And I’m glad to hear that a new windows client has been released. Synchronizing folders across all kinds of different devices just makes sense, and reminds me that we really are living in the future. Just like that phrase in The Time Machine, “The Future is Now”. I look forward to hearing about other ubuntuone clients for macs and android phones, etc.

The only con i have to report is that my sound was broken upon upgrading. I reported it as a bug, so hopefully they will fix it. Other than that i don’t have anything else to report.

Unfortunately I’m not using my 12.04 alpha system anymore, because shortly after upgrading i accidentally hosed my whole system. I was trying to remove some program in the terminal with asterisks (*) and –purge, and somehow apt started removing EVERY program from my whole system. It must have been some sort of dependency hell thing. I was able to stop it before it finished, and i was also able to use an alternate-install disc to use “fix broken system” to reinstall unity and apt-transport-https (which is a critical file for apt to be able to download packages), and ubuntu-desktop, and some others. But i was not able to restore the system to fully functioning order. The shutdown and restart buttons stopped working correctly, and the login menu didn’t work right either. I was forced to back-up my data and reinstall (i think 11.04) from a cd. I look forward to a fully stable and official 12.04 release soon.

Testing Out New Website

.

[English]

I finally leaned how to buy a domain name, and figured out how to use Ubuntu to host a website. It’s really interesting. On the one hand, starting my own website isn’t as hard as i thought it would be and is quite liberating, and on the other there are so many technical things associated with it that it’s actually harder than i thought it would be. So technical in fact that it approaches the very upper limit of my computer skills.

The Domain i bought is BioLumo.com for those who are interested enough to check it out. Be aware that my HTML skills are rather crude, and at the moment i’m hosting it myself, so it could very well go down at any moment. The name was chosen to attempt to be understandable by both English Speakers and Esperanto Speakers. Bio Luminescence in English, and Bio Illumination in Esperanto.

Anyway, so what does it actually take to create a website? Well, first you have to get over the idea that if you think of a website name that nobody else has ever thought of, that in theory it should be free. Strangely enough you MUST purchase a domain name from a Domain name registrar. The one i chose after reading several reviews was name.com. They have decent prices and good reviews. So yeah, you buy a domain name and pay a yearly subscription fee, or you can pay for more years in advance.

2. You need someone to host your website. I eventually don’t want to go to all the hassle of hosting my own website in the future, so i will probably pay someone else to host it. I’m thinking people who are computer geeks and open source fans. Yeah, Laughing Squid looks like a great place to host. They also seem to have awesome price rates on their cloud servers (Amazon EC2?).

This time i set up an old Ubuntu Computer to serve as my webserver. It took a bit of work. Not too much, but a little bit. I had to install Apache and FTP. I had to configure a few other things as well. The hardest part was trying to set up the permissions on the /var/www folder, because otherwise my server locks everyone out from accessing my website files.

Anyway, yeah. This is the first time i have ever had my own website. Hope i can figure out some cool stuff to put on it.

[Esperanto]

Mi estas elprovas nova retejo. Mi estas gastiganta ĝin min sur malnova Ubuntu Linukso maŝino. La Domajno mi aĉetita estas BioLumo.com por tiuj, kiuj interesi sufiĉa rigardas ĝin. Esti konscias, ke mia HTML kapabloj estas iom kruda. La nomo estis elektita provi esti komprenebla per ambaŭ Angla parolantoj kaj Esperanto parolantoj. Bio Luminesko en Angla, kaj Bio Iluminado en Esperanto.

Exploring Full Disk Encryption

I feel kind of guilty that i rarely post anything about linux (or computers in general) on this blog like i used to, so this is an update for the Linux people out there.

If you’ve never used linux before and are still using a Microsoft OS, then i encourage you to at least try the other options out there. Ubuntu 10.04 is my Operating System of choice for a number of reasons, including, Stability, Free/Open Source (no licencing fees), timely security updates, multiple language support, mega amount of customization options, and almost never any downtime (ie. crashes, BSOD, viruses, etc.). Ubuntu 10.04 is the best version of Ubuntu i’ve tried. 10.10 has been out for awhile, and does have a few improvements, but it’s not an LTS release, and it has a few changes that bugged me the last time i used it.

Anyway, i love the fact that Ubuntu now gives you an option of using an encrypted Home folder to keep your files safe. And it seems to work beautifully. But, I’m not really sure if that is a bullet proof method of securing ones data, and it does seem to put a strain on speed after awhile too. Really in my mind, Full Disk Encryption is the only way to ensure your data is safe, and should be faster because the encryption is done before the whole system loads. So i dived into the abyss, and decided to figure out how to do it. You will need to download the Ubuntu Alternate Install Disc, and upon installation you need to select “Guided Partitioning – use entire disk with LVM”. LVM stands for something called Logical Volume Management. I guess it’s a way IBM figured out how to partition hard drives for servers, but anyway we basically need to borrow this technology to encrypt both the main partition and swap partition inside an encrypted virtual partition.

When you choose a paraphrase for your encrypted partition, you really should try and come up with a catchy phrase that ends up being 20 letters. Any less than 20 letters, and I’m told someone could potentially brute-force your paraphrase. Okay, so i guess they still can, but it would take a really long time. After i installed my system i chose to set it up for automatic login. This way i only have to enter in one password when i want to use my computer.

If you are using a Windows or Mac OS, i would Really Really recommend you either switch to Ubuntu and set up some sort of encryption if you are worried about the security of your data, or investigate the options for Full Disk Encryption for your OS. The default configuration of a Mac is extremely vulnerable to people who have physical access to your system. A Windows machine has almost the same vulnerability, and possible worse. I know because I’ve tried accessing both types of systems that were not mine and easily succeeded. I’m told there is proprietary software for Mac to encrypt your partitions. For Windows, you can look into TrueCrypt.

New Nettop Multimedia computer?

I bought myself a “Nettop”, or as it says on the box… a “netbox”. haha

Foxconn NT-510-A-B-A-NA

Anyway, i found it on newegg, and thought it was cool. http://www.newegg.com/Product/Product.aspx?Item=N82E16856119026

But, i found out they just had a sale, so you could get it with 2GB memory for only $120. I was going to buy it for the 169 price, but once i learned about the sale, i got kindof annoyed. So…I bought one from ebay for 120. The problem is, i still had to buy ram and a 2.5″ SATA hard drive for it though…. dang.

But, they should be coming soon, and i can potentially turn this into a multimedia computer, and watch HULU and stuff. I will be using a Linux distro. Probably Ubuntu. I also found this cool DVD burner thing, that’s supposed to go with it. http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=5609253

VD100 DVD Combo

It’s smaller than a Wii… Holy crap. I plan to install the HULU desktop client. Dont know how things will turn out, but it’s something fun to play with.

EDIT: Okay, I got everything installed and working. I also bought the DVD thing too. Installed SATA drive, and 2gb memory. I installed Ubuntu 10.04, and it’s pretty cool. I had to update the system to get wireless working though. I installed the Hulu desktop client, but it’s super slow trying to use this over a VNC connection. I think i will need to invest in some sort of bluetooth remote and keyboard to be able to have a satisfiable media center. Otherwise it’s an awesome and extremely quiet computer.  …hmmm… maybe experiment with a lighter ubuntu based distro?

DeVeDe – DVD Ripping, and DVD creation

Have you ever wanted to copy a movie someone gave you? Or maybe turn one of your home movies into a DVD to give to someone? We’ll, im going to give a quick mention to two very useful, and equally very free programs.

The first one, and probably the one i use more is called “DeVeDe”. It’s a completely  open source and free program that is fantastic. It gives you the option of “importing” various video formats, converting them and adding a DVD menu, before packaging it all into a nice DVD .ISO file ready to burn. I often select the menu option to automatically play the movie, since i usually have no use for menus. It should be noted that it has a bug when estimating the size of AVI files. You usually can go up to 200% full when working with .avi files, before the 4.2GB DVD is full. When working with .FLV files, 100% is probably full.

The second is called “AcidRip” or “AcidRip DVD Ripper”. It’s really cool. It allows you to take any movie (even encypted ones if you have libdvdcss2 installed) and Rip it into .Avi format onto the computer.

I just added subtitles to my first movie today. I used AcidRip to rip a copy of Gattaca to .AVI format, and then included the (already translated) Esperanto subtitle .STL file in the Devede program. Now i have a copy of Gattaca DVD with esperanto subtitles.

Of course… AcidRip has an option to rip the english (or whatever) subtitles into an .STL file when Ripping it from a DVD. So, in theory you could rip subtitles, translate, and then re-encode into DVD .ISO format.

Windows sharing successful!!!

Okay, so not sure if i mentioned it before or not, but i have an old computer (P3 w/ 320mb ram) that i have converted into my test server. It currently already runs an HTTP apache2 website server. and a VNC server for remote connection.

I never had any computer experience with setting up/maintaining server type stuff before. But, since i got my netbook and my free P4 computer i figured what the hell.

It runs on Ubuntu Linux version 8.10 at the moment. I think ubuntu is a great operating system, but especially for a server! It never will get viruses, it has access to thousands of free/open source applications, and can automatically update itself. Three things a dream version of WindowsXP would have :-).

Anyway, so this weekend i dabbled in Samba/SMB (windows file sharing). I wanted to have a nice server at home to hold space for my backups, and wanted the experience by the time i go to CSU. I dont know if i will need/want to set up my own server at CSU for anything, but it doesn’t hurt to be prepared.

Here’s the info for editing the samba configuration in “etc/samba/smb.conf”

workgroup = SCROOGE

#   server string = Samba Server %v

security = share
(this tells it when you want to set up shares without passwords)
#security = user
(this tells it when you want to set up shares with passwords and users)

#you can only pick one though :-)

(this one works great for shares when you dont want passwords prompted and let everyone access to it)

#[test3]
#works!!!!
#path = /home/andrew/test
#valid users = test2 andrew smbuser
#available = yes
#writable = yes
#browsable = yes
#guest ok = yes
#guest only = yes
#guest account = smbuser

(this one should work both ways)

[sb]
path = /home/andrew/sb
#valid users = Barney andrew
#username = Barney
available = yes
writable = yes
browsable = yes
guest ok = yes
guest only = yes
#guest account = Barney

but, if you dabble in passwords it turns out you have to issue the following command to set users up on the linux machine, otherwise they”wont exist” and you will get “permission denied” errors.

sudo useradd -g users Barney
sudo smbpasswd -a Barney

and dont forget to check the folder permissions either, or you will also get “permission denied” errors even when everything else works.

Open-Mesh is ALIVE!

Okay, so i got my open-mesh router today!! It is tiny. It fits in the palm of my hand!

Anyway, i successfully added it to the open-mesh dashboard. And now i successfully ssh’d into it.

andrew@omni:~$ ssh root@192.168.1.2
root@192.168.1.2′s password:

BusyBox v1.8.2 (2008-11-17 16:50:09 CET) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______                          ________             __
|       |.—–.—–.—–.  _  |        |.—–.—-|  |__
|   -   ||  _  |  -__|     | |_| |  |  |  ||  -__|__–|     |
|_______||   __|_____|__|__|     |__|__|__||_____|____|__|__|
|__|  http://www.open-mesh.com ———————

Powered by these open source projects:

http://www.blogin.it       http://kokoro.ucsd.edu/nodogsplash
http://www.openwrt.org     http://www.open-mesh.org
http://www.olsr.org        http://coova.org/
running: r1522 2.6.23.17 OLSR nodogsplash open-mesh
01110010 01101111 01100010 01101001 01101110
————————————————————-
root@me2:~#

running Ubuntu 9.10 alpha5

Im now running Ubuntu 9.10 Alpha5 on my HP mini 110. I got sick of the handicaps implemented on the HP MIE. It has some nice features, which i suppose is why i was able to use it for so long. However, im picky.

I’ve started to experiment with running a home web server on my old P3. I successfully installed Apache2. Not sure what to with it next, but i will figure it out.

Ive been pondering whether i should go for Biomedical Engineering. The more research i put into it, the more i like it. I think i will try to complete a home project by building (or reverse engineering) an oxygen sensor or oximeter. My dad has an oxisensor II D-25, but so far wont let me have it.

First Experiences with my new HP mini 110 (linux)

Ok, so i decided to buy myself a netbook mainly for school. I think they are neat, and portable. HP pre-loads the model with what they call “HP MI” or “mobile internet edition” I’ve played around with it a fair bit to give my thoughts on it.

Off the bat i like that it has a very simple/clean interface. It is definatley designed to get work done. OpenOffice works great, and couldent be better. but, not much else is included by default, and HP seems to have crippled this version of ubuntu. Extra packages from the OpenSource community are almost impossible to install. However, with a bit of navigation one can find a root terminal at >Settings >Advanced >Root terminal.

Ugg. It is a terminal, but it’s a pain. But, on the other hand it’s a terminal, and lets you install (via apt-get) extra programs that you might need/want. I’ve chosen to install a few extras such as KolourPaint, Xsane, & Vinagre.

I tried installing GIMP, however GIMP was unfortunatley not optimised to fit on low resolution netbook screens. I always find myself using a paint program, so Kolourpaint was an acceptable alternative. It’s basically a Microsoft Paint clone, and doesent do very much, but get basics down.

I did install Ubuntu Netbook Remix to replace HP’s MI. It was very nice. I liked it a lot, and would have continued to use it, however there were sound problems and ethernet problems with my hardware. I experimented with a force upgrade to the new karmic 9.10 version, however i ran into MANY bugs, and it was basicially toasr. But, it allowed me to test out HP’s hidden FAT32 recovery partion. I am pleased to say the recovery went very well. I never knew a recovery mode be made for a linux OS.

For the moment im back to using the HP MIE interface. It’s not bad. But, not great fot an intermediate user like myself. What makes things a little even harder is the fact that this is the LPIA architecture and not the familiar 32bit or 64bit system. In other words “normal” ubuntu packages do not install. But, i’ve found a work around by using ALIEN to repackage i386 .deb files into LPIA .deb files. It should be noted that HP also left out the package manager from the default ubuntu install. One can correct that by issuing “apt-get install gdebi” from the root terminal. http://www.matt-helps.com/using-alien-to-convert-rpm-packages-to-lpia-deb

At this exsact moment i am experimenting with other programs not available from the repos. Such as MATLAB, LabVIEW, EagleCAD, Kurso De Esperanto. I am pleased to say that the normal .run file provided by the EagleCAD guy’s woorks just fine on the LPIA netbook. MATLAB seems to run well too when run from the root terminal, however it should be noted that i have never used MATLAB ever before. But, i figured i might as well get in installed since i will be taking many Engineering classes in the future. It has been tedious converting the .rpm LabVIEW packages into LPIA .deb files. I have to use ALIEN, and must complete it in basically 4 steps per package. Ugg. Again Matt’s instructions help out. http://www.matt-helps.com/using-alien-to-convert-rpm-packages-to-lpia-deb

Follow

Get every new post delivered to your Inbox.