Tuesday, October 23, 2012

Washing Up



Here's a little mix I did whilst I was meant to be washing up.

Enjoy!

Sunday, September 2, 2012

Netduino - Optocoupler testing

I have finally had chance to spend a few minutes on the last part of my relay control board, this part demonstrates the use of an optocoupler along with PWM to control a 12 volt LED. My next test will be to use this circuit with a computer fan in order to provide the fan control for my relay enclosure.

This circuit is very straight forward, it uses a 4N35M octocoupler, an LED and 2 resistors. There is a 1k resistor between the digital out of the netduino and pin 1 on the octo and another to match the LED. I am using a 12 volt 1 amp power supply in this example.



using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace CIRC_08
{
public class Program
{
static PWM pwm = new PWM(Pins.GPIO_PIN_D5);

public static void Main()
{
while (true)
{
for (int sensorValue = 1; sensorValue < 101; sensorValue++) { Debug.Print(sensorValue.ToString()); pwm.SetDutyCycle((uint)sensorValue); Thread.Sleep(100); } for (int sensorValue = 100; sensorValue > 2; sensorValue--)
{
Debug.Print(sensorValue.ToString());
pwm.SetDutyCycle((uint)sensorValue);
Thread.Sleep(100);
}

pwm.SetDutyCycle(0);
Thread.Sleep(10000);
}
}

}
}

Tuesday, June 26, 2012

Netduino - Update Relay Control Board Mock-Up

I have finally managed to get my relay control board prototype working. What this allows me to do is control the relays with 12 volts and also to light a 12v LED to display which relays are on.

I am currently using a 74HC595 to provide the control logic to switch the transistors on and off. The next stage is to control the fans using PWM, I also need to add a DS18B20 that will connect in to my 1-wire bus. The temperature sensor will be used to control the speed of the fans, I may in fact used 2 temperature sensors to control the 2 fans independently for each of the heat sinks.

As I now have a Netduino GO I am working towards modularising my main aquarium control board. The first thing I want to modularise is this control board so it will work with the GO bus. I am hoping that the STM8 will provide enough IO to control the transistors and also PWM for the 2 fans. It would also be amazing if there was a spare serial port so I can create a 1-wire bus on the same board, but I have a fair bit of learning to do before I can get started with the STM8S103F2P6 chips I've got.

Here is a little video showing the shift registers switching the transistors on and off that control the LEDs.


Sunday, June 24, 2012

Alpha Numeric Counter

Hi,

Here is a little Alpha numeric counter I have written that will either continue counting or will return the next value.


public string AlphaNum(string val)
        {
            StringBuilder sb = new StringBuilder(val);
            bool incNext = false;
            for (int n = sb.Length; n > 0; n--)
            {
                if (n == sb.Length || incNext)
                {
                    char nextChar;
                    char letter = Convert.ToChar(sb.ToString(n - 1, 1));
                    if (letter == '9')
                    {
                        incNext = true;
                        nextChar = 'A';
                    }
                    else if (letter == 'Z')
                    {
                        if (n - 2 > -1)
                        {
                            if (sb.ToString(n - 2, 1) != "Z")
                            {
                                incNext = true;
                                nextChar = '0';
                            }
                            else
                            {
                                incNext = true;
                                nextChar = 'Z';
                            }
                        }
                        else
                        {
                            incNext = true;
                            nextChar = 'Z';
                        }
                    }
                    else
                    {
                        nextChar = (char)(((int)letter) + 1);
                        incNext = false;
                    }
                    sb.Remove(n - 1, 1).Insert(n - 1, nextChar.ToString());
                }
            }
            return sb.ToString();
        }

Thursday, April 12, 2012

Netduino - Quick update...

I am still testing my aquarium control board, I have found a ground issue that is affecting the shift registers and in turn the TLC5940s. This is something that may take a while to solve and probably a lot of continuity testing and a bit of solder work.

