Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

  • Replies 490
  • Created
  • Last Reply

That's how I built it now. Wasn't able to test it yet though.

How do you connect the sensors to the Arduino? My top shield is an LCD shield and it doesn't have further header connectors on top. I ordered a prototype shield to go in between but haven't received it yet. I planned to use that as a break-out shield for some I/O pins.

Link to comment
Share on other sites

I'm still waiting on my Ardiuno, 3 weeks in :)

As soon as it comes I can get stuck in. Won't be doing the focus control now though as the new Borg only has a helical focuser. Might just be an good excuse to save up for the feathertouch :eek:

Link to comment
Share on other sites

I thought i had the 5v version...but i also remember a problem with pull ups....i will check out how i have it set up when i get home.

I really cant remember...i will post the details and the source code for all the software.

Link to comment
Share on other sites

I have it setup as 5v with 4.7k pull ups BUT i think i have the AAA version. I cant read the markings though as i have a stonking headache.

I will upload some code and an install file to the groups page which will do for testing...i wont be doing any coding tonight though.

Remember to install the ic2 library files i have posted the link somewhere...

Link to comment
Share on other sites

I'm tinkering with this the whole afternoon. I wrote my first sketch that reads the value from an LDR and prints it on the LCD shield and on the serial port. That works fine after some String, char and *char issues... ;-)

Now I want to add the MLX90614 to the code. First confusion was that some documentation says that I2C is on digital pins 4 and 5 (on the Arduino 2009) and some say analogue pins 4 and 5.

Then, I see that in your Code Layout.doc you use 0x5A as the device address. Is that the default address or have you set that address on the sensor. If you've set it, how? I've been through the MLX90614 data sheet but I can't work that out.

Also, how do you disable the internal pull-ups?

Currently I'm getting all zeroes back.

I've attached the sketch.

light_level.zip

Link to comment
Share on other sites

The MLX90614 is digital so it goes to the digital pinouts, Neil posted a schematic in this thread for the pullups. I built mine to his plans but have spent all weekend sorting the mother inlaws heating out so I have not tested yet.

Link to comment
Share on other sites

See this thread:-

see sensorjunkies instructions..make the changes as stated and put the files in the stated folders (it also states to connect to 3.3v etc)...

Arduino Forum - Melexis SMBus IR Thermometer - NFI

One of the people states that there is an issue with the wire library and the MLX coms to do with the start and stop.

I also found his code and the ic2master library easy to use. It really was a case of the code was fin but I had the wiring incorrect.

Sort the wiring out and the library install and it should work straight away (thats a bit of a stupid statement..).

Oh and I have a Mega so the pins are 20 and 21 in the corner under communications....but Analogue pins 4 and 5 for the smaller boards

Link to comment
Share on other sites

The problem is I have a mega and the pins are labeled on 20 and 21 as SDA SCL and I don´t have the smaller Arduino. On the Arduino website it states the Analogue pins 4 and 5 are duel use as I2C comms as well....but I can´t confirm it.

I think I may buy one of the smaller Arduinos next week.

Link to comment
Share on other sites

Yep! The only problem I had was I connected to the damn 4 and 5 pins and couldn´t get it working...it was only when I bothered looking at the board I saw the pin out was different and errrr labeled! It worked first time after that.

Link to comment
Share on other sites

Thank. I got this working last night at about 2:30.

I got errors when compiling; either some i2c functions were undefined or defined multiple times. I googled around and, to my astonishment, found the answer/solution in this very thread. :) The trick was to rename twimaster.c to twimaster.cpp. Doh! ;-)

Once I had that worked out, I did get values from the sensor and they did increase when I put my hand in front of the sensor (it's warmer).

But the values seem to be miles off. I've used the conversion from your code layout word document. But I get odd values. When the sensor is just lying there I get about 2500-ish, with the hand in front it goes up to 3500 and with a flame from a lighter it goes up to just over 7000.

My guess is that this could be a timing issue. I did not yet modify the CPU speed value in the i2c lib. It was just too late last night.

Will try today again. But it does look like the 3.3V version of the sensor will be OK.

Link to comment
Share on other sites

I got the correct values now. The conversion in you word document was wrong. Must have been an early version of the code. ;-)

It's in 0.02 degree K steps so it's value / 50 - 273 to get degrees Celsius.

Next step: SNMP. Can't wait... :)

Link to comment
Share on other sites

see sensorjunkies instructions..make the changes as stated and put the files in the stated folders (it also states to connect to 3.3v etc)...

What does it mean by "put the code into wiring"?

Never used this stuff before but kind of getting there :)

Link to comment
Share on other sites

Ah I see, it's got to be put into the program

I integrated that code, putting the right bits into Setup and Loop, I'm getting this every 3 secs (after I lengthened the time as it was too short)

19.5

19.0

19.11

19.7

19.5

19.16

19.5

19.1

19.5

19.0

19.5

18.95

18.94

19.1

18.95

19.1

19.0

19.1

19.0

19.1

19.0

18.95

19.0

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.