navitron
 
Renewable Energy and Sustainability Forum
UK's most popular Renewable Energy Forum May 25, 2012, 01:09:13 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: UPDATE ON DECC APPLICATION FOR LEAVE TO APPEAL TO THE SUPREME COURT | Yingli Green Energy's PV Module Ranks No.2 in TUV Rheinland Energy Yield Test | Navitron Solar Showers at Glastonbury for Year 5!
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: arduino help for monitoring and logging  (Read 3275 times)
Brandon
Hero Member
*****
Online Online

Posts: 1249



« on: July 20, 2009, 07:40:57 PM »

I would appreciate some help from anyone who understands this a wee bit better than I do, this is linked to my message in the solar thermal dept.

cheers

B.
Logged

changing the world, one roof at a time...

"We can't be B&Q astroturfers. That's one conspiracy theory too far. You should cut down on the pot." - Wookey
johnrae
Hero Member
*****
Offline Offline

Posts: 555


« Reply #1 on: July 21, 2009, 07:42:56 PM »

Brandon,

Not the simple answer you're looking for but if you go to the following site there's a good tutorial plus a link to a forum in which there'sa section on Arduino

http://www.ladyada.net/learn/arduino/

I'va also bought one of these but have yet to get involved in programming it - though I did manage to get the led to blink !!

regards

jack
Logged
wyleu
Guest
« Reply #2 on: July 21, 2009, 08:24:51 PM »

...and how many development boards do we all own ?
Logged
EccentricAnomaly
Guest
« Reply #3 on: July 21, 2009, 08:32:54 PM »

2 NGs.

Brandon, could you be a bit more specific?  Are you asking for somebody to do a bit of programming and put a system together for you are you just asking for general advice?  If the first then I might well be able to help as I'm sure would a couple of other people around here.

If it's just general advice: one point to consider is that the Arduino has a pretty limited amount of memory so is not ideal as a logger on its own.  There are two ways round this: add a shield with an SD card to log to or just use the Arduino as a front-end logging to a computer (e.g., a laptop) via the USB port.
Logged
Brandon
Hero Member
*****
Online Online

Posts: 1249



« Reply #4 on: July 21, 2009, 08:39:55 PM »

EA, thanks, sorry to be vague.