My overall testing is going well at the moment, I have my shift register fully tested and working, bar the above ground issue. The realtime clock is working thanks to a little help from Stefan. Nevyn has lent my an oscilloscope while I find one, this has been great as I have started to learn how to use a scope and how to interpret the results which will be helpful for when I get one. The scope was a necessity in order to test the oscillator circuit and the TLCs PWM output. So far I have managed to find a few faults in the soldering of the oscillator and TLC circuits, I now have a square wave coming out of the oscilator, a saw tooth on the BLANK signal (which may need looking at) and I have managed to get an LED to light on the TLCs. Sadly this doesn't round of the testing of the TLCs and oscillator as the LED was kind of strobing along to the "Breath" code rather than smoothly diming in and out with a constant light. Again this may be related to the ground issue, but I have a feeling I need to further test the clock and BLANK signals.

BREAKING NEWS!!!

I have just ordered the new Netduino Go, the shield base and the touch screen display from Nwazet.

Can't wait!

Wednesday, March 28, 2012

Netduino - Prototype testing

This is just a quick update...

I am currently going through testing each part of my main control board to make sure it all works together. Hopefully all is well, but to make perfectly sure, despite some of my testing before I finished soldering everything up, I am going through every component again.

During the build I did a lot of continuity testing to make sure there were no broken tracks or joins that shouldn't exist. Powering the entire board didn't result in anything dramatic like smoke or fire, so I'm taking that as a good thing.

The main elements of the board to test in the initial phase are:

RTC
Shift Registers
TLCs

This covers the main functions and until all are working with code there’s no point moving on to the rest. I have most recently been trying out the TLC5940s for the first time. On first test with Nevyn's sample code nothing happened, on further investigation I remember that I delegated some of the logic for BLANK and VPRG to the multiplexed GPIOs, provided by the 74HC595s. I did a little bit of code reworking to incorporate Stefan's MultiSPI library and his shift register libraries and tried again. Unfortunately the code still failed and I think it is to do with the way I am trying to call the logic pins provided by the 595's. I will update further on this once I work out what is going wrong.

So far that’s 2 fails out of the 3, however thanks to some help from Stefan and no thanks to some confusion whilst soldering, I got the RTC back up and running.

Here is some sample code based on Fabien’s RTC library:


using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using netduino.helpers.Hardware;

namespace RTC
{
public class Program
{
public static void Main()
{
var clock = new DS1307();
DateTime CurrTime = DateTime.Now;
// Set the clock to some arbitrary date / time
clock.Set(CurrTime);

// Make sure the clock is running
clock.Halt(false);
while(true)
{
// Test reading RTC clock registers
Debug.Print(clock.Get().ToString());
Thread.Sleep(1000);
}

}
}
}




using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

