Questions regarding a one month project.

Hi everyone,

I'm doing a biology project and I want to use arduino to get information about temperature and humidity (hardware is placed below), show them in a screen and saving them into an SD card. To do that I've bought myshelf an arduino mega (clon, I'm a student and don't have enough money to buy originals), a TFT and some sensors:

-Arduino Mega Clon. http://www.dx.com/p/improved-2014-mega2560-r3-development-board-module-w-usb-cable-for-arduino-blue-368279#.VV9WTkaVPSM -Temperature sensor (inside water). http://www.electrohobby.es/tienda/es/sensores/142-sensor-temperatura-ds18b20-wp.html?search_query=temperatura&results=9 -Temperature and humidity sensor (outside water). http://www.electrohobby.es/tienda/es/sensores/103-sensor-temperatura-y-humedad-dht11.html?search_query=temperatura&results=10 -A TFT with SD included. http://www.dx.com/p/3-2-inch-tft-ips-480-x-320-262k-color-full-angle-lcd-module-for-arduino-mega2560-blue-black-369199#.VV9WqkaVPSM

And I'd have some questions:

First: Will my arduino burn if it stays one month working with all that without energy saving improvements?

Second: If not, I'm saving energy by measuring the temperature just every minute, turning off the sensors and using a sleeping function instead of delay. Will it last this way?

Third: If not, can I turn off the TFT to reduce heat? If so, how?

Fourth: If it's going to burn, how can I stop it from doing so?

As I said in the title, I need it to work for over a month measuring temperature and humidity. I probably need to use the TFT because I need to check the temperature levels and everything from time to time.

Cheers, edsa ;).

An Arduino can be run 24 hours a day 7 days a week, at least within reasonable temperatures (the parts are spec'ed -20 to 85C (Easily covering biology temps), though the clones might have something spec'ed lower, probably not so much lower that it matters). You will want to make sure the humidity is not so high that condensation is a risk (or take appropriate countermeasures).

The talk about energy saving is motivated by people running off batteries, and perfectionists. The power consumption of an Arduino itself is low in an absolute sense, and the power consumption of the chip is less than half of the board's total power consumption.

You should, however, turn off the LCD backlight. See the library and/or docs for the LCD you're using. They all have a way to turn off the backlight, but it varies depending on the LCD.

I would like to note something, just because it happened to me on occasion.

When writing data to the SD card every minute, for a month, the data on that SD card will be huge! 60*24*30=43.200 lines. I had some trouble reading those files with standard programms like excell or open office. Solved it with mathlab...

But, also from my own experience, a good option would be to add a button to the screen. Press the button and the screen comes on for a few seconds. I have a similar setup but with a few temperature sensors and a movement sensor. But because I use a connected power supply i'm not worried about energy. Whats your power supply like? Is it a battery or a connected one?

DrAzzy:
An Arduino can be run 24 hours a day 7 days a week, at least within reasonable temperatures (the parts are spec’ed -20 to 85C (Easily covering biology temps), though the clones might have something spec’ed lower, probably not so much lower that it matters). You will want to make sure the humidity is not so high that condensation is a risk (or take appropriate countermeasures).

The talk about energy saving is motivated by people running off batteries, and perfectionists. The power consumption of an Arduino itself is low in an absolute sense, and the power consumption of the chip is less than half of the board’s total power consumption.

You should, however, turn off the LCD backlight. See the library and/or docs for the LCD you’re using. They all have a way to turn off the backlight, but it varies depending on the LCD.

Thanks, then there shouldn’t be any problems. Will the TFT last as much? I think it’s the next thing that warms.

And actually… I do not know how to turn off backlight, and couldn’t find anything in the guide. I’ll look harder anyway…

C-F-K:
I would like to note something, just because it happened to me on occasion.

When writing data to the SD card every minute, for a month, the data on that SD card will be huge! 602430=43.200 lines. I had some trouble reading those files with standard programms like excell or open office. Solved it with mathlab…

But, also from my own experience, a good option would be to add a button to the screen. Press the button and the screen comes on for a few seconds. I have a similar setup but with a few temperature sensors and a movement sensor. But because I use a connected power supply i’m not worried about energy.
Whats your power supply like? Is it a battery or a connected one?

Don’t worry xD. I read every minute to write in the screen (I need updated information), but I actually save things once an hour, so that’s 24*30 = 720. Also, I use a connected power source, I don’t mind that much wasting, but rather killing my arduino XD.

