Arduino + Camera + Heat source

Hello,

I am planning a project which goal is to create a kind of heated box (possibly also cooled as alternative) which content is monitored by a camera.

The idea is to study how objects confined in the box are effected by being exposed to different temperatures during a long period of time (many hours).

The box needs to be about 50cm³ (~20 inches³)

For the temperature source, I have two potential ideas. The first one:

  1. Some form "heating block" which temperature could be regulated up to 60°C (140°F)

  2. A Peltier element attached to a heatsink and a fan. By alternating the direction of the current, this should allow me to both increase and decrease the temperature in the box. (This project inspired the idea: Peltier Cooling and Heating with Arduino – Tinkerer)

Either way, the temperature need to be programmatically altered from the arduino unit.

The camera unit needs to be on the higher end of the quality spectrum. It is important that i can control white balance and exposure. It is very important that the camera can take pictures with good quality in terms of color saturation etc.

Temperature reader unit:
I would need a thermometer that continuously reads the temperature in the box and reports it back to the program, so that i can keep a constant temperature.

Light source
The box should be equipped with light, It is however not necessary for the lamps to be controlled by the systems. They just need to be turned on while the program runs. If the lamps needs to be manually switched on when the program sequence starts - that is fine.

Usage:

Basically, I want to give the system the following instructions:

"1. Set the temperature to x degrees. 2. Take a picture inside the box every minute and save the images to storage."