namespace netduino.helpers.Hardware {
///


/// This class implements a complete driver for the Dallas Semiconductors / Maxim DS1307 I2C real-time clock: http://pdfserv.maxim-ic.com/en/ds/DS1307.pdf
///

public class DS1307 : IDisposable
{
[Flags]
// Defines the frequency of the signal on the SQW interrupt pin on the clock when enabled
public enum SQWFreq { SQW_1Hz, SQW_4kHz, SQW_8kHz, SQW_32kHz, SQW_OFF };

[Flags]
// Defines the logic level on the SQW pin when the frequency is disabled
public enum SQWDisabledOutputControl { Zero, One };

// Real time clock I2C address
public const int DS1307_I2C_ADDRESS = 0x68;
// I2C bus frequency for the clock
public const int DS1307_I2C_CLOCK_RATE_KHZ = 100;

// Allow 10ms timeouts on all I2C transactions
public const int DS1307_I2C_TRANSACTION_TIMEOUT_MS = 10;

// Start / End addresses of the date/time registers
public const byte DS1307_RTC_START_ADDRESS = 0x00;
public const byte DS1307_RTC_END_ADDRESS = 0x06;

// Square wave frequency generator register address
public const byte DS1307_SQUARE_WAVE_CTRL_REGISTER_ADDRESS = 0x07;

// Start / End addresses of the user RAM registers
public const byte DS1307_RAM_START_ADDRESS = 0x08;
public const byte DS1307_RAM_END_ADDRESS = 0x3f;

// Total size of the user RAM block
public const byte DS1307_RAM_SIZE = 56;

// Instance of the I2C clock
I2CDevice clock;

public DS1307() {
clock = new I2CDevice(new I2CDevice.Configuration(DS1307_I2C_ADDRESS, DS1307_I2C_CLOCK_RATE_KHZ));
}

///


/// Gets the date / time in 24 hour format.
///

/// A DateTime object
public DateTime Get() {
byte[] clockData = new byte [7];

// Read time registers (7 bytes from DS1307_RTC_START_ADDRESS)
var transaction = new I2CDevice.I2CTransaction[] {
I2CDevice.CreateWriteTransaction(new byte[] {DS1307_RTC_START_ADDRESS}),
I2CDevice.CreateReadTransaction(clockData)
};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C transaction failed");
}

Debug.Print(clockData[4].ToString() + "/" + clockData[5].ToString() + "/" + clockData[4].ToString());

return new DateTime(
BcdToDec(clockData[6]) + 2000, // year
BcdToDec(clockData[5]), // month
BcdToDec(clockData[4]), // day
BcdToDec(clockData[2] & 0x3f), // hours over 24 hours
BcdToDec(clockData[1]), // minutes
BcdToDec(clockData[0] & 0x7f) // seconds
);
}

///


/// Sets the time on the clock using the datetime object. Milliseconds are not used.
///

///
A DateTime object used to set the clockpublic void Set(DateTime dt) {
var transaction = new I2CDevice.I2CWriteTransaction[] {
I2CDevice.CreateWriteTransaction(new byte[] {
DS1307_RTC_START_ADDRESS,
DecToBcd(dt.Second),
DecToBcd(dt.Minute),
DecToBcd(dt.Hour),
DecToBcd((int)dt.DayOfWeek),
DecToBcd(dt.Day),
DecToBcd(dt.Month),
DecToBcd(dt.Year - 2000)} )
};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C write transaction failed");
}
}

///


/// Enables / Disables the square wave generation function of the clock.
/// Requires a pull-up resistor on the clock's SQW pin.
///

///
Desired frequency or disabled///
Logical level of output pin when the frequency is disabled (zero by default)public void SetSquareWave(SQWFreq Freq, SQWDisabledOutputControl OutCtrl = SQWDisabledOutputControl.Zero)
{
byte SqwCtrlReg = (byte) OutCtrl;

SqwCtrlReg <<= 3; // bit 7 defines the square wave output level when disabled // bit 6 & 5 are unused if (Freq != SQWFreq.SQW_OFF) { SqwCtrlReg |= 1; } SqwCtrlReg <<= 4; // bit 4 defines if the oscillator generating the square wave frequency is on or off. // bit 3 & 2 are unused SqwCtrlReg |= (byte) Freq; // bit 1 & 0 define the frequency of the square wave WriteRegister(DS1307_SQUARE_WAVE_CTRL_REGISTER_ADDRESS, SqwCtrlReg); } ///


/// Halts / Resumes the time-keeping function on the clock.
/// Calling this function preserves the value of the seconds register.
///

///
True: halt, False: resumepublic void Halt(bool halt) {
var seconds = this[DS1307_RTC_START_ADDRESS];

if (halt) {
seconds |= 0x80; // Set bit 7
}
else {
seconds &= 0x7f; // Reset bit 7
}

WriteRegister(DS1307_RTC_START_ADDRESS, seconds);
}

///


/// Writes to the clock's user RAM registers as a block
///

///
A byte buffer of size DS1307_RAM_SIZEpublic void SetRAM(byte[] buffer) {
if (buffer.Length != DS1307_RAM_SIZE) {
throw new ArgumentOutOfRangeException("Invalid buffer length");
}

// Allocate a new buffer large enough to include the RAM start address byte and the payload
var TrxBuffer = new byte[sizeof(byte) /*Address byte*/ + DS1307_RAM_SIZE];

// Set the RAM start address
TrxBuffer[0] = DS1307_RAM_START_ADDRESS;

// Copy the user buffer after the address
buffer.CopyTo(TrxBuffer, 1);

// Write to the clock's RAM
var transaction = new I2CDevice.I2CWriteTransaction[] {I2CDevice.CreateWriteTransaction(TrxBuffer)};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C write transaction failed");
}
}

