|
KenB
|
 |
« on: June 28, 2010, 11:49:31 AM » |
|
Guys (I guess/assume this is a guy thing), I have realised for some time that the standard Arduino could be much enhanced with the addition of a Real Time Clock and an SD Card for data storage. Well those nice chaps at NuElectronics.com have released a new shield that has a Dallas DS1302 RTC with battery backup, a standard SDcard socket and is bristling with 3 pin connectors (actually 6) for connecting one-wire devices. Nuelectronics also do a range of 1 wire sensors such as temp/humidity, gas, LDR, IR- remote control, etc. At £11.50 this seems a great way of enhancing the Arduino and making it ideal for real time control, sensing and datalogging. I've ordered the IR remote control and IR sensor - seems a good way to interact with the Arduino, and a neat way of adding numerical entry and menu type interraction. http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=20With this SD/RTC shield and an ethernet shield added to a ATmega328 Arduino you have the basis of an ethernet/internet accessible real time datalogger for under £50 Ken
|
|
|
« Last Edit: June 28, 2010, 12:14:10 PM by KenB »
|
Logged
|
|
|
|
|
Greenbeast
|
 |
« Reply #1 on: June 28, 2010, 12:08:43 PM » |
|
thanks for the heads, up, that could be a handy board to have
|
|
|
|
|
Logged
|
|
|
|
|
stephendv
|
 |
« Reply #2 on: June 28, 2010, 12:31:10 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
KenB
|
 |
« Reply #3 on: June 28, 2010, 01:05:20 PM » |
|
GreenBeast, Stephendv I came across the seeeduino Stalker just this weekend http://www.seeedstudio.com/depot/seeeduino-stalker-atmega-328-p-600.htmlor in the UK here http://www.airsensor.co.uk/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=1&category_id=4&vmcchk=1&option=com_virtuemart&Itemid=2I opted for the NuElectronics shield because I already had an Arduino, but the Stalker at £27 is also good value. So here's how I think this project is evolving, last year we discussed the idea of a modular "Navitrino", and I think this latest board takes us one step closer to a low cost common hardware platform which can be assembled from off the shelf hardware with minimum of fuss. Stacking the RTC/SD/1-wire onto the standard '328 Arduino gives a basic hub onto which you can add up to 8 peripheral items. I like the idea of having these peripherals as intelligent modules each using one-wire (or async serial) comms to communicate with the hub. In this way, the sensors or peripherals can be placed some distance from the hub and use either low cost telephone extension cables (or CAT5) to convey power and comms. Others in this forum have already developed code for smart 1-wire peripherals based on low cost PICs. This could be extended so that you can have a multichannel temperature sensing board and relay board - at the end of a 1 wire link. Modest baud rate serial comms is perfectly adequate for the sensing and control applications likely to be encounted with renewable energy, and makes for easy opto-isolation - especially relevant if you don't like the idea of your mains powered pump switching relay board in the loft, connected directly to the display module in the living room. If you need ethernet comms and webserver/web client, this is easily done by adding an ethernet shield to the stack. Depending on "wage earning activities" I hope to make progress on the Navitrino datalogger/controller application - using the NuElectronics kit to build a prototype. I've got a simple time/temperature logging application running this weekend with the LCD module I mentioned last week. This currently measures temperatures from 3 thermistor sensors, linearises and converts to centigrade and displays on the LCD as well as providing a time stamped serial output to the PC for logging. Ken BTW - If you want isolation via polymer optical fibre, Farnell do a low cost kit from Avago (part number 327750) for £15.50. I used these last year and found them to be good value. http://uk.farnell.com/avago-technologies/hfbr-0501/fibre-optic-evaluation-kit/dp/327750?Ntt=327750
|
|
|
|
|
Logged
|
|
|
|
|
ericw
|
 |
« Reply #4 on: June 28, 2010, 03:05:27 PM » |
|
There is also another SD card/RTC shield for the Arduino available here, http://www.ladyada.net/make/logshield, although this comes as a kit it does have a prototyping area on which build additional simple interfaces. The interestingly the Stalker seems to be a 138 powered board wheras other people suggest that a 386 is needed. Its also connected to the PC via an RS232 connection and not USB, which may be a problem for modern USB only machines (unless you get an additional interface)
|
|
|
|
|
Logged
|
|
|
|
|
KenB
|
 |
