Lessons of my dehydrator

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First off, employing an ATMEGA32 for basically a two discrete output food dehydrator is absurd. But a couple years ago I modified an existing project on a breadboard to 1) turn on a lamp for five minutes, 2) turn off the lamp, and run a fan for five minutes, 3) repeat indefinitely. This worked great for drying my homegrown hot chili peppers; the lamp heats the peppers, the fan blows and cools. (I could have bought a better appliance, but this was more fun.)

Wanting the breadboard back I recently undertook building a permament solution. Two output pins drive two separate relays via NPNs; one relay connects a 500ma PC fan to 12V, and the other closes a 120V outlet to a lamp. Snubber diodes included as well as a couple buttons and LEDs for debug and funzies.

I use a prototype board with scads of 5-holes connected with conductor. Lesson1: next time mount the components from the underside so the terminals can be soldered onto the conductor. I've had some more expensive boards with conductor extending inside the holes, but this didn't have that.

Since the fan consumes 500ma, the relays about 100ma each, I used a 12V/1.2A wall wart (7805 for 5V to AVR). Initially, when the power was applied, the fan would attempt to turn, apparently draw too much current and reset the AVR. It would click/reset about 20 times and finally start up. Lesson2: I replaced the cap between Vcc and Gnd with a beefier electrolytic, and added one to the 12V supply. Clicking/resetting gone.

I put a fuse inline with the AC powered lamp, added a power switch, all in a notebook sized metal enclosure. Been running for several hours. Of course I won't need it until next Fall when (hopefully) the habos will be ripe!

While overkill, the code (C++) will serve as a basis for upcoming projects. Rough schematic as shown.

Attachment(s): 

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do those LEDs really light up? 8)

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will take your "rough schematic" literally, but not without commenting for posterity.

1. Your leds are back-the-front.
2. You need bypass caps on the uC
3. Your reset line is floating. Needs 10K to Vcc.

Cheers,

Ross

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doh! Copy/pasted the snubber diode. Thanks, Ross. I thought the electrolytic on 5V was a bypass, will search and fix.

Reminds of the legend my EE friends have told me about the famous TV manufacturer where the guy would yank parts out of a television set, and if it kept working, that part wasn't needed!

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

0.1uF across the uC power pins will provide a lot of noise suppression. The electrolytic holds the power line steady under heavy power drains.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVcc ought to also be connected to V+.

As you aren't using PortA one might argue the need to connect it, but generally for reliable operations all of the V+ pins should be tied to V+, and all of the Ground pins tied to Ground.

In theory, the AVcc/Gnd pin pair should also have a By-Pass cap.

But if you aren't using PortA does it really need one? (IMO: Yes)

I've got a drawer full of Tinies, perhaps I should drop one in the mail to you!

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just so I don't mislead some other code monkey I've updated the schematic.

DocJC wrote:
I've got a drawer full of Tinies, perhaps I should drop one in the mail to you!
LOL, I've got some ATMEGA8s but don't have the right size sockets. I solder a socket on the board so I can yank out the 32 for reprogramming.

Besides, I may add a 4x7seg for timer/temp display.

Attachment(s): 

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A "better" reason for a socket, (assuming there is such a thing), is to replace the chip if you smoke it, and yet the remainder of the PCB remains intact.

It is MUCH easier to simply put a 6-Pin ISP header on the board and hook up the ribbon cabled connector than it is to constantly pull the chip and re-insert it.

Besides, with all of those spare pins you don't even have to use any of the I/O pins that are used for ISP programming, so you won't even have any possible interference with the attached hardware and your programmer.

I've also got a drawer full of 6-Pin headers. Guess I'll have to toss a few of those in the envelope ;)

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
A "better" reason for a socket,
Or maybe "another"...? :)

At work, the designers afford me JTAG, ordinarily. For something this simple, I debug with the simulator, so programming the 32 is no hassle. But for giggles I will take your suggestion just to say I did it (i.e. the ISP method).

For any complicated development I would probably write the code on my ATMEGA128 dev board/mkII and then recompile for the 32.