I am learning v e r y  s l o w l y how to do the programming thing, but th elong days at work, wife, and small child hamper my time somewhat (bachelor 'till Friday mind, so watch out!)

I would appreciate someone (as talented as your good self perhaps) to explain to me how to translate what the probe is giving me in resistance into something that resembles a temperature, and then how to log it.

I was under the impression that the SD card shield was as yet non-functional.

A wee Sd card jobbie would be great, as it would allow the whole gambit to live in the airing cupboard.

Cheers B. (with bated breath)!
Logged

changing the world, one roof at a time...

"We can't be B&Q astroturfers. That's one conspiracy theory too far. You should cut down on the pot." - Wookey
EccentricAnomaly
Guest
« Reply #5 on: July 21, 2009, 09:27:17 PM »

As far as I know, people have been logging to SD cards just fine.  E.g.,

http://ladyada.net/make/gpsshield/logging.html

I've not tried one but as far as I know it's pretty straightforward.  As that page says, though, it takes a lot of code to write in the FAT-16 (DOS) format.  An alternative is to just write your data straight to the SD card with no file system. 

This forum thread seems to a gold-mine of information: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8

though I've only read the first and last pages so far. surrender

What are your temperature sensors?  PT1000?  If so, that's 1000 ohm at some temperature, rising/falling at so many ohms per °C?
Logged
Dan
Jr. Member
**
Offline Offline

Posts: 96


« Reply #6 on: July 22, 2009, 02:35:01 AM »

http://efsl.be/

the above link is an embedded filesystem whick should work well with a sd card
I think the idea is you write the code to deal with the serial port ( spi) and it deals with the sd card  and the filesytem

Logged

try all things at least once
martin W
Hero Member
*****
Offline Offline

Posts: 548


what do you mean my snoring is too loud!


WWW
« Reply #7 on: July 22, 2009, 08:21:01 AM »

Jumping in on the band wagon here..

simple question.... can you use these boards, etc to monitor temperture (and other stuff) without a pc on... I see you mention about SD cards. I know you need a PC (linux) to program them, but can it be easily and cheaply made to record the data for say weekly or daily downloads ot a pc which then displays it in th erequired formats CSV for example?
Logged

Woodstove Newbie since Feb 2011 Tongue (yes it's finally off the pallet)
Solar Water Heating since 17th March 2009
Chicken Owner - Self sufficient in chicken c*@p, boy watch those tomatoes grow. 
Now an allotment wannabie Tongue
myozone
Full Member
***
Offline Offline

Posts: 170


Gweek - Cornwall


« Reply #8 on: July 22, 2009, 09:57:22 AM »

Jumping in on the band wagon here..

simple question.... can you use these boards, etc to monitor temperture (and other stuff) without a pc on... I see you mention about SD cards. I know you need a PC (linux) to program them, but can it be easily and cheaply made to record the data for say weekly or daily downloads ot a pc which then displays it in th erequired formats CSV for example?

Yes, millions of readings on a SD card..
Logged
wyleu
Guest
« Reply #9 on: July 22, 2009, 09:58:55 AM »

They are small computers lacking the normal range of Inputs and outputs hat the office computer or PC has. Because Microsoft pretty much own the desktop PC they have a considerable say on what a PC means. To help with this they release minimum hardware specifications that a machine should comply to and as well as detailing in exhaustive detail such aspects as the DMA characteristics of SMB devices and such like they also cover minimum ancillaries.
This is a good thing because it means you can expect a PC to have a printer port or a games port and it will be connected in a standard way from both the hardware ( it's got the same number of pins in the right places) and the software ( it responds to specific systems calls to fetch and pt data in and out of the port ) .Now that's all well and good but it means that for a job like recording temperature from a few sensors ( is he going to say one-wire?, nope it looks like he wont !!! ) . Now to do this obviouly large parts of the PC can go. Video card who needs one of those? printer port ( even thou' USB does it all nowadays)? Games port? Sound system?  So what you are left with is a machine with at minimum a power supply, a cpu a bit of memory and some input and output electronics to talk to the sensors and wherever ou store the data.

Now becuae microsoft hasn't done it's standardization you are free to connect this all together any way you want and people can get damn creative about how they use the minimum resources they have to do truly amazing things, but you need to know an awful lot more about what you've got to make sense of it all.

Taking probably the simplest approach.

CPU/memory/Output.


You write a little programme which you load in by some mechanism peculiar to the particular system you have. It might be some special connector or the self same serial port which by dint of special codes is put into learn mode, no matter that is a characteristic of your development system and as such is local expertise.
You start with the tutorials and maybe connect an LED to one of the output pins and write your first programme
normally consisting of something like
   write value to memory location
   loop point:
   write memory location  to output port
   wait
   toggle memory location
   jump to loop point:


and after a morning of swearing cursing and burning your finger on a soldering iron ( it's probably a little less emotional nowadays ) it all works and you wonder at the miracle you have created.

CPU/memory/RS232 port

At this point you'll probably want to output a bit more than one LED so you might well connect up the serial port. The odds are that this will be a pretty standard piece of hardware and software as it's really the lowest common denominator. But there is a catch, because you are setting all the parameters of your little box not Bill Gates the clock speed that you choose will have a major effect on your port. Pick the wrong rate and your 9600 baud settings  could render up as something that no-one on the planet understands.
This stage can involve many months and an unhealthy interest in handshaking, stop bits and RS-232 pin wiring, which will result in a nervous tick when ever RS-232 is mentioned.

But if you get it all right you will have a little box that flashes a light and writes a word ( often vulgar) to a suitably attached PC.

All very good, and very satisfying. And once you've reached this stage adding the sensor into your basic little programme loop is fairly simple and you have produced a device that will, read a value from your sensor and sqirt it out of an rs232 connector.

A quick bit of code at the PC end (oh god here comes the python advert !! ) will allow you to take that data and squirt it into a file on the PC in any form that suits you, because you write the system and have control of both ends of the process you can slice and dice the process any way you want. Time stamp at the micro end? well how do you set the time on your little box? Time stamp at the PC end ? Probably easier.
But already you have a system that has many variables that only you know about unless your code is documented very well. You do document your code do you?

But this means the PC is on all the time and as we know Tomb Raider 96 with the extra helicopter gunship add on pack crashes rather more frequently than we would like so it is quite possible ( absolutely guaranteed in fact )  that your monitoring system PC won't be working when stagnation occurs or Ivan is visiting.

So can you store your data on your little box? Why yes but once again it's another decision and layout that you define.
This is the rel dilemma of this sort of stuff. The flexibility you get and the ability to tune every aspect of the design means you have to support it, and that quickly grows.
You can add a USB connection o your box and after adding code let it output the readings to a memory stick, but once again the choice of format is pretty open. you can equip your box with a web interface and an internet connection and publish a regular small webpage that can be read by another small programme on your PC. These are nice but you will still have to mechanise the removal of data for analysis under your own steam cos once again it's your system.



I have a PC based monitoring system which runs a tight little python event loop which runs to about sixty or so  lines of code ( it tidies up after itself and you can add and remove different types of sensors and output modules  ). It reads 30 or so sensors including multiple TDC controllers , one-wire sensors and MIDI just for my own amusement. Because it's running on a 24 hour PC it chucks all this data straight into an SQL database. That's pretty easy.
Once I've done that I've got 3D models defined in the database, describing the system to which the sensors are attached and quite a nifty modifier system to allow the data to be combined to produce data in eas graphical forms. No problem so far, so why am I taking so long? Because I've had to produce an entirely secure web interface complete with logging in and membership groups and such like to allow diferent people to see diferent sections of the system.
I've started with a bit of sensing and ended up with a community portal.

That's the real design in all this, quite where you'll end up with it, where you locate the different components and who you wish to allow to look at it. IF your system is of anything more than passing interest your kids/wife/partner/community care officer will need access and odds on you don't want them mucking around with your one-wire ID's or the over temperature thresholds and as such you'll need security.

You start by measuring and end up in the world of web frameworks ( Oh, look the django advert ) .
Logged
sleepybubble
Hero Member
*****
Offline Offline

Posts: 988


expect the unexpected, then its expected


« Reply #10 on: July 22, 2009, 11:09:46 AM »

You start by measuring and end up in the world of web frameworks ( Oh, look the django advert ) .

and perhaps by cutting that down, you get to the nub... Presentation of data which is at the other end of the rainbow to harvesting data is proberbly a better starting point.
Key decisions might be, do you want to present your own data, or do you want to use somebody else's system. I think that would define hardware and software better for somebody starting out.
If you really want to put yourself through the wringer, and do it all yourself then it doesn't matter what hardware you go for because you will make it work eventually.
If you want an easier life then some off the shelf kit, and a few installed packages (software) would get you up and running quickly.
Logged

;-)
stephend
Hero Member
*****
Offline Offline

Posts: 562



WWW
« Reply #11 on: July 22, 2009, 01:10:31 PM »

I've just built an arduino control unit for my diesel generator that turns the radiator fan on based on the water temperature and also shuts the generator down in case of over temperature.  I used the analogue LM35 sensors which were very easy to use, but not very accurate.  Had to use an averaging function across a hundred readings to get sensible results - not a problem for my application, but not so good for data logging.  Would use 1-wire next time around.
Logged

Brandon
Hero Member
*****
Online Online

Posts: 1249



« Reply #12 on: July 22, 2009, 06:04:41 PM »

thanks.

Let me cogitate on that for a bit. Undecided
Logged

changing the world, one roof at a time...

"We can't be B&Q astroturfers. That's one conspiracy theory too far. You should cut down on the pot." - Wookey
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #13 on: July 22, 2009, 07:44:27 PM »

If you want a ready built low power way to log to an SD card you might consider this http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=23&products_id=193. It will take an ASCII data string which you can create with the minimum of programming using your Audrino as the interface to the sensors.

Although it's not really what you want to hear, using thermistors as sensors makes life much more difficult as to get good accuracy you not only need to have some accurate circuitry (to convert the resistance to a voltage then measured with the ADC in the Audrino) but as the characteristic is nonlinear you then have to do some calculations to then get the temperature.
It's much easier to let the semiconductor manufacturer do the hard work for you and use a one wire device or something like an LM35
Logged
Brandon
Hero Member
*****
Online Online

Posts: 1249



« Reply #14 on: July 22, 2009, 09:07:18 PM »

I have already encounterd the LM35, if that is easier then I am on board.
Logged

changing the world, one roof at a time...

"We can't be B&Q astroturfers. That's one conspiracy theory too far. You should cut down on the pot." - Wookey
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!