« Reply #5 on: July 17, 2010, 09:53:38 AM » |
|
I've been tinkering with the Arduino and ethernet shield for the last few days. Here's a few details of the work in progress. I'm now able to monitor up to six thermistors and send the data up to Pachube for logging and graphing. The Arduino takes the average of 10 temperature readings and send updates to Pachube every 10 seconds. It also sends the readings to the serial port so that they can be logged locally. It can function as a standalone system, and only requires the router to be turned on. It is not dependent on the laptop being switched on and present. My system currently looks at tank temperatures, room temperatures and the outside temperature. Whilst it's not actually monitoring the solar tubes yet, this is a relatively simple additional step. I've set it up as a generic solar or central heating controller. It has a potentiometer that is used to dial in a temperature set-point, which in a heating controller is the equivalent of a room thermostat. It can be used to control a relay to turn on the boiler and heating circulation pump. The next task is to integrate a flow rate sensor, so that I can make quantitative measurements of heat flow through pipes. As the functionality starts to grow, there is a temptation to distribute seperate control and monitoring functions across several Arduino devices, and link them together with a simple communications link. For example whilst the heating/solar functions can be handled by one device, you would probably want a seperate unit to monitor gas and electricity consumption, and a third to monitor a pV array etc. Below is a picture of the prototype on the bench showing the LCD display and the rather scruffy breadboard lash-up for patching in the cables to the various thermistors. There is also a 433MHz transmitter module that turns the boiler on and off by simulating the wireless protocol used by our Drayton Digistat wireless thermostat. You can view the data from this unit by clicking this link to my Pachube feed http://www.pachube.com/feeds/8729Ken
|
|
|
« Last Edit: July 17, 2010, 09:57:24 AM by KenB »
|
Logged
|
|
|
|
|
StBarnabas
|
 |
« Reply #6 on: July 21, 2010, 12:13:12 PM » |
|
Ken thanks great to see the progress you have made. Sean
|
|
|
|
|
Logged
|
 Gestis Censere. 40x47mm DHW with TDC3. 3kW ASHP, 9kW GSHP, 3kW Navitron PV with Platinum 3100S GTI, 6.5kW WBS, 5 chickens. FMY 2009.
|
|
|
|
KenB
|
 |
« Reply #7 on: July 21, 2010, 06:55:41 PM » |
|
Sean,
I had to go to Newcastle for a couple of days with the new job. My pachube feed has been off line over that time. I hope to re-instate it tonight.
Is it still raining up North? What a contrast to the sunshine of the south east.
Ken
|
|
|
|
|
Logged
|
|
|
|
|
StBarnabas
|
 |
« Reply #8 on: July 21, 2010, 07:47:37 PM » |
|
Ken shame I did not know you were in Newcastle. I would very much have liked to talk about Arduinos etc. and you would be very welcome to look at some of the stuff we are doing. (Ivan and SteveK had a very interesting visit about 6 months ago). If you are up again please PM me.
The weather is warm and sunny today still 22 degrees and have a 65 degree tank (230L from solar) and the PV has generated c 15kWh so far. Hopefully I will have some irradiance sensor installed next week, but very much need your expertise in uploading data to Pachube etc.
Sean
|
|
|
|
|
Logged
|
 Gestis Censere. 40x47mm DHW with TDC3. 3kW ASHP, 9kW GSHP, 3kW Navitron PV with Platinum 3100S GTI, 6.5kW WBS, 5 chickens. FMY 2009.
|
|
|
|
KenB
|
 |
« Reply #9 on: July 21, 2010, 08:49:04 PM » |
|
Sean,
The work with our partners in Newcastle is on-going for the next 12 months or so.
I should be back up again in the week 9th August and will try to make some time. Will PM you nearer the time.
Ken
|
|
|
|
|
Logged
|
|
|
|
|
Baz
|
 |
« Reply #10 on: July 21, 2010, 09:03:18 PM » |
|
I venture to suggest that while heating controllers exist already in various forms there is a shortage of stand alone wind and solar loggers at a reasoable price......
|
|
|
|
|
Logged
|
|
|
|
|
KenB
|
 |