///


/// Reads the clock's user RAM registers as a block.
///

/// A byte array of size DS1307_RAM_SIZE containing the user RAM data
public byte[] GetRAM() {
var ram = new byte[DS1307_RAM_SIZE];

var transaction = new I2CDevice.I2CTransaction[] {
I2CDevice.CreateWriteTransaction(new byte[] {DS1307_RAM_START_ADDRESS}),
I2CDevice.CreateReadTransaction(ram)
};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C transaction failed");
}

return ram;
}

///


/// Reads an arbitrary RTC or RAM register
///

///
Register address between 0x00 and 0x3f/// The value of the byte read at the address
public byte this[byte address] {
get {
if (address > DS1307_RAM_END_ADDRESS) {
throw new ArgumentOutOfRangeException("Invalid register address");
}

var value = new byte[1];

// Read the RAM register @ the address
var transaction = new I2CDevice.I2CTransaction[] {
I2CDevice.CreateWriteTransaction(new byte[] {address}),
I2CDevice.CreateReadTransaction(value)
};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C transaction failed");
}

return value[0];
}
}

///


/// Writes an arbitrary RTC or RAM register
///

///
Register address between 0x00 and 0x3f///
The value of the byte to write at that addresspublic void WriteRegister(byte address, byte val) {
if (address > DS1307_RAM_END_ADDRESS) {
throw new ArgumentOutOfRangeException("Invalid register address");
}

var transaction = new I2CDevice.I2CWriteTransaction[] {
I2CDevice.CreateWriteTransaction(new byte[] {address, (byte) val})
};

if (clock.Execute(transaction, DS1307_I2C_TRANSACTION_TIMEOUT_MS) == 0) {
throw new Exception("I2C write transaction failed");
}
}

///


/// Takes a Binary-Coded-Decimal value and returns it as an integer value
///

///
BCD encoded value/// An integer value
protected int BcdToDec(int val) {
return ((val / 16 * 10) + (val % 16));
}

///


/// Takes a Decimal value and converts it into a Binary-Coded-Decimal value
///

///
Value to be converted/// A BCD-encoded value
protected byte DecToBcd(int val) {
return (byte)((val / 10 * 16) + (val % 10));
}

///


/// Releases clock resources
///

public void Dispose() {
clock.Dispose();
}
}
}


The next group of things to test after I get the shift registers and TLCs working will be:

SD
Wi-Fi
Serial Mux
LCD
PH
1-Wire (Waiting on 4.2 release with 1-wire support)
Auto temp probe registering 1-wire network.

Thursday, March 22, 2012

Netduino - High Power LED drivers

I am currently working on a high power LED driver; this will be used to drive my aquarium lighting.

So a brief overall spec:

The aquarium lighting rig will allow for individual control of the LEDs, this will allow for lighting effects such as cloud cover, seasons, lunar/solar cycles and lightening.

These effects along with the overall lux, colour and contrast will be achieved by having control over the LEDs individually. There will be 3 watt white Cree's, Royal Blues, Red and Greens. This combination will allow for both day and moon light and the reds and greens will allow me to adjust the colour warmth.

In total there will be 30 Leds:

14 x 3W White Cree
10 x 3W Royal Blue
3 x 3W Red
3 x 3W Green

The LEDs will be mounted on a 3mm aluminium sheet, evenly spaced, with various lenses to create an even colour and lux distribution.

The LED drivers will need to be extremely efficient i.e. above 90%, the design Magpie is proposing should achieve over 95% efficiency when used with 6 LEDs in a chain. As I will be using only 1 LED per chain this will be slightly less efficient but I am hopeful that I will still achieve at least 90%.

I will give some more specific details about the drivers and the overall build as I have more information. Currently I have the LEDs and some inductors for building the drivers, so the next steps will be to get the rest of the parts I need and in the mean time I will be testing the TLC5940s which will be providing the PWM control for the LED drivers.