I think that I can turn off the SD, that must be a good option too.

So basicly,

my only concern would be to turn off the screen? Right!

Even if there isn’t predefined function can I simply put all the pins as outputs and after that using the .InitLcd() function? The problem is that some pins are attached to 5V and GND pins so there’s not much I can do…

Here’s the documentation of the TFT, just in case you can help me with setting the pins to control the backlight:

http://Pan.Baidu.com/s/1hqILMOO

Thank you guys,
edsa ;).

You're using what, the UTFT library from there?

How about the lcdOff() and lcdOn() functions?

DrAzzy: You're using what, the UTFT library from there?

How about the lcdOff() and lcdOn() functions?

I pretty much believe they do not work for my TFT. Firstly because I've used them and found no result... Secondly because if I open the library with Notepad++ I find that it doesn't refer to my model in those functions, which makes me believe that you can't control the backlight.

I imagine I could solder the 5V pins to a special pin instead of those and set it to LOW or HIGH and perhaps reseting up the LCD when you turn it on if necesary.

Anyway that would need a lot of time, a solder and some knowledge; and I don't have any of those.

Sooooo, is it that bad if I have it working all the time?

Cheers,

edsa ;).

what about a real time clock to add to the data bits ?

also, if your environment is relatively stable, you can try out a way of logging only changes.
if the temperature sensor does not report a change for 5 minutes, then you would save the same value over and over.
this would require a time stamp and our final outputs would need to fill in the blanks with values. more work at the end, but potentially more data on the card.

The DHT11 is not a super sensor, It does not support negative temperatures and decimal fractions The DHT22 is better in that sense.

For even better measurements consider the DS18B20 and/ or sensirion sensors - http://playground.arduino.cc/Code/Sensirion

but I do not know your requirements.

Burning up Arduino......

For an UNO if you can keep current from I/O pins to 20 mA or less, they are safe. I think that this is true of all AVR I/O pins.

For an UNO, keep the total current running through the board to 200 mA or less. Whether that is true for a Mega, your clone board may not take what the real one will.

What is best to do if you need more power is to run the excess power-using external pieces on external to the board power making sure that all grounds are connected unless you fully isolate the external piece(s). You control the externally powered pieces usually through transistors or chips that the Arduino pins run. Just a couple mA can switch a 240VAC motor on/off.

The mega is quite a lot of board. Chances are that you don't need all that to run your project. In future have a look at making your own breadboard Duino starring a $3 or less ATmega328P-PU DIP chip (the one in the UNO) and a few parts (fewer if you run at 8 MHz). Replace the breadboard with a socket (or board) that you solder to. When the project is done you can leave the cheap chip in it whereas with the Mega I think that removing the board is pretty likely.

PS & BTW, You can probably cut power to the TFT (not just the back light) to turn it off. If it keeps running for long, check your wiring!

robtillaart: The DHT11 is not a super sensor, It does not support negative temperatures and decimal fractions The DHT22 is better in that sense.

For even better measurements consider the DS18B20 and/ or sensirion sensors - http://playground.arduino.cc/Code/Sensirion

but I do not know your requirements.

I know, but since I was more interested in the water temperature I didn't mind that much.

GoForSmoke: Burning up Arduino......

For an UNO if you can keep current from I/O pins to 20 mA or less, they are safe. I think that this is true of all AVR I/O pins.

For an UNO, keep the total current running through the board to 200 mA or less. Whether that is true for a Mega, your clone board may not take what the real one will.

What is best to do if you need more power is to run the excess power-using external pieces on external to the board power making sure that all grounds are connected unless you fully isolate the external piece(s). You control the externally powered pieces usually through transistors or chips that the Arduino pins run. Just a couple mA can switch a 240VAC motor on/off.

The mega is quite a lot of board. Chances are that you don't need all that to run your project. In future have a look at making your own breadboard Duino starring a $3 or less ATmega328P-PU DIP chip (the one in the UNO) and a few parts (fewer if you run at 8 MHz). Replace the breadboard with a socket (or board) that you solder to. When the project is done you can leave the cheap chip in it whereas with the Mega I think that removing the board is pretty likely.

PS & BTW, You can probably cut power to the TFT (not just the back light) to turn it off. If it keeps running for long, check your wiring!

That's true, but with mega I'll be able to do future projects. I mean, it's more versatile.

How can I cut power? I mean, it takes power from 5V pins, you mean conecting usual pins and setting them to low?