This is the very basic idea of the system. As I am personally more of a software-guy who have never played with Arduino before (although I do have experience with Raspberry Pi's), I'd like to know if there is a plausible way to build such a system with Arduino modules. If it is plausible, I'd like to know which hardware that should be able to do the job.

When I look at this project I think the thermal design will be the most difficult. I've never worked with peltier elements, but they sure are cool. Calculating heat flux to properly size the element would require me to do a lot of investigation and learning, or I would just get one and experiment.

The Peltier element will require a power driver. A motor H-Bridge will give you "bi-directional" control. Make sure it's rated for the voltage and current you need to deliver, but it should be easier to control than a motor. A simple PWM and direction should be all it needs.

Depending on your system and requirements a dumb On-Off system (like a thermostat) may be good enough to control temperature. If not investigate and try the PID library.

The camera will be next hardest, in my opinion.

If one of the RPi cameras is good enough it may be easier to do the whole thing with a Raspberry PI.

Some guys have hacked Canon PowerShot cameras giving more features and a remote trigger through the USB port which can be triggered by a switch (or relay or maybe a digital output).

You can also connect a servo to a camera remote trigger cable, or maybe just set it up so the arm pushes on the shutter release.

Reading temperature is easy.

The simplest method is one of the digital temperature sensors. The next easiest is a thermistor and a resistor connected to an analog input. A quick an dirty circuit and code will probably be accurate to a few degrees. You can get 1 degree or better accuracy with a little more attention to detail and a larger lookup table or more calculations.

RTD's are very accurate but need an amplifier circuit like this. Thermocouples can handle extreme temperaturesand can be very accurate, but also need a specialized amplifier.

50cm3 is more like 3in3 That’s a box 3 inches long by 1x1. A cubic inch is a lot bigger than a cubic centimeter.

Peltiers seem cool but there’s a reason why you don’t see lots of little tiny coolers all over electronics and campsites and industrial equipment and medical equipment or anything else. The reason is they first use a lot of energy to cool the cool side and second they have a limited temperature difference between the hot and cold side.

So the hot side heats up quickly with all that power being used. It quickly gets hot enough to heat up the cool side, even though that cool side is 70ºC cooler than the hot side. You have to have big heatsinks on the hot side and big fans blowing over them. Even if you do get your hot side down to only 70ºC hotter than your target cold temperature, at that temperature difference the heat flow ability of the Peliter is zero. So you need to get your hot side down even colder to have any hope of actually cooling anything.

For the small Peltiers commonly available, and a large hot side heatsink and fan, you could conceivably cool 3 cubic inches to 20-30ºC under ambient. Maybe more, depending on how much heat the thing is generating inside the box.

RTDs are the current standard for most scientific measurements. Getting a good signal from an RTD is harder than it looks. A MAX31865 chip is very useful. Adafruit sell them already mounted on breakouts.

If your temperature range is going to be between -55ºC and +125ºC then a DS18B20 sensor is much easier to talk to with an Arduino. You can easily put several of them around the box to see how hot or cold the corners are compared to the middle.

Is the camera a set-and-shoot type of thing? Then any DSLR will interface easily with an Arduino. If the Arduino is expected to change settings on the camera, like exposure, then it’s more difficult.

I suspect OP is thinking of a 50x50x50 cm box, as 50 cm3 is really tiny.

Thank you both for your great answers! And let me clarify the dimensions of this box since i so utterly failed with maths in my OP. The idea is a cube with sides of 50cm (~19,7inches) which is (50cm)³=125000cm³ or ~7600inches³. (Spot on, @wvmarle)

@MorganS: Do you think this much larger volume could be cooled with a peltier element? The range -55ºC and +125ºC will be quite sufficient. The box temperatures will ever need to go below +5ºC and never over +60ºC (surrounding room temperature is about 20ºC).

As an alternative to the Peltier element, I am considering to remove the cooling ability of the system and only go with room temperature or higher, eg. +20ºC to +60ºC. If I decide to go that way, would a heating block connected to a heatsink and a fan be a good solution? Would not be as cool as a Peltier element which would allow lower temperatures of course.

@MorganS "Is the camera a set-and-shoot type of thing? Then any DSLR will interface easily with an Arduino..."

I am not entirely sure what you mean, but the samples inside the box that are going to be photographed are stationary so the cameras focus would never change. It would however need to calibrated so that exposure and white balance are matching some criterias (within the box, there will be a grey-card to pre-adjust white balance).

Another, albeit rather crude, way of cooling would be a block of ice, or (rather less messy) those cooling elements used in coolboxes. It all depends on how accurate and stable you need your temperatures to be for your experiments. You may have to place the cooling element at the top, as warm air rises so you get more natural convection that way.

Mobile phones are also easily interfaced, via bluetooth or wire connection (just look at those selfie sticks on how it's done). Quality of the photo is of course much less than from an DSLR.

@wvmarle It is important that the temperature is stable and accurate. If I cant do cooling with a Peltier element I will probably need to skip cooling altogether and just go with heating. (If there isn't a third option that is more precise than ice-cooling). Thank you for the suggestion though!

I believe that using an DSLR camera could be an option if the different arduino compatible cameras aren't good enough. I have briefly looked at different Arducam models but I have had a hard time figuring out which one would be the most suitable candidate. I am also confused by the difference between camera modules, camera shields and how compatibility works with different Arduino boards. It seams like Arducam sells some of their cameras pre-mounted on Uno-boards?

I imagine that I need a larger Arduino board than Uno since I will connect quite a lot of hardware (camera, heat/cool-system, thermometer).

More accurate could be: heatsink + block of ice + fan, where the fan blows cold air into your chamber as needed. Similar as your heatsink + heater + fan idea. Good heat isolation of the box is definitely going to help you keeping the insides at a stable temperature.

Other than that there's of course the fridge type heat pump, I don't know if they're available for your size application.

@wvmarle I suppose my concerns with the ice-block approach is that the ice would melt within a few hours. In some cases, the system will need to be going for up to as much as 24h straight. Of course you could device a sort of ice tank which allowed you to refill ice but I'd prefer if the system "took care of itself".

I'll look closer at heat pumps but I suspect that you're intuition is correct - It could be problematic to find properly sized units.

If I initially would exclude the cooling option from the project, what kind of heat sink + heater + fan hardware should be worth looking at? The requirements would be to raise temperature from ~20°C up to 60°C.

I would need the main program to be able to adjust the temperature during an experiment. In some cases for example, I'd need to raise the temperature by for example 1°C per hour until the experiment is concluded.

kappurino:
@wvmarle I suppose my concerns with the ice-block approach is that the ice would melt within a few hours. In some cases, the system will need to be going for up to as much as 24h straight.

Well, then put the whole thing in the fridge, or even a big freezer, for lower ambient temperature. Then heat the internals to your desired temperature.

I would need the main program to be able to adjust the temperature during an experiment. In some cases for example, I'd need to raise the temperature by for example 1°C per hour until the experiment is concluded.

That's going to be easy - the moment you can regulate the temperature to a certain setting, you just slowly adjust that setting. This is routine for Arduinos, and exactly the kind of control they're meant for.

MorganS:
...

I just found the quote-button. I had some question in this post and I'd much appreciate your expertise when you have time - Peltier elements seams to be your thing :slight_smile:

15 degrees below ambient is possible with a 7A Peltier, so long as the box is well-insulated and you have good cooling on the hot side. It's not difficult to work it out if you have the R-factor for your proposed insulation material.

R gives you watts-per-square-meter-per-degree. Your target is 15 degrees. Work out the surface area of your box (to be conservative, use the dimensions of the OUTSIDE of the insulation). Then you know how many watts you need to suck out with the Peltier. Add a little more because the insulation is forced to be thinner under the outside heatsink and that's the place where the temperature difference will be higher. Add a little more if your corners aren't perfectly sealed and add more again if the lid isn't taped shut with tape.

With that information on watts to be extracted, look at the datasheet for your Peltier. That will tell you what the temperature differential is going to be across the Peltier.

So now you need to know if your hot side heatsink can dissipate the watts you worked out above PLUS the watts being pumped into the Peltier electrically. All heatinks will have a degrees-per-watt rating, also called thermal resistance. The good datasheets will even tell you what this is with different airflow flow rates from your fan.

With the temperature differential between the heatsink and ambient, add the Peltier temp difference and see if you have met your temperature goal. You will probably end up picking a larger heatsink.

Hi,
Everybody is talking about cooling and heating THE BOX, the important thing is what IS IN THE BOX.
Is the object gas , water, metal, solid, hollow etc they all have different rates of heat absorption, and your BOX will have losses.

So you will have to do some thermodynamics calculations to make sure you can obtain your highest and lowest temps with OBJECT and BOX losses.

Tom... :slight_smile:

TomGeorge:
So you will have to do some thermodynamics calculations

You're going way to far there, that's really not necessary. Your only losses (after the object has heated up/cooled down) is the heat transfer through the walls of the box, and whatever heat the object inside produces, probably nothing as it's not specified.

I've done myself some heating experiments in my university time. We normally used a water bath to heat/cool objects (often while leading a gas or liquid through) to a specific temperature. For higher temperatures it'd be an oil bath. Liquids transfer heat much more efficient than gases (like air).

Indeed, air is a very good insulator, so to get the heat through the box some form of convection is needed. Heating pad at the bottom, cooling at the top, and you get natural convection that way. Add a small fan may also be a very good idea to get the temperature evenly through the box. In case of a Peltier or other heating element, blow the air through a heat sink mounted inside the box, this helps transferring the heat efficiently.

For the box OP described, a 50-200W heating should be plenty, especially if well insulated. Controlling it will be harder and will require experimenting: how quickly does the heating element react to power on/off? How fast does it cool down? How much heat is needed to keep the temperature at a certain level? Most likely some form of software PID regulator in the controlling processor is needed, and the heating element must be adjustable - in case of Arduino that would probably mean that it's happy to take PWM power supply (look for a 12-24V heating element, those can easily be regulated through a MOSFET, even 200W should be no problem for a power MOSFET).

Hello again!

I've gotten a long way with my project - I found a Peltier element that can heat up to 75C and cool down to 5C. This is done with a motor controller that is connected to a RPI, which uses a PID-controller to keep constant temperatures. It all works like a charm!

In order to get more precise readings, I need some input however.

sdturner:
...

Reading temperature is easy.

The simplest method is one of the digital temperature sensors. The next easiest is a thermistor and a resistor connected to an analog input. A quick an dirty circuit and code will probably be accurate to a few degrees. You can get 1 degree or better accuracy with a little more attention to detail and a larger lookup table or more calculations.

RTD's are very accurate but need an amplifier circuit like this. Thermocouples can handle extreme temperaturesand can be very accurate, but also need a specialized amplifier.

I using 3 wired DS18B20 sensors to measure temperature and give feedback to the PID-controller. The problem is that the 3 sensors gives me different readings. I'm thinking that using an amplifier (as sdturner pointed out in the quote above) is the way to go.

I'm not sure if I need an RTD amplifier like this or a thermocoupler amplifier like this however.

I'm hoping that the correct amplifier will give me more consistent temperature reading from the sensors... right?

Thank you for all the help!

Those amplifiers are for a very different type of temperature sensor.

Assuming you have those sensors in different places in your box, I am not surprised you see different readings. It’s hard to get perfect homogeneous air temperature. On top of that there’s the measurement error of the sensors - ±0.5°C according to the Adafruit page.

My suggestion: log the temperatures for a while (a few days or so, as you do your experiments), and plot the data. See if there’s a consistent difference, and how large the difference really is.

Is it within the expected error, i.e. highest and lowest <1°C difference? Fantastic, just take the average of all readings and feed that to your PID controller. The air in your box appears to be well mixed, and the temperature is the same everywhere.

Outside of expected error? Take a good hard look at how you homogenise the air inside your box.

So long as you're working within the temperature range of the DS18B20's and you don't mind the size of the sensing element, they really are the very best you can get. Anything else is a step backwards.

Hi,
How different are your three readings?
Are you circulating the heated/cooled air in your sample oven?
Are you measuring air temperature or sample temperature?

For longevity of your Peltier Element, does your Pi peltier controller monitor the temperature of BOTH sides of the Peltier element, to make sure the differential temperature does not exceed the elements rating?

Tom.. :slight_smile:
PS, I'm surprised you are asking here as the control system is Pi..