Automate your science experiments

 by James Moxham
Beaker_muppet.jpg
Automate your next science experiment for under $20 with a datalogger and free up time for more important things like this French Kissing Instructable http://www.instructables.com/id/How-to-French-Kiss/
 
Remove these adsRemove these ads by Signing Up

Step 1: Datalogging for dummies

Schematic.jpg
Your teacher has asked you to measure the temperature of a cup of hot water as it cools down. You need to measure the temperature every minute, record the data and make some conclusions. Boring! Why not measure everything automatically with a datalogger and export the data directly into an Excel spreadsheet? Now your graphs will look professional, no one can say you didn't do the measurements properly and, most importantly, you will have freed up some precious time!

This example measures temperature, but can easily be changed to measure things like light, volts, current, speed, rotation, acceleration, soil moisture or any number of other variables. We are using the picaxe as a cheap way of interfacing multiple analog and digital inputs to an RS232 port, though these chips can do a lot more than that - see http://www.instructables.com/id/Control-real-world-devices-with-your-PC/

Parts list

You will need:
1 computer
1 picaxe chip 08M ($3)
Breadboard
Components - resistors, capacitors, temperature sensors, regulator, wires.
Free copies of the picaxe programming software and VB.Net

The picaxe 08M chip available from many sources including Rev Ed http://www.rev-ed.co.uk/picaxe/ (UK), PH Anderson http://www.phanderson.com/ (USA) and Microzed http://www.microzed.com.au/ (Australia)

The RS232 plug is a D9 female plug. If you are doing a lot of experiments and don't want to keep reaching behind the computer, you can make an "extension lead" using male and female IDC 9 pin plugs and a metre or so of ribbon cable.

The picaxe has been configured in a slightly unusual download circuit which doubles as both a programming circuit and a communications circuit. Flick the switch to go between programming and communications (or just short leg 2 to ground on a protoboard to run in communication mode).

The LM35 devices output millivolts equal to degrees in centigrade. Looking at the writing on the case, the pins are numbered 1,2,3.

WhoTookMudshark says: Aug 8, 2011. 5:49 PM
I'm trying to do this with VB 2010 Express, and it seems like the "Form1_Load" section is never being executed (and, as a result, nothing else is either). Has anyone else had/conquered this problem?

If I create a button that launches the "Form1_Load" module, this program works just fine. I am guessing that something has changed with the nomenclature of events that are supposed to happen on load? I do not have very much experience with VB so maybe I am missing something very silly.
James Moxham (author) in reply to WhoTookMudsharkAug 8, 2011. 6:59 PM
Sorry about this - when I wrote this in vb2008 I was thinking that one day it would become obsolete. I didn't think it would happen this fast! Many versions of basic are not backwards compatible (eg vb6 to .net).

I wonder if you could start with a brand new project in 2010, create a form, compile that and see if it at least loads the form automatically. If that works, then copy things one bit at a time into the new program. Maybe create the buttons from within the new program and then copy the code for that button. So you are creating all the objects like buttons, text boxes in vb2010 and hopefully they will all tie together.
WhoTookMudshark in reply to James MoxhamAug 9, 2011. 6:41 AM
I think it has to do with the "handles" section of the function header. There is probably a handily named construct like "Handles Form1.Load" that I just needed to find and put on the end there. (Haha, I just googled it, and it appears that my guess was exactly right!)

When I gave Form_Load a button-click trigger, everything ran perfectly. I cranked up the refresh rate a little bit (although I noticed my setup did not like anything much faster than 2 seconds) and now everything is working perfectly. Thank you!
MatthewEnderle says: Aug 13, 2010. 11:05 AM
So why is there two LM35s on this circit. is it to take an average?
Dr_Acula in reply to MatthewEnderleAug 13, 2010. 4:30 PM
One LM35 might be recording the outside temperature and one recording the inside temperature. The main reason is to show that the picaxe has more than one A to D converter.
MatthewEnderle in reply to Dr_AculaAug 13, 2010. 8:10 PM
Oh thanks. I really like this circuit. I saw it today first and all ready have the parts I will need in my cart. I never thought of the two LM35 for that action. Then again, thanks for the quick response.
James Moxham (author) in reply to MatthewEnderleAug 13, 2010. 9:12 PM
Glad to help. If you have any problems either post here or over in the picaxe forum http://www.picaxeforum.co.uk/forumdisplay.php?f=2
wgrube says: May 29, 2009. 10:56 PM
Good job! I'm looking for circuits like this. I need to measure two different temperatures to calculate relative humidity and log this on a computer. There are R.H. sensors that could do this, but over 95% they don't work fine. The picaxe microcontrollers are very interesting and, since they are programmable in BASIC, easy to use. This instructable will help me a lot, thanks!
graafr says: Feb 13, 2009. 9:07 AM
I'am new to breadboards, could the author of this datalogging stuf send me a more detailed way how to connect the different compenents into the bread board? I couldn't rebuild it from the picture...
Dr_Acula in reply to graafrFeb 13, 2009. 4:12 PM
If you look at the breadboard in the photo, start from the middle. The 5 holes going up are all connected to each other. Similarly the 5 holes going down are connected to each other. Then along the top is two rows - these go all the way from one side to each other and are connected. So you get two power supply rails at the top, two power supply rails at the bottom, and then those vertical connections going up and down. See http://en.wikipedia.org/wiki/Breadboard and the third picture down on the right. (except there is no horizontal connection down the middle like on that board).
Personally I think it is easier to copy it from the schematic than from the photo of the breadboard. Let me know if this helps, cheers, James Moxham
Kryptonite says: Nov 7, 2008. 3:55 AM
OMG, I HAD TO SEE THIS, IT HAD BEAKER!!!!!!! FOR THAT, I GIVE YOU A THUMBS UP!
CanisLupus says: May 10, 2008. 10:28 PM
Alright! I've been looking for something of this genre for some time now. Thanks!
Da_Fudge says: Apr 14, 2008. 2:01 AM
cool
scotty3785 says: Apr 4, 2008. 11:57 AM
I'm guessing that the PICAXE has some kind of built in logic level converter so that the serial interface works? Nice little instructable, perfect for beginners to electronics!
James Moxham (author) in reply to scotty3785Apr 4, 2008. 3:14 PM
Yes it does have a level converter, of sorts. The circuit limits the current and actually works with other chip families as well. I've been using the same circuit for over 2 years into a 74HC04 gate with no problems. You could use 1488/1489 or Max232 chips if you want a true robust RS232 connection but this isn't really necessary.
scotty3785 in reply to James MoxhamApr 4, 2008. 4:43 PM
Ah ok. Some serial ports can be quite picky. Out of preference I tend to use Sipex logic level converters rather than Maxim ones. Although of late I have been using a Lantronix XPort to read in data from my microcontroller projects through an ethernet interface, highly recommended!
GorillazMiko says: Apr 4, 2008. 4:06 PM
Woah-- looks complicated.
The first picture = hilarious. ;-)
scotty3785 says: Apr 4, 2008. 11:59 AM
Oh, just noticed. If you get wires stuck in bread board you should just be able to take off the tape or sticky pad at the back and use another bit of wire to take out the bits that's stuck
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!