Wednesday, February 29, 2012

Netduino - Project Update

My prototype control board is now completely soldered up now.

I still need to do some testing, but I have powered it all up and it didn't set on fire, so I'm hoping all is well.

The main improvement is that the TLC59040s are fully soldered up.

I'm going to test all the various functions over the next month and will also be purchasing the various components I need for my LED drivers, relay enclosure and relay control board.

Here are a few pictures of the control board so far...



Wednesday, February 22, 2012

Relay Enclosure

I have been working on a relay enclosure for a little while, the main aims of this part of the project is to safely and to an electrical safe standard, design and build a high power relay enclosure.

The enclosure has been designed using 25amp SSR relays and 10amp rated IEC sockets. I have used 2.5 guage solid core cable and all of the IEC are fused, with the input one also having a switch.

For the low power control of the relays, I am currently designing a dip switch configurable option to choose whether transistors are normally open or normally closed for each channel. This will allow me to have a fail save for the various equipment that needs powering, even if the control board fails. For example heating and pumps will always need power, where as air pumps and lights may be less critical to life support.

Thermal management has been a key focus in the design of the relay enclosure, to take care of this aspect I have used a vented steel case, 2 large heat sinks and 2 pc fans. The temperature of each heat sink will be monitored using DS18B20 or similar temperature sensors on the 1-wire bus. The readings from these sensors will allow me to control fan speed and if necessary turn of relays if they are over heating.

The enclosure has 6 panel mounted LEDs at the front, this will indicate which relays are on, whilst fan speed will be displayed on the main controller LCD along with the temperatures. The 3.3v logic from the shift registers will be used to control transistors which will control the 12v supply that will be used to swith the relays. Whilst the 3.3v is enough to directly control the relays, I want to provide some isolation from the netduino and also take some of the power power burden of the netduino's regulators.

