Growroom controller - Page 1
Forum section: electronics / projects

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 06, 2013, 12:38:52 am
content: Hi Everyone,I'm looking for some feedback on this project before I have PCBs made. I'm using a paid version of Diptrace because design has over the 300 pin max for the free version and the 3X4 board size limit of EagleCad was just to small. I've linked a zip with PDF, Diptrace schematic, and PCB Layout. YOu should be able to open with the free version. This board is controlling a conventional residential furnace, central air conditioning unit, co2 burner, intake blower, exhaust blower, dehumidifier, and humidifier. All controlled units either use 24 volt ac control or a 24 volt contactor. I'm fairly new to PCB design. I'm hoping someone with more experience can save me some headaches.I'm using:Arduino 328 chip with uno bootloaderFTDI USB to Serial Converter fromwww.jayconsystems.comDHT22 temperature-humidity sensor for measuring indoor and outdoor temp and humidity.nRF24L01+ to talk to a hydroponic dosing system later down the road.HD44780 20X4 LCD display.Phillips App Note AN97055 I2C Level Shifter. So, I can use a K-30 10,000ppm CO2 Sensor fromwww.co2meter.comENC28J60 Ethernet ControllerThanks,Redneck

author: lgbeno
author_rank: Frequent Contributor
timestamp: August 06, 2013, 01:13:22 am
content: I think if you upload PDFs you might get more reviewersSent from my iPhone using Tapatalk 2

author: smashedProton
author_rank: Frequent Contributor
timestamp: August 06, 2013, 01:43:00 am
content: Is this for..... drugs???

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 01:50:06 am
content: Yep. Delicious, delicious drugs.I'll have a look at it, the PCB doesn't look bad at a quick glance.One thing to point out, though not about the PCB in particular: your buck converter puts out nominally 5.4V. I can see this ending up too high if the component tolerances conspire to give you a bad day. I'd use 30K/10K rather than 10K/3K, that gives nominally exactly 5V.Another point: Everything here will run at 3.3V just fine. Hitch a ride on the TARDIS and take the 5V supply back to its home decade and drop all the level shifting circuitry.Looks pretty good to me.Of course, there's nothing on here that's particularly difficult to lay out. The only place I see anything wrong with is the buck converter, particularly R12. It seems a bit too low to me, first off. But the traces running to it really should be moved a bit. Consider that the 34063 is looking at the voltage drop between that resistor and VCC. Your power input trace should come first to VCC, then go to the resistor (yep, even if it must backtrack), then to pin 7, then to the rest of the converter. And those traces should bethick, you don't want a large chunk of the resistance to be in the copper traces themselves, they're highly variable, and you don't want them to be too inductive either. When I'm laying out one of these I don't just use traces, I get out the zone/polygon/copper pour/whatever-DipTrace-calls-it tool and draw the fattest copper regions I can fit, particularly there and at the switching node (pin 2 in this case, as well as everything it connects to).Also, stick a cap on AVcc on the AVR chip as well, it should be decoupled. It's notjustthe ADC power supply.And why on God's green earth are you using a 1A fuse on the 24V input? This thing won't use 24W unless something on it decides to self-destruct, in which case the fuse will be perfectly happy to allow it to continue. Cut back.

author: MacAttak
author_rank: Unknown
timestamp: August 06, 2013, 04:00:13 am
content: Quote from: smashedProton on August 06, 2013, 01:43:00 amYou can't grow drugs, silly goose.

author: poorchava
author_rank: Super Contributor
timestamp: August 06, 2013, 07:09:36 am
content: You know, most of the stuff that can be used to grow peppers or exotic flowers can also be used to grow pot. Same as kitchen knife you can cook with it, but you can also kill with it.Btw.I designed something like that few years back in order to grow hyper hot chilli peppers, but in the end it didn't work out

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 07:15:41 am
content: I just buy my peppers. And my pot.

