Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

I've ended up using the code from here it works really well, just change the loop time to 3000 instead of a bonkers 100

Lab3 - Laboratory for Experimental Computer Science

It gives it out like this:

Melexis MLX90614 temperature Sensor

object temp: 018.91 ambient temp: 018.23

object temp: 018.81 ambient temp: 018.23

object temp: 018.95 ambient temp: 018.19

Hand in front....

object temp: 024.87 ambient temp: 018.25

object temp: 025.5 ambient temp: 018.25

object temp: 025.7 ambient temp: 018.33

object temp: 025.13 ambient temp: 018.29

Link to comment
Share on other sites

  • Replies 490
  • Created
  • Last Reply

I just started setting up to play and broke all the wires on the lead (using an old printer cable to connect to the MLX so not very sturdy...away from home so don't have a screw driver..DOH!

I am using code which is a focuser and cloud detector rather than just the code from the link. I then have VB recording the data every 10s, 1min, 5 min or 10 min depending on setting.

Next thing is to make a graph on the VB...also getting a new weather station that I hope to add in. I want to link this all to the website :/p

Link to comment
Share on other sites

the ambient temperature is the temperature of the chip.

your values are looking good i think. I've done integer only (for now) as I think you won't get sub-degree accuracy, really. Especially when it's aimed at the sky.

Link to comment
Share on other sites

Done...

I can now read the light level from the LDR and the 2 temperatures from the sensor via SNMP!

I had no idea this could be done in a few hours. I thought it would take me weeks, considering this is my first Arduino project ever...

Link to comment
Share on other sites

If anyone is interested, here is the sketch.

It assumes an Arduino Duemillanove (will probably just run on others), an LDR on analogue pin 1, the MLX90614 sensor connected to I2C, the original Arduino Wiznet W5100 Ethernet shield and the 4bit LCD shield.

I'll put some of the code into functions next.

Weather_Station.zip

Link to comment
Share on other sites

The LDR is this one here:

2 * LDR Light Dependant Resistor Sensor 10k nominal 10L on eBay (end time 29-Nov-10 10:59:55 GMT)

It's just a standard 10k LDR.

And the project box is this one here:

ABS Project Box & Aluminium Lid & Matrix Board (5 pack) on eBay (end time 12-Nov-10 10:04:06 GMT)

I think this is an excellent offer. 5 boxes with PCB for just over £5 delivered. Couldn't resist. ;-)

I glued the sensors into the box and hope that this will be water proof.

Link to comment
Share on other sites

Not very busy at work today, so I'm researching humidity sensors.

The SHT15 looks promising. It has humidity and temperature, allows for dew point calculation and has a I2C / SPI interface. The downsides are that it's tiny (but can be bought on a breakout board) and that it's rather pricey.

SparkFun - Humidity and Temperature Sensor - SHT15 Brea on eBay (end time 15-Dec-10 09:37:15 GMT)

There are other, far cheaper ones but they would be harder to interface with the Arduino...

Link to comment
Share on other sites

Don't know if I mentioned that before. The LDR is meant to help the cloud sensor. I think it was Neil who said that comparing ambient and object (sky) temperature to detect clouds only works reliably when it's dark. So the LDR will prevent cloud alarms during the day.

Link to comment
Share on other sites

I believe the problem with day time temp may be the sun heating up the mlx case and giving higher ambient readings....but we can play.

Still very busy at work so getting a bit jealous of all this progress your making! Going to uk for the weekend so will pop by maplins in southampton and pick up an LDR and a few other things.

Oohh and i am writing some code to post an html file to a website for automatic posting of data.

Link to comment
Share on other sites

Ah, so you could either keep the sensor in the shade, though the IR part would still need to "look" at the sky. Or, alternatively, just put a LM35 onto an analogue pin and get a ambient temperature reading from the shade somewhere...

Link to comment
Share on other sites

I think the better option is another temp sensor as putting the ir sensor in the shade implies a wall or object sheltering it...another posible source of ir radiation.

I have a similar weather station to one George has so will be using that. I would love to eaves drop on the wireless comms for that and steal the data but may have to do with the old usb cable to the base station instead.

Link to comment
Share on other sites

I'm gradually losing the will to live ;)

Ic2mster is causing me no end of grief, no matter which directory I place it in the sketch errors out when trying to compile, I have read and re-read this thread and the one's on the Arduino forum. I have reinstalled the Arduino software twice and still no joy.

Arrrrrrrrrrrrrrrrhhhhhhhhhhhhhhhhhhhhhhhh :)

Link to comment
Share on other sites

Latest version 0021, here's the error code:

sketch_nov19a.cpp:1:23: error: i2cmaster.h: No such file or directory

sketch_nov19a.cpp: In function 'void setup()':

sketch_nov19a:6: error: 'i2c_init' was not declared in this scope

sketch_nov19a.cpp: In function 'void loop()':

sketch_nov19a:16: error: 'I2C_WRITE' was not declared in this scope

sketch_nov19a:16: error: 'i2c_start_wait' was not declared in this scope

sketch_nov19a:17: error: 'i2c_write' was not declared in this scope

sketch_nov19a:20: error: 'I2C_READ' was not declared in this scope

sketch_nov19a:20: error: 'i2c_rep_start' was not declared in this scope

sketch_nov19a:21: error: 'i2c_readAck' was not declared in this scope

sketch_nov19a:23: error: 'i2c_readNak' was not declared in this scope

sketch_nov19a:24: error: 'i2c_stop' was not declared in this scope

post-13224-133877503288_thumb.jpg

Link to comment
Share on other sites

Ive done some digging in this Arduino Forum - Melexis SMBus IR Thermometer - NFI

Reply #25

2) Download Peter Fleury's nice library...

BUT place it under /{arduino root}/libraries/"what-ever-folder" where the current Arduino software looks for the libraries when started. You also have to rename the "twimaster.c" to "twimaster.cpp" as instructed so that Arduino can build it when launched. You also have to create a "keywords.txt" file inside the "what-ever-folder" where you define the library functions (function names and KEYWORD2 only). Without doing this Arduino cannot find and build the library. You can copy and edit the keyword file from some other library or see some help at Arduino's LibraryTutorial (Sorry, but it seems I cannot mail any links - just google for it

Seems like this keywords txt is the cause of my problems, looked in all the other libraries and everyone has a keyword txt except the ic2master library :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.