dave-in-nj: what about a real time clock to add to the data bits ?

also, if your environment is relatively stable, you can try out a way of logging only changes. if the temperature sensor does not report a change for 5 minutes, then you would save the same value over and over. this would require a time stamp and our final outputs would need to fill in the blanks with values. more work at the end, but potentially more data on the card.

I'm pretty much sure the temperature will change every hour and I do not really care if it doesn't actually. I don't have data problems.

Thanks all!

If you run the TFT power through a transistor, you can switch the power with a pin and resistor. Yes, another pin.

You can program stand-alone AVR chips with your Mega2560. Difference can be that when the project is done, it can be left in working condition to show later.

Bookmark this page to come back later.

Note that he covers both the 328P and the 1284P that you can get in breadboard-friendly DIPs. Also note that you can probably do that in an afternoon or less once you have the parts.

The 1284P has 2 hardware serial ports (Mega has 4), 128K flash (Mega has 256K) and 16K RAM (Mega has 8K) in a 40 pin package. It's overall less than the Mega2560 (except for RAM) but the DIP-not-SMT chip is easier for me to work with and I get them from Futurlec for $7 each (blank 328P there costs about $2.20).

Those are only two of many AVR's you can program. You should see how many projects run on 8 pin Tiny85's and 14 pin Tiny84's.

GoForSmoke: If you run the TFT power through a transistor, you can switch the power with a pin and resistor. Yes, another pin.

You can program stand-alone AVR chips with your Mega2560. Difference can be that when the project is done, it can be left in working condition to show later.

Bookmark this page to come back later.

Note that he covers both the 328P and the 1284P that you can get in breadboard-friendly DIPs. Also note that you can probably do that in an afternoon or less once you have the parts.

The 1284P has 2 hardware serial ports (Mega has 4), 128K flash (Mega has 256K) and 16K RAM (Mega has 8K) in a 40 pin package. It's overall less than the Mega2560 (except for RAM) but the DIP-not-SMT chip is easier for me to work with and I get them from Futurlec for $7 each (blank 328P there costs about $2.20).

Those are only two of many AVR's you can program. You should see how many projects run on 8 pin Tiny85's and 14 pin Tiny84's.

Ok, I'll take notes. But my problem is that I'm not into those things, I don't know a lot about it.

Where can I find a beginners guide for building mini "things" with low energy cost and enough uses from scrap?

And, what things would I need? I don't have almost anything, and don't really know where to buy cheap things. What I have is an arduino mega, a TFT, a beginners package with resistors, capacitors, etc; some wires, some motors and some shields...

Looks like for what you say I would need lots of things, like a solder, much more electronic basic things, boards and knowledge, this last being the most difficult to adquire XD.

Thanks for the support, I like this kind of things, but I'm starting right now.

Cheers, edsa ;).

Yes, that stuff for later... unless maybe you get this project done in two weeks and not too busy. :)

Solder, if you want to make more permanent things is something to learn. Otherwise, breadboard costs more and easier to pull wires loose.

As for where to buy, what country are you in? Can you buy from China where prices are lowest? Do you have to pay high import fees?

Why I like sockets (cheap) is because I can solder to the pins without the chip in place and not worry about overheating a chip pin. I can connect the wires and then place the chip. If there are not too many wires, I don't need a board.

All it takes to make a 328P chip run at 8 MHz is power, ground, and a bypass capacitor. And the power can be less than 5V, run it on 2 AA batteries is possible. But it won't be interesting until you hook at least a led to it!

In the time you gather parts there are many code lessons you can learn with just your Mega board and many things about the hardware as well you can learn just by browsing the forum or going through the Arduino site --- don't miss The Playground!

GoForSmoke: Yes, that stuff for later... unless maybe you get this project done in two weeks and not too busy. :)

Solder, if you want to make more permanent things is something to learn. Otherwise, breadboard costs more and easier to pull wires loose.

As for where to buy, what country are you in? Can you buy from China where prices are lowest? Do you have to pay high import fees?

Why I like sockets (cheap) is because I can solder to the pins without the chip in place and not worry about overheating a chip pin. I can connect the wires and then place the chip.

All it takes to make a 328P chip run at 8 MHz is power, ground, and a bypass capacitor. And the power can be less than 5V, run it on 2 AA batteries is possible. But it won't be interesting until you hook at least a led to it!

