New Project, and looking for some guidance.

hi every one,

I am currently looking for some advice or guidance on a project I am working on, as I have it , its functioning, but its rather laggy at times. I am enjoying the problem solving end of this project which has been pushing my abilities. So I guess its time for some help to improve my project so here i am.

I am currently working on a small steam generator with a condenser at the end. ( used for making essential oils- this is for a friend as I have no clue what I would use those for). the hardware seems simple enough to construct, but I am looking to automate the firing process. the current program runs off a Mega2560, it currently has 3 modes to control the servo:

one: automatic ( takes the temperature, compares it to the set point then positions the servo accordingly. two: manual preset positions of the servo, a low, med and a high fire rate. three: uses a potentiometer to sweep the servo and maintains the position till you feel like changing it

mean while an LCD screen is giving you data on temperature, what mode the program is in, and set point of the water temperature in the "drum". while the program is running it all works. but is laggy on updating the LCD and positioning of the servo due to what I say is poor optimization or a lot of code for a single 16 MHz to handle in real time ( usually the delay is about 2-4 sec).

Now I can work my way through all the code and get it working better in its current state. but how much more work would be involved in expanding this to an i2c network? on where I could have a few small boards dividing up the work into small more manageable programs, can they talk to the main board as in send and receive data or just receive ? if so can slave devices talk to each other slave devices ? in the future i would like to automate this further, would that make it easier to implement in i2c or just running one board? I have been reading up on i2c , and its still fuzzy to me. or do you have a better idea ? i am game to hear different opinions as there is more then one way to skin a onion.

my current hardware for the project : 1 Arduino mega2560 board 1 servo ( currently 180 degree may have to change this later to suit the gas valves rotation ) 1 DS18B20 Digital Temperature Sensor 1 20x4 LCD monitor then a bunch of other switches, LEDs and a 2 Potentiometer to indicate and control the program.

Your code would help.

Please put your code in its own window as seen in other posts. This can be done by placing     [code] and [/code]  around the code. This makes it easier for others to read.

Weedpharma

expanding this to an i2c network

I2C is not a network it is a bus. The difference is that a network is something like Ethernet or a Token ring to enable any device to communicate with any other device.

On a bus you have a master / slave model where only the master initiates communication. You can have multi master I2C buses but these quickly get very messy with more than a few masters.

Read this and then post your code:- How to use this forum

Hi, yes, lets see that sketch. The Mega's processor is considerably more than fast enough to perform these tasks. Your i2c "network" idea would make things very much more complicated, and even if it didn't and was about as much effort as optimising your current sketch, it would be wasteful.

Paul

Post your sketch.

I wonder if it has the delay() function anywhere in it ? (Tip, it shouldn't).

As @PaulRB has said a Mega should easily do what you want and still have a LOT of spare capacity.

...R