author: dfmischler
author_rank: Frequent Contributor
timestamp: August 06, 2013, 02:20:27 pm
content: Quote from: RedNeckEngineer on August 06, 2013, 12:38:52 amAre you getting natural light, or are you using artificial lights? Many crops need controlled light/dark cycles. Remember thatCO2 isn't very helpful except when photosynthesis is taking place. My family's greenhouse range usesaspirated temperature and humidity sensorsexcept for seedlings which areheated from below with hot water in PEXand sensed at the root zone, and watered with a sun-sensing mist system.

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 06, 2013, 04:52:33 pm
content: Hi Everyone,Thanks for the help. This is for a veggie garden....1. I changed those resistors.2. I'd love to use 3.3 volts for everything. I looked into it. But, I have (10) atmega328-pu preloaded with uno bootloaders. The Arduino IDE wants atmega328p chips to load the other bootloaders. It doesn't like my atmega328-pu chips. I don't know how to change the bootloader/settings on the chips to get them to work at 3.3 volts. Tried using a uno as a ISP to reflash the chips but, it didn't work. I'm thinking of getting a real ISP programmer. I've bought alot of parts already and really should use what I have already. I may change my mind of this all doesn't work as planned.3. I reworked the PCB. I moved some things around and moved the current sense resistor to the back of the board. there is the battery back there anyways.4. added that decoupling cap.5. The calculator I used said to use that current sense resistor. I'm going to breadboard the power supply and test it all out before going to PCB.6. The idea for the fuse is that, if the wiring hooked to outputs gets shorted it will pop the fuse and save the triacs. It's not really there to save the low voltage stuff other than if there is a voltage spike that makes the MOV (if I picked the right one) go off.I've updated the files attatched. there is pdf and pcb, and sch files in there.Thanks again

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 05:02:20 pm
content: Looks good to me!I was going to be picky about the buck converter switching node again, but really, at this low power level it doesn't matter a rat's ass, it's fine! Much better than before.As for the 34063 resistor: In this configuration, the resistor limits you to 0.3/R peak current, and the peak current is double the output current. That gives 2A peak, 1A output. MC34063 is 1.5Apeakmaximum, so the resistor shouldn't go any lower than 0.2. Most of those "calculators" don't bother to tell you when you're exceeding limits.Of course, you're not going to be drawing 1A anyway. I'd spec it for 250mA, giving 0.6 ohms (0.56 standard value).Itwillwork, it just won't keep the chip from blowing up if you mess something up.Does the Uno bootloader really pitch a fit if you run the chip at 3.3V?A bare AVR requires absolutely no reconfiguration to run at 3.3V, it'll just do it without complaint. Have you tried just doing it anyway?

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 06, 2013, 05:29:24 pm
content: Hi everyone,I need this to work for years with out problems.I figured out how the use the polygon thing. I did the copper pour it can't be that different.I'll get that .2 ohm resistor or maybe stop being lazy and really read the data sheet and get the calculator out.I guess the problem with 3.3 volts is, you need to have a slower clock speed. because the atmega328 isn't as stable at 16 mHz at 3.3 volts. you need to use something like 8 mHz. If u don't change the settings, the timing is off and timing based things don't work right. I haven't tied to bread board it. I just did a google search and it popped up right away.thanks again

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 05:40:08 pm
content: Oh, yeah, I forgot about that.I usually use them around 12 MHz, where they have no problem at 3.3V.

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 06, 2013, 06:08:46 pm
content: c4757p are u use an Arduino boot loader and getting 3.3 volt and 12 mHz to work?

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 06:14:18 pm
content: Nope, no bootloader. I've only used the Arduino bootloader once and it was at the standard settings. If you get a true AVR programmer (pretty cheap on eBay sometimes) you can program it however you want.

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 06, 2013, 07:49:30 pm
content: if u flash with the ISP. can u still use arduino IDE serial to debug with out bootloader?

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 09:02:34 pm
content: Yep, it's just a plain old serial console. You do have to make sure whatever you connect to it isn't putting 5V up the RXD port. You can even just use a resistive voltage divider for that, 1.2k on top and 2k2 on the bottom will do. If you've got E24 resistors handy, 470 and 910 gives a similar ratio but is a bit stiffer, letting you use a higher speed. Many 5V devices, including the USB-serial bridge on an Arduino, canreceive3.3V signaling with no problems, so you don't need anything on TXD.

author: MacAttak
author_rank: Unknown
timestamp: August 06, 2013, 09:11:21 pm
content: With a real programmer you can also use a real development IDE (Atmel / Visual Studio) that has things like ERMAGERD Intellisense and refactoring features. Also, you can debug the thing in-systemSet a breakpoint, inspect variables, toggle pin states, etc. You might not even need to fool with a serial console.The Arduino programming environment is like coding with one arm tied behind your back while a monkey is trying to stick its fingers in your eye sockets.

author: c4757p
author_rank: Super Contributor
timestamp: August 06, 2013, 09:14:42 pm
content: Quote from: MacAttak on August 06, 2013, 09:11:21 pmBut using Atmel Studio, the monkey just leaves one eye unpoked....

author: olsenn
author_rank: Frequent Contributor
timestamp: August 06, 2013, 09:15:20 pm
content: QuoteHaha that's right. You can only grow weeds, fungus, poppies, flowers, and cacti. Oh wait!!!

author: MatCat
author_rank: Frequent Contributor
timestamp: August 06, 2013, 10:13:25 pm
content: You don't need a special programmer to program an AVR without a bootloader, I pretty much program ALL of my AVRs using Arduino as ISP and avrdude (If you use the Arduino IDE it can also do this) and never bother putting on a bootloader, heck on a 328 you get an extra 1.5k of flash I believe it is without the bootloader. As far as 3.3v goes, even though they are not spec'd to run at 16MHz on 3.3v they will do it just fine, or you could drop to 12MHz which is in spec for 3.3v.

author: RedNeckEngineer
author_rank: Contributor
timestamp: August 07, 2013, 01:00:52 am
content: I looked at Atmel Visual Studio and avrdude alittle in the past. Its just that arduino IDE just has so many open source libraries for just about anything. I'd love to use a more advanced IDE Is there any good tutorials or books out there? Is there more libraries out there that, i haven't found, or is it you have to write your own libraries?

author: notsob
author_rank: Frequent Contributor
timestamp: August 07, 2013, 01:08:05 am
content: Here's a low cost AVR programmer , works with avrdude has selectable 5V or 3V3 - $3 including postage and it works.http://www.ebay.com/itm/USBASP-USBISP-AVR-Programmer-Adapter-10-Pin-Cable-USB-ATMEGA8-ATMEGA128-Arduino-/310506909410?pt=LH_DefaultDomain_0&hash=item484ba76ee2

author: c4757p
author_rank: Super Contributor
timestamp: August 07, 2013, 01:11:08 am
content: The Arduino code isn't really special. I've actually taken Arduino libraries, converted them from C++ to C (with what amounts to basically a text substitution), and stuck them in a PIC project! (The only decent free compiler for 8-bit PICs doesn't do C++) You can use the Arduino libraries, sometimes with a bit of adaptation.

author: poorchava
author_rank: Super Contributor
timestamp: August 07, 2013, 08:03:22 am
content: QuoteOrdinary peppers - ok. I dunno how about your place, but in Poland you cannot buy stuff like Bhut Jolokia or White Habanero or Chocolate Bhut in your closest convenience store. I mean sure, you can get them dried but it's not the same thing