In the time you gather parts there are many code lessons you can learn with just your Mega board and many things about the hardware as well you can learn just by browsing the forum or going through the Arduino site --- don't miss The Playground!

Nice, thanks!

Everything I've bought I've bought it from China, from a webpage called dx.com.

Now, should I continue buying? Correct me if I'm wrong, but I think I should work with what I have right now as much as possible and save money. After that I should buy more complicated things, like microcontrollers alone, boards or whatever and continue. What do you think?

I programme without problems, I've been programming for years in contests and everything, but I'm starting in the world of Ohms and those things XD. So my problem is usually the hardware, not the software, and knowing how to make things work. Most chinese products come without information and you need time to look for the info. Once I know how the thing works I do not usually have any problems programming it but I do lack the fundamental knowledge of electronics and microcontrollers and soldering and what do I need to build something and basicly everything ;).

However, there's some things I'd like to buy and I think would carry me little by little to the advanced path, and those are Arduino Mini Pros, they cost like 4$/3.5$ where I buy them. (http://www.dx.com/es/p/produino-atmega328p-improved-pro-microcontroller-circuit-board-works-with-official-arduino-boards-300824#.VWCUOkaVPSM).

Could you tell me what to buy to start in the world?

I mean, I do absolutely need a solder, I know that, but what else? Can I start working just with some microcontrollers and some boards to put them on? (ok, put some capacitors and resistors there).

Thanks!

Cheers, edsa ;).

edsa: Nice, thanks!

Everything I've bought I've bought it from China, from a webpage called dx.com.

One of my favorites, but not for everything! Also look for Yourduino (shipping cost but fantastic prices on most parts and assortments. Great support! Also a favorite for selection is Futurlec, I just got a bag from them yesterday -- $30 total. Also a favorite is DIP Micro for deals there and quick shipping to me.

Now, should I continue buying? Correct me if I'm wrong, but I think I should work with what I have right now as much as possible and save money. After that I should buy more complicated things, like microcontrollers alone, boards or whatever and continue. What do you think?

You have enough to learn more than you know. You might at times want to get more values of resistors and capacitors and like -- just keep shopping for smaller assortment packs, 10 or 20 each of many different value parts. When you get resistors they will be rated in Watts as well as resistance, a 1/4 W resistor can only handle so much drop before it Smokes. I doubt that a pin can burn one but take care using it in a power circuit. In a 200 resistor assortment, they cost a penny or two each.

I started out with about 20 bags of extra parts and every project it was get the bags out. Then at Harbor Freight I saw parts cases with big enough compartments to fit resistors, etc, for about $4 each. I got 4 and almost filled 3. Bigger parts/modules, I keep in plastic storage boxes, some were packaging for things I bought and others were on sale somewhere.

I programme without problems, I've been programming for years in contests and everything, but I'm starting in the world of Ohms and those things XD. So my problem is usually the hardware, not the software, and knowing how to make things work. Most chinese products come without information and you need time to look for the info. Once I know how the thing works I do not usually have any problems programming it but I do lack the fundamental knowledge of electronics and microcontrollers and soldering and what do I need to build something and basicly everything ;).

Some things about coding microcontrollers is very different to PC's as you know them. Like the small environment and lack of OS. It's just nostalgia for me, I worked on smaller and vastly slower machines in my starting years.

However, there's some things I'd like to buy and I think would carry me little by little to the advanced path, and those are Arduino Mini Pros, they cost like 4$/3.5$ where I buy them. (http://www.dx.com/es/p/produino-atmega328p-improved-pro-microcontroller-circuit-board-works-with-official-arduino-boards-300824#.VWCUOkaVPSM).

Could you tell me what to buy to start in the world?

I mean, I do absolutely need a solder, I know that, but what else? Can I start working just with some microcontrollers and some boards to put them on? (ok, put some capacitors and resistors there).

Thanks!

Cheers, edsa ;)

You need a multimeter. You can test circuits with one and avoid burning pins and boards.

Really there are people here with lots of advice, much better than I can give on the subject. Try heading down to The Bar section of the forum and ask what you should get.

There is one member of the forum who has a series of hardware tutorials up on Youtube. https://www.youtube.com/channel/UCi4UZoZM0Iw9_tTeRjZd_bA

There are also many many many electronics tutorials on the web. If you don't understand the terms they use, you may want to go through some physics tutorials on electricity, Hyperphysics site may help there.

Take as long as you need. You just found out things to look for today and that will change what you see.