Jump to content
Premium Aquatics Aquarium Supplies

Meepduino: 2.0 RELEASED!


MeepNand

Recommended Posts

For fan control right now, I'm using a PWM port. I only have 3 colors on my led cannon, so that leaves 3 channels with which to put on fans.

Transistor hooked up to PWM and power line of fan makes a quiet night. I'll make that better later though.

Link to comment
MOJOEJOEJOE

I have some real nice code for PWM fan and temp sensor controlled. If you want it let me know. It works off of a hysterisas so the fan speed increment and decrement is hardly noticeable as compared to just turning on and off.

 

  • Like 1
Link to comment

Hysterias?

I was thinking about running a heat sensor that turns it on at above 120*F and off at below 100*F.

Link to comment
MOJOEJOEJOE

try this...

 

 

 

int fan = 10; // fan connected to digital pin 10

int fanintensity = 0x80;

 

int pin = A0; // analog pin A0 temp sensor

int tempc =0,tempf=0; // temperature variables

int samples[8]; // SAMPLES

int i;

 

// temperature variables

int iTmpDelta;

int iTmpLoopCount = 0;

int iLastTmp = 0;

int iTmpFd;

 

// Use these to set your temperature operating range

int iTmpSetPt = 70; // Set point

int iTmpLowLimit = 68; // Low limit

 

// This is the minimum speed (DAC) to be applied to the fan

int LedBoxFanLowLimit = 0x80;

 

 

void setup()

{

Serial.begin(9600); // start serial communication

}

 

void loop()

{

//************************************************************ TEMP SETUP.

for(i =0;i<=7;i++) { // gets 8 samples of temperature

 

samples = ( 5.0 * analogRead(pin) * 100.0) / 1024.0;

tempc = tempc + samples;

delay(250);

}

 

tempc = tempc/8.0; // better precision

tempf = (tempc * 9)/ 5 + 32; // converts to fahrenheit

 

delay(250); // delay before loop

 

//************************************************************* TEMP CONT.

if (++iTmpLoopCount >= 5) // Only do this once every 10 seconds (5 x 8 x 250ms)

{

// Print the current temperature

Serial.print(" Celsius: ");

Serial.print(tempc,DEC);

 

Serial.print(" Fahrenheit: ");

Serial.print(tempf,DEC);

 

// Reset the delta adder

iTmpDelta = 0;

 

// The first derivative delta/time gives us a direction

iTmpFd = tempf - iLastTmp;

 

// Below low limit - self levels at 0x80

if (tempf < iTmpLowLimit)

{

// Fan is fast and temperature is low so slow it down

if(fanintensity > LedBoxFanLowLimit)

iTmpDelta = -8;

}

 

// In range or above

else if((tempf >= iTmpLowLimit) && (tempf < iTmpSetPt))

{

if (iTmpFd < 0) // decrease cooling

iTmpDelta = -8;

 

if (iTmpFd > 0) // increase cooling

iTmpDelta = 8;

}

 

// Above upper limit and cooling is on so increase it

else if (fanintensity < 0xff)

iTmpDelta = 8;

 

if (iTmpDelta != 0)

{

fanintensity += iTmpDelta;

fanintensity = _max(ElBoxFanLowLimit, fanintensity); // Set to max of 0x80 or new speed

fanintensity = _min(0xff, fanintensity); // Set to min of 0xFF or new speed

}

 

iLastTmp = tempf;

iTmpLoopCount = 0;

 

analogWrite (fan, fanintensity);

}

} End Loop

  • Like 2
Link to comment

That seems like a lot of code. Why not just use a boolean to control on and off and check (if statement) that boolean each loop to see if the pin should be high or low?

Then you set the boolean by checking temperature and seeing if it is at the upper limit/ lower limit and setting it appropriately?

I'll write up some code in a mo'.

Link to comment

Remember this, the shortest distance between two points is a straight line but that does not mean its the best path.

How so?

(In relation to the fan thing)

Link to comment
MOJOEJOEJOE

What I'm saying is that in engineering the goal is form,fit, and function right. The point is don't try to focus on making it easy focus on making it robust. Sometimes that means that you can't go in a straight line. Sometimes you need a little curve to get to the final destination.

  • Like 1
Link to comment

But if I use something that I don't understand, like a piece of code, I won't be able to change or edit it in the future.

Not to mention I want to use original code as much as possible.

Link to comment

Great read, got a question about the display screen. I was wondering if I might be able to use a larger screen like this one

http://imall.iteadstudio.com/display/tft-lcm/im120419008.html

Thank you for documenting this build. And the diagrams are going to be very useful. see,s like an easy enough build most should be able to tackle it. Also the diagrams show the controller is powered by a 12v wall wart. Why not run it off the power brick? Could one run it off the power brick? How large of a power brick would you need to run 5 1000h LDD and a 300h LDD. Thanks for the input.

  • Like 1
Link to comment

Can't use a larger screen, sorry. Only compatible with 320 x 240 pixel screens.

 