Quote:
Guess I'll have to toss a few of those in the envelope
Can you toss a nice scope in there too? LOL

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 7805 works like a zener. It needs to be 12V to the bar, fat end of triangle to gnd. You really have a solid 5V?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
It needs to be 12V to the bar, fat end of triangle to gnd.
I don't understand this sentence. My 7805 datasheet says 5-18V input. Measured 16V out of the wallwart but guessed that was because it wasn't under load. Also it is made in China, brand name Playtex. Hope I don't burn the house down.

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do not forget to decouple the nRESET line noise induced by the motor and/or the mains line (by using a 10..100 nF capacitor to GND) to prevent any unnecessary reboots. Motors, and all the inductive loads in general, produce nasty spikes.

If you need a decent and affordable scope you can have a 50 MHz Rigol DS1052E DSO for USD 329 or a 100 MHz DS1102E for USD 399; or even hack a DS1052E into a DS1102E for free! (links at the message, below)

Giorgos_K wrote:
[...]
In a few words, the Rigol DS1000E/D DSO/MSO was a nice design of Rigol with the aid of Agilent[1] in 2004, when it became available. For the record, Agilent provided Rigol with a hardware and firmware solution to build their low-end (and now obsolete) 3000 series rebadged oscilloscopes, in order to buy time to develop their own ASIC for their mid-range Infiniivision 2000X/3000X series DSO/MSO equipment.
[...]

If it was good for Agilent it is good enough for me.

-George

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, George. Actually, I have a Kikisui (LOL) scope gotten off Ebay several years ago for $200; it kind of works. Junk compare to the $12K MSOs I use at work. "Fortunately" I haven't had much time for home projects until recently. When/if business picks up I'll pay ~$600 for a good used Tek scope.

Edit: I looked at one of the Rigol links. Cool. Might pull the trigger and buy one....

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are welcome, Jim.

Personally, if I needed a better scope than that I would go for an Agilent Infiniivision 3000X series DSO/MSO (for $3K..10K+), or for a Rigol DS4000/DS6000 for almost half that money. Tek is not what it used to be, anymore; not after their acquisition by the Danaher Group...

EDIT:
Added the price tag range.

EDIT 2:
If you go for a Rigol, do a 24 hours burn-in test and do not hesitate to claim a warranty replacement if you detect excessive noise or any artifacts. Their QC is not what it used to be a couple of years ago...

-George

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

Last Edited: Wed. Feb 27, 2013 - 06:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've used several scopes at work, HP, Tektronix, LeCroy, and Agilent. All good and usable, even for a code monkey like me, but the Tek MSO was very intuitive yet feature full.

Edit: spelling.

C: i = "told you so";

Last Edited: Wed. Feb 27, 2013 - 04:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding the latest Tek equipment, this is the Tektronix Mixed Domain Oscilloscope MDO4000 review and teardown, as well as some criticism on the UI unresponsiveness and its price tag against other competitor's equivalent equipment.

I guess that this is the price you will have to pay as a leading test-equipment company when you let marketing people decide what engineers need...

-George

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cpluscon wrote:
bobgardner wrote:
It needs to be 12V to the bar, fat end of triangle to gnd.
I don't understand this sentence. My 7805 datasheet says 5-18V input. Measured 16V out of the wallwart but guessed that was because it wasn't under load. Also it is made in China, brand name Playtex. Hope I don't burn the house down.

7805: you've used an unusual symbol for it...

A standard 7805 requires at least 7v input to provide a regulated output. LDO versions - different part number - exist that will work with lower differentials, about half a volt or so.

It also needs 0.1u or so on both the input and output side, and 10u or more on the input side, to maintain stability.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ha, I didn't realize Bob was talking about the schematic. Must be his southern accent!

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I added a TC74 (TWI temp sensor) and a 4x7seg readout (TWI also). The dehydrator function still works, but a switch setting at startup turns it into a greenhouse warmer.

Time to get those peppers/tomatoes started! It turns the lamp on until temp >87F, lamp off until <80F. Fan blows once in a while. LEDs display current temp reading, filtered of course.

It's not really a greenhouse, but a 6x2x2 foot enclosure I've used to get seedlings going in spring. The lamp seems to raise the temperature 10F an hour, roughly.

C: i = "told you so";