Arduino roaster controller with zero crossing dimmer

With all the time I’ve put into the Pic32 roaster I’ve always had this nagging worry that any of my sensors may have had damage during testing. When you try to get something working and keep getting gibberish you need to find a way to rule that out. As a result I decided to purchase an Arduino a few months back to confirm everything works. Turns out (so far) that everything IS actually working and I didn’t damage any sensors.  In the months I’ve been working with the Arduino I’ve actually learned a few reasons why some of the sensors didnt work on the PIC32 the way I had programmed them because learning to program an Arduino is sooooooooooooooooo much easier and better documented for “average people” to figure out compared to reading the hundreds of pages of technical manual for the PIC32 that isn’t ACTUALLY even finished being written yet.  There is a ton of code out there to test every single sensor I’ve purchased so far on Arduino. In addition I decided it would be a great way to start the dimmer using zero crossing detection in a system that runs outside the PIC32 before I convert it.

My intention is to get basic functions working on Arduino, then get the PIC to talk to the Arduino to send it commands to switch power by itself while the PIC reads all the sensors and logs data and then decides what to do as it comes from the Arduino.  Finally it will eventually be migrated entirely to PIC32 when I learn more about the interrupts on PIC32. At the moment I’ve put together a board that takes in 120VAC and uses Q4015L5 Triacs and MOC3052 drivers to control power to two receptacles. It reads the zero cross on my power using a H11AA1 and gets an interrupt used to trigger power switching. During my initial testing I confirmed the zero cross detection circuit worked and switching the triacs manually on or off worked without  regard to the zero cross state. It unfortunately didn’t seem to actually switch automatically for some reason when I wanted it to dim.  After a few days of testing I realized the Arduino Mega and the Uno had the interrupt timer pins in different places.

Since this is the first mains power circuit I’ve worked on I started running it with a variac out in the garage (and then fed that out into the driveway at the end of an extension cord…) and gradually turned the power up from 0 to 120VAC testing each section as I built it to ensure nothing arced or got hot or burnt up.  During late November I hooked it to the Arduino and got it to begin adjusting fan and heater under PC control as well as using two separate knobs.  Later in December and January I got it to begin logging to SD memory and following a programmed profile.  After that I added a bunch of additional environmental sensors and mounted it in a RadioShack project case.

 

First working prototype in Radioshack Project Case

I’m now at a stage where I’m looking to consolidate the various sensor cards either down onto a circuit board or attached to a set of pins directly.  I’ve grown tired of accidentally unplugging random wires carrying it back and forth from the garage to my office area and out to the kitchen stove / vent at various stages.  My hope is to shrink it down to a much less complicated arrangement being mostly on a single circuit board and interfaced by a few short cables to the Arduino.  It’s a bit complicated currently and getting worse.

Jumble of Arduino stuff

For the Arduino I’m using the MEGA 2560.  It is attached to the power control box pictured above via the DB25 cable.  At this time the box only controls power but I’ve mapped out pins on the DB25 to use for future boards to allow sensor breakout boards from a variety of DIY electronics companies to plug into them.   I’ll break this out to various header pins that match various breakout boards so they can be directly attached.  I’ll probably also design positions for eventually soldering chips directly to a board later once I order them when I’m further along and jumper the headers into those sections.  This will let me test a circuit on the board while still ensuring it actually works with the breakout board first.  The board will be designed to replace the items in the RadioShack box using SMD parts in some cases where cheaper and more convenient to shrink the board down smaller.  I hope to have it all shrunk down and consolidated to a single board with a DB25 connector to get to an Arduino I’ll be mounting inside an Arduino Crib case.