You run this off of a 5v wallwart, not a 12v one, although if you wired it differently you could as the arduino has a built-in voltage regulator. I would not recommend it though; it could burn out.

 

For LDD drivers you can use any size power supply. 36v or 48v is best though as you can run many leds off each driver.



Working on temperature control people! For the tank or for the heatsink. I might add in a second temperature sensor later, but only after I'm sure I can fit the hardware on the pins remaining.

Link to comment

My MEGA 2560 combo set came in today! I'm very excited to setup but I'm still waiting on my LED power supply and heatsink. I have a few questions about setting up still. The shield piggy backs onto the mega and uses all the channels where the 3 power cords go into. Do I just solder the cords on the shield in the same channels? And is there a cable I can use to extend the screen out so I can have a small cover/box for the screen and the shield + mega would be housed somewhere else? Also, how do I load all the coding into this bad boy? I'll try to draw up a new diagram once I get this info.

  • Like 1
Link to comment

Remote wiring is very tricky. The declaration of the touch screen and display in the code is not how you wire it remotely; it doesn't work.

Look around on how to wire the Jarduino. That would have remote wiring for the shield and board.

 

In order to access the power pins, you will need to solder a little bit. The best way IMO is to solder one wire to the ground, and then wire all grounds together on that. And wire the one power wire to the +5v on the Arduino/5v power supply and connect that to what you need to power.

Yes, it is a little soldering, but it's only 4 or 5 connections.

Link to comment

Bah! Upload isn't working. The .txt on page 1 for Rev 1.4 works but google code isn't working.

 

EDIT: Only uploading the pic doesn't work. I uploaded the .ino file just fine.

Link to comment

Okay, all uploaded people! At least on the first post. I'm going to contact CM later to see if I can squeeze more upload space.

 

EDIT: also on google code in a lower-quality .jpg file instead of the higher-quality .png it is on post 1. Not a big difference, but the extra quality is nice.

Link to comment
Skinnysloth

My MEGA 2560 combo set came in today! I'm very excited to setup but I'm still waiting on my LED power supply and heatsink. I have a few questions about setting up still. The shield piggy backs onto the mega and uses all the channels where the 3 power cords go into. Do I just solder the cords on the shield in the same channels? And is there a cable I can use to extend the screen out so I can have a small cover/box for the screen and the shield + mega would be housed somewhere else? Also, how do I load all the coding into this bad boy? I'll try to draw up a new diagram once I get this info.

This is how I intend to extend the lcd from the shield (It's 12 inches long, not sure if it'll work without errors if longer than that):

 

5o9piv.jpg

 

I'm using a 40pin male to female IDE cable. You might have one lying about.

4j9b82.jpg

 

http://www.ebay.com/itm/New-ATA33-40-Pin-40-Pin-3-5-male-female-Desktop-IDE-Hard-Drive-Cable-/320967498889?_trksid=p3284.m263&_trkparms=algo%3DSIC%26its%3DI%26itu%3DUCI%252BIA%252BUA%252BFICS%252BUFI%26otn%3D21%26pmod%3D260799118781%26ps%3D54

  • Like 2
Link to comment

Didn't think of using that. Nice idea Sloth.

 

Hmm. Temp control isn't working right.

 

 

 

if((tempset + tempprecision) >= currenttemp)
  {
    if(chillheat == true)
    {
      digitalWrite(heaterpin, LOW);
    }
    else
    {
      digitalWrite(heaterpin, HIGH);
    }
  } 
  if((tempset - tempprecision) <= currenttemp)
  {
    if(chillheat == true)
    {
      digitalWrite(heaterpin, HIGH);
    }
    else
    {
      digitalWrite(heaterpin, LOW);
    }
  }

Chillheat is whether it is in cooling or heating mode. Cooling mode is chillheat == false, heating is chillheat == true.

Tempset is the setting. Tempprecision is how precise the temperature should be, like +-0.1. Currenttemp is the temperature.

Link to comment

Okay, I fixed it. I'm not quite sure what the initial problem was, but I set the cooling and heating a little differently.

Link to comment
MOJOEJOEJOE

Sometimes temp sensors fail in different ways. Do you have any safeguards if the temp sensor fails and reads some low temp say -100 ° . If that happened it would never try to cool. I would un plug the temp sensor and simulate a failure and see what the sensor reads.

  • Like 1
Link to comment

The sensor reads 32F if you unplug it. And on powerup you get some weird readings.

I'll add a good failsafe to disable the device if the temps read exactly 32F/0C.

 

EDIT: I'll add that, but the thing is, if you use this with something like a heater or chiller, those will have a temperature control built in. If you are heating, set the heater to a higher value than what the Arduino is set to, and vice versa for the chiller. So look for it V1.5.

Link to comment

I am sorry to announce that there will be only one temperature sensor. :(

At least not for a long time. The way you connect multiple sensors is you look up their addresses, which each individual sensor has different, and then edit the code with those addresses. That is not what I want to do. So until I can figure how to work out the code, there will be only one.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recommended Discussions

×
×
  • Create New...