Below is a picture which shows my mains wiring, as you can see I am using the WAGO terminals to distribute the mains supply. I have cut all the IEC holes and have already set my switched, fused input socket, but am yet to order the 6x fused output sockets. All of the mains power is being kept at the top of the enclosure in the middle, this will be seperated with some blank pcb from the low power control board which will go at the bottom between the relays and will held keep the main away from the case should a connection become loose (which I can assure you it won't). Also the case itself will be earthed for added protection.


I will will post an update shortly once I have finished designing the control circuit.

Tuesday, December 27, 2011

Netduino - Long awaited update

Its been a long time since I posted anything, but my project has come a long way during this time...

Since my last post which was me drawing my schematic for a PCB to be printed, I have followed the advice of a few people over at the netduino forums (mainly mario and mark) and have nearly finished making a protoboard. I am getting on quite well, the schematic has changed a little here and there and I'm sure during testing and programming of my protoboard there will be even more changes and additions to come.

So far I have done the vast majority of soldering on my protoboard, I started with the layout, which I must say doesn't entirely represent my PCB layout, but I guess this is to test the circuit works as expected. I've got the RTC, the 595s and 165s completely soldered up and as you can see in the picture below, I have tested the shift registers and they are working perfectly!


I am really pleased with this, nothing has set on fire, gone bang or more disappointingly... done nothing! So this is a good start.

Next I am going to test that the RTC works and then I will be able to test the netduino pluged straight in to my protoboard without wire connecting specific things up. Once that is working I will finish off the LCD connection soldering and 4052 serial mux so I can select the LCD as a device. This will be the first time I have used the 4052 so it will be an interesting test, fingers crossed all will be well.

The osscilator for the tlc5940s is barely on the board yet, I have litterally just placed the chip holders, soldered some headers for the pwm outs and attached the power and grounds. I could really do with testing this on some breadboard first as I am still a little unsure as to how the osscilator needs connecting up.

Hopefully in my next post I should have a working clock, LCD and a soldered up osscilator!

P.S. Here is a top and bottom view of the board



Sunday, October 2, 2011

Netduino - Aquarium Schematic

Here is my first attempt at drawning a project schematic, I may still need to add an extra 74hc595 and there needs to be 2 daisy chained tlc5490's for pwm control.


Tuesday, September 27, 2011

Netduino - SD Write, Right?

I've decided to upgrade to the latest firmware 4.2.0; although this does not have 1-wire support it does fix a lot of other issues and when Chris over at secret labs gets round to releasing the 1-wire version I will inlude temperature readings back in my project.

In the meantime....

I have successfully managed to write a file to an sd card and then read it back.

Currently this was achieved using 2 seperate examples:

To write it I used this:


public static void Main()
{
StorageDevice.MountSD("SD", SPI.SPI_module.SPI1, Pins.GPIO_PIN_D8);

using (var filestream = new FileStream(@"SD\dontpanic.txt", FileMode.Create))
{
StreamWriter streamWriter = new StreamWriter(filestream);
streamWriter.WriteLine("This is a test of the SD card support on the netduino...This is only a test...");
streamWriter.Close();
}

using (var filestream = new FileStream(@"SD\dontpanic.txt", FileMode.Open))
{
StreamReader reader = new StreamReader(filestream);
Debug.Print(reader.ReadToEnd());
reader.Close();
}
StorageDevice.Unmount("SD");
}


To read it I used this:


public static void Main()
{
StorageDevice.MountSD("SD1", SPI_Devices.SPI1, Pins.GPIO_PIN_D8);

string[] directories = System.IO.Directory.GetDirectories(@"\");
Debug.Print("directory count: " + directories.Length.ToString());

for (int i = 0; i < directories.Length; i++)
{
Debug.Print("directory: " + directories[i]);
}

string[] files = System.IO.Directory.GetFiles(@"\SD1");
Debug.Print("file count: " + files.Length.ToString());

for (int i = 0; i < files.Length; i++)
{
Debug.Print("filename: " + files[i]);
FileStream fs = new FileStream(files[i], FileMode.Open, FileAccess.Read, FileShare.None, 512);
StreamReader sr = new StreamReader(fs);
Debug.Print("contents: " + sr.ReadToEnd());
}
Thread.Sleep(20000);
}


The next plan is to test I can write, read, delete, edit and also control shift registers on the same bus.

Sunday, September 11, 2011

Netduino - First Rough Fritzing

Here is a rough fritzing of my project more or less so far, but with a few changes and additions that such as the serial mux/demux and the wifi module I will be adding.



Netduino - Issues and current activity

It has been some time since I made a proper post on my blog, a lot going on; with looking for a house, work and all that...

Any way more importantly what is going on with my project currently?

Well sadly at the moment not much in the way of development, I have been having a deployment issue for the last couple of weeks, ever since my rtc broke (that’s a thought could they be related and my netduino is actually damaged???). My rtc breakout broke, the crystal seemed to have stopped working and so the time would no longer increment. As far as the overall project was concerned, I was doing really well, I had temperature readings and time and date going on to the LCD with a nice fast refresh rate. I had added in temperature updates against the system clock, expanded my SPI output with 2 shift registers and was able to control LEDs and finally..... RELAYS!

I received my new rtc, soldered it all up and replaced it in my circuit, I uncommented all the lines relating to the clock, went to deploy and ran in to the error that has been plaguing me since:

"An error has occurred: Please check your hardware"

Since this error started I have tried everything I can think of; reinstall the entirety of visual studio, .net framework, netduino sdk, tinybooter, 4.1.1 firmware. I have also swapped computers, rolled back to older versions of my code checked all my connections, tried getting individual components and their corresponding code to work on their own and so far all I have managed to deploy is blinky LED and button press.

While I wait for some clues as to what the root and solutions of my problem may be, I have been busy researching and procuring additional components for other parts of my project. In the last weeks or two I have bought some 74HC165N's these allow for a multiplexed SPI input and I will be using these in accordance with Stephan’s fantastic class: https://stefan.co/netduino/multiplexing-with-bitshift-ics/. I have also bought some 74HC4052 serial multiplexers, this will be used as per atlas Scientifics example: http://atlas-scientific.com/_documents/Application_Note_stamps_001.pdf. This will be needed in order to use 1-wire for the DS18B20 temperature sensors, the serial LCD display, the PH stamp and the latest purchase....

A SPARKFUN GAINSPAN WIFI BREAKOUT ! ! ! ! !

Finally Wi-Fi will be coming to my project which is the ultimate point of this exercise, basically I started this project not only because of my interest in electronics tinkering, but also to help me learn both C# and websites (specifically ASP.Net which is what I will be using). My programing, although entirely self-taught (With a lot of fantastic help from many nice people in various forums, THANKS EVERYONE!), it has come a long way. At work I have written my first application with back end administration UI in VB. This is my first windows form application and although still in VB I am really proud of it, I have learnt and applied many standard programing techniques, such as arrays, functions, passing variable and making classes, which is great as my code is becoming more efficient. The application is basically an interim before we have an IDM to generate accounts and synchronise the Email, HR and Novell systems. It uses a database back end to analyse each system and a rules set to generate network and email accounts, allowing HR to generate accounts when they are entering new starters on the HR system and it automatically emails the account details to the employees manager. They can then key the account information in and IT then have an interface to view these and create the accounts in Novell and on the mail server. The application also does a lot of other analysis, it automatically checks for changes in HR records on a daily basis and creates reports, it checks and automatically removes records from the pending table once they exist in all systems. The final bit I am working on is getting it to produce a consistency report to say for each system what needs changing to make sure the data is mirrored consistently for each record between the systems and to get the one-click auto update function working.

Back to the aquarium project.....

I have also bought a couple of TLC5940 PWM expander IC's, these will be used to control fan cooling for the relay enclosure, fan cooling in the tanks and LED lighting for the tanks. I have spent quite a bit of time researching the Relay enclosure, I am yet to run mains through them, but as I understand they can get quite hot as there is some resistance created where the connection is made. I was originally looking a 1 big 300-350mm heat sink to sit the relays on; however this seems to be either very expensive or just hard to procure. My latest idea is to get 6 heat sinks designed for the 25amp SSR's that I am using, these are however quite big and so my idea of having a rather small enclosure for them is becoming somewhat of a pipe dream. I am now thinking of an abs electrical enclosure that I will expose the heat sinks towards the rear and will have a fan cooled baffle to provide additional temperature controlled cooling where needed. The electronics side will all be sealed to make sure they are completely water tight as this will be used near a fish tank. I am yet to decide whether to house the entire project in the one box or whether to have a separate box for the controller, but my idea is to use usb ports to connect the various components together. I will have a serial bus, an SPI bus, an I2C bus and a 1-Wire bus. My idea is to provide 5 or 10 usb ports to add additional devices to each bus and this will also allow for port expansion, possibly using modified usb hubs. So for example on the 1-wire bus I could have 10 temperature probes each with a usb connection at the end, and I simply plug them in to the 1-wire bus.

That’s all for now, fingers crossed I will get things working again shortly and stay posted as there are likely to be some big developments coming up in the next month.

Sunday, August 28, 2011

Netduino - LCD Fixed! Refreshing...

Ok I am getting back on track with my project, the lcd display is better than ever, I have extra functionality, can clear blocks as well as clear the whole screen and most significantly....

MY SCREEN REFRESH RATE IS FIXED!!!

This is what I did, if you get the sparkfun lcd YOU WILL NEED TO DO THIS.

Here is the lcd: http://www.sparkfun.com/products/9351
Here is the new firmware: http://sourceforge.net/projects/serialglcd/files/

You will need:

AVR ISP Mk2 (or similar product): http://store.atmel.com/PartDetail.aspx?q=p:10500054
AVR Studio 5: http://www.atmel.com/microsite/avr_studio_5/default.asp?source=redirect

Simply connect up the isp to the 6 holes on the back of the serial display and power the board like this:




Then all you need to do is go in to avr sudio and go on to the programmer option, select the avrisp mk2 and the atmega168 and connect. You should have 2 green leds on the programmer, to test the connection click read on all the various values. It is also worth doing this to have a backup of the original firmware.

Next unzip the firmware, then in avr studio browse for the main.hex file in the flash memory.

Erase the device
Then program the new main.hex on

Thats it!