« Reply #11 on: August 06, 2010, 05:58:12 PM » |
|
I've been writing a simple serial command interpreter for the Arduino, which allows you to send various commands to it, and have it execute them.
The purpose of this is to produce general purpose code framework or structure, which allows you to rapidly develop control and monitoring tasks with Arduino based hardware. It's one of my first forays into doing this in C - but is intended to form the re-usable basis of several common Arduino designs.
The command structure can be extended as much as needed, and allows you to update numerical parameters on the fly, or change the program flow with simple commands. It can also be used for interrogating data - such as reading specific sensors and outputing data in a CSV format to a terminal program.
It also allows an Arduino to be controlled with a few simple serial commands, which could be sent from a PC, an ethernet serial gateway, or from another "master" Arduino. You could even get the Arduino to respond to serial commands embedded into a Tweet.
There will be further commands for printing messages to an LCD display, and for retrieving data from a sensor network. Additional commands will allow RAM, eeprom and other registers to be modified froma serial link - such as is needed for initialising pulsecounts or setting the H:M:S of a real time clock to the current time.
Suppose I have a solar pV panel on a tracking system, and I want to control it remotely. the commands a55 and e0 send over a serial link could be used to set the azimuth servo to 55 degrees and the east-west servo to zero degrees. The commands are designed to be easily remembered, with simple mnemonics, but can be configured to do what ever you wish. In order that the command interpreter doesn't use too many resources - the commands have been purposefully left very lightweight, with one alpha character followed by up to a 5 digit number.
In my current example, I have a cooling fan on a heatsink, which I am driving with PWM. On the serial terminal, you type f (for Fan Speed) and then a 3 digit number, and the PWM channel controlling the fan motor, changes accordingly.
This is a trivial example, but I have 3 PWM channels addressable in this way, and also the 8 ADC channels (Arduino Nano). The Arduino handles these as background tasks, whilst also monitoring the current and voltage from a pV panel, and a temperature sensor on the heatsink.
Ken
|
|
|
|
|
Logged
|
|
|
|
|
stephendv
|
 |
« Reply #12 on: August 06, 2010, 07:02:11 PM » |
|
Very nice Ken. That's the sort of approach that's needed to make this arduino stuff more plug and play without having to start with a blank canvas every time. Am just wondering about the alpha character + digit choice. With your pwm example, if you had 3 different fans, what would the commands be to turn them all to the same speed?
Would it be useful to add a "subject" to the command so that you can address various devices, i.e.: <command><subject>,<value> so that you can differentiate between different subjects? For reading data, the <value> bit would be optional, e.g. to read temp sensor 1 could be: r1, to read sensor 2: r2, to turn relay 2 on: t2,1
BTW, not sure if you saw the "electronic brick" section on seeedstudio, a very nice way to interface sensors and outputs to the arduino without soldering a thing.
|
|
|
|
|
Logged
|
|
|
|
|
Baz
|
 |
« Reply #13 on: August 06, 2010, 07:05:00 PM » |
|
Interesting. Are you going to post the code on somewhere like an arduino forum? Have you considered a leading address byte to allow multiple slaves? There are a number of schemes, mostly in robotics oriented interface boards, that it might be worth being compatible with to simplify host software.
|
|
|
|
|
Logged
|
|
|
|
|
KenB
|
 |
« Reply #14 on: August 06, 2010, 07:30:59 PM » |
|
Guys, Thanks for the suggestions. My first priority was to keep it simple - as muggins here has to code it ;-) My string parsing skills are still in their infancy! I'm sure that I can extend it to include more elaborate addressing schemes, but right now I just wanted something to allow me to control a simple monitoring system I'm currently working on. Extra parameters could be added possibly by making them comma separated e.g. f1,100 sets the speed of fan 1 - as you suggest Stephen. I've added a confirmatory reply prompt - so if you want to change the Fan speed value to 100, and type f100, then the Arduino will echo back "Fan Speed 100" to let you know that the command has executed. I've been making a rig that uses very high brightness white LED modules as a controllable lightsource. http://uk.farnell.com/bridgelux/bxra-c4500-00000/array-cool-white-4500lm/dp/1787310These can give out about 30 watts of light output, from a LED array about the size of a 1 pence coin. I'm using the Arduino to control the brightness, and monitor the temperature of the heatsink - bringing the fan on as needed. The serial command interpreter was put together so that I can make parameter changes to the rig, whilst it continues to run the voltage and current monitoring sketch. PM me if you want the code. Ken
|
|
|
|
|
Logged
|
|
|
|
|