Must-haves for EASY DIY controller?

[grin] Or you can use the circuit I posted earlier, and choose when to turn on the device. The ZC event is an input to the AVR, and some simple timer code can be used to determine when to turn the device on. The user just says "input #7 is a motor", for example :)

Simon

I would much rather purchase dedicated SSRs that have measured and predictable characteristics and a dedicated turn-on mode (for a project such as this).

Just because we can detect and act on ZC and build our own SSRs, does not mean we should. Doing so adds complexity (parts, PCB, code) and CPU time to a project that is already going to be tight on RAM and CPU cycles. Lower parts count means easier construction, troubleshooting and lower failure rates. If we were building a stage lighting controller, a sound generator, motor speed controller or some other device that is highly reliant on timing with the AC waveform, then dealing with ZC in components and code has its place :) The goal here is to keep it simple and modular, that goes for both the hardware and the software. Most of the people building these things have no idea what Zero Crossing is, let alone how to detect it or deal with it in code.
 
Not to interrupt, but:

Since we've digressed even farther into power control banter, can I assume there's no more input from the target audience (beginners looking for an EASY way to get a controller project up and running) as far as desired functionality?

I'm happy to see good discussion, but I also want to make sure we're not missing anything or scaring away any input on functional requirements at this point.
 
One more simple thing to add could be a buzzer for audible alarm(s).
And I'm sure you've considered that but a supercap for the RTC chip is a must IMHO so that we don't loose the time on power loss.
 
Sorry to be on my 1-wire soap box but - DS2417

# Real-time clock (RTC) with fully compatible 1-Wire® MicroLAN interface
..
# Low power, 200nA typically with oscillator running

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2911

Another good reason to have 1-wire capability.

And DWZM - I have stated before, if you can solder a standard circuit like you are building, SMT is not hard. You do not need an oven. I did it perfectly on my first try after watching a youtube video.

You can buy the surfboards that let you plug surface mount devices into standard DIP sockets.

Stu
 
One more simple thing to add could be a buzzer for audible alarm(s).
And I'm sure you've considered that but a supercap for the RTC chip is a must IMHO so that we don't loose the time on power loss.

A battery is usually a better solution... though it has to be replaced, it can run the RTC for months (years) instead of days. A DS1307 and a CR2032 coin cell are a perfect combination.
 
One more simple thing to add could be a buzzer for audible alarm(s).

That's a good idea, I hadn't considered it, though it makes a ton of sense.

And DWZM - I have stated before, if you can solder a standard circuit like you are building, SMT is not hard. You do not need an oven. I did it perfectly on my first try after watching a youtube video.

You can buy the surfboards that let you plug surface mount devices into standard DIP sockets.

Stu

*I* have no serious aversion to SMT packages (at least big ones that are easy to solder), though it seems like it's a very common fear in newbies, hence I'm trying to avoid SMT or stick with big packages. The project will undoubtedly have some SMT in it somewhere. For instance, I need a MOSFET (BSS123) to drive the backlight on the LCD. There isn't a suitable chip in through hole, but there is in nice big SOT-23 packages.

A battery is usually a better solution... though it has to be replaced, it can run the RTC for months (years) instead of days. A DS1307 and a CR2032 coin cell are a perfect combination.

I'd planned on a DS1307 because I've used them before and I already have the code for them, plus they're I2C and we'll need that for other stuff anyways. And I've planned for a 12mm battery. 2032's are HUGE on a little PCB. :) I'd thought about supercaps, but I've never used one, so I'm not sure how they would apply. I'd think we'd be "fine" with a few days' supply. If your power is out longer than that, you'll have bigger problems than the clock on your controller resetting. If someone has real world experience with supercaps in this application I'd like to talk about it.

I've also thought about storing a default date and time in the code, then the controller could default to that if the RTC was not responding (if it had been reset thanks to a LONG power outage). otherwise, if the clock stops, we'll be in trouble. FWIW, Sparkfun use a CR1225, the same cell I'm planning on, in their DS1307 RTC breakout board (which is STUPIDLY expensive IMHO) and they claim 9 - 17 YEARS of backup life.

But again, before we get too deep in the design, I'd like to make sure we have all the functionality on the table.
 
A battery is usually a better solution... though it has to be replaced, it can run the RTC for months (years) instead of days. A DS1307 and a CR2032 coin cell are a perfect combination.
A battery will work I'm sure. I just like the recharging capability of a supercap :)

For instance, I need a MOSFET (BSS123) to drive the backlight on the LCD. There isn't a suitable chip in through hole, but there is in nice big SOT-23 packages.
Which LCD are you planning to use that needs a mosfet for the backlight? I'm running mine directly from the arduino pins.


I'd planned on a DS1307 because I've used them before and I already have the code for them, plus they're I2C and we'll need that for other stuff anyways. And I've planned for a 12mm battery. 2032's are HUGE on a little PCB. :) I'd thought about supercaps, but I've never used one, so I'm not sure how they would apply. I'd think we'd be "fine" with a few days' supply. If your power is out longer than that, you'll have bigger problems than the clock on your controller resetting. If someone has real world experience with supercaps in this application I'd like to talk about it.
My current controller has a DS1302 with a 0.022 farad supercap soldered across p8 and p4. Simple as that. Doesn't need anything special really.

I've also thought about storing a default date and time in the code, then the controller could default to that if the RTC was not responding (if it had been reset thanks to a LONG power outage). otherwise, if the clock stops, we'll be in trouble. FWIW, Sparkfun use a CR1225, the same cell I'm planning on, in their DS1307 RTC breakout board (which is STUPIDLY expensive IMHO) and they claim 9 - 17 YEARS of backup life.
Dang, 9 years might outlast the LEDs even :). If that's the case then a battery will be fine too.
 
Which LCD are you planning to use that needs a mosfet for the backlight? I'm running mine directly from the arduino pins.

To save on Arduino pins (I want to keep them free for float switches, PWM output, etc.) I put an 8-bit I2C port expander on the shield (MCP23008) and plan on driving the LCD from that. Other designs I've seen using that chip had a MOSFET on the pin controlling the backlight, so I just copied it. I'd imagine the pin can't sink enough current on it's own.

Dang, 9 years might outlast the LEDs even :). If that's the case then a battery will be fine too.

That's 9 years of backup - so if you unplugged the controller today, and plugged it back in 9 years from now, it would have the correct date and time. Pretty wild, and vastly more than enough for our purposes. Still, it takes up a LOT of room on the PCB. In your supercap application, do you have a way to calculate lifetime? Also, what function are pins 8 and 4? On a DS1307 that's Vcc and GND. I've found that you need a voltage on the BATT pin to get regular operation - even if you don't care about backup, it seems to freak if that pin is floating. Are you using an RTC with a different pinout or working some other magic?
 
To save on Arduino pins (I want to keep them free for float switches, PWM output, etc.) I put an 8-bit I2C port expander on the shield (MCP23008) and plan on driving the LCD from that. Other designs I've seen using that chip had a MOSFET on the pin controlling the backlight, so I just copied it. I'd imagine the pin can't sink enough current on it's own.
Same here but without the fet.. All pins but BLK + and - are connected via MCP23008 chip. BLK+ goes to arduino PWM pin for backlight dimming. BLK- is GND.

In your supercap application, do you have a way to calculate lifetime? Also, what function are pins 8 and 4? On a DS1307 that's Vcc and GND. I've found that you need a voltage on the BATT pin to get regular operation - even if you don't care about backup, it seems to freak if that pin is floating. Are you using an RTC with a different pinout or working some other magic?

Yes they are Vcc1 and GND, however on the 1302 Vcc2 (or pin 1) is used for 5V supply. Vcc1 is used for battery. I think the cap lasts about a week. I've tested it for 2 days only, but again 2 days without power and that's the least of our problems.
Form the DS1302 datasheet:
"Pin 1 VCC2 Primary Power-Supply Pin in Dual Supply Configuration. VCC1 is connected to a backup source to maintain the time and date in the absence of primary power. The DS1302 operates from the larger of VCC1 or VCC2. When VCC2 is greater than VCC1 +0.2V, VCC2 powers the DS1302. When VCC2 is less than VCC1, VCC1 powers the DS1302."
"Pin 8 VCC1 Low-Power Operation in Single Supply and Battery-Operated Systems and Low-Power Battery Backup. In systems using the trickle charger, the rechargeable energy source is connected to this pin. UL recognized to ensure against reverse charging current when used with a lithium battery. "

So it looks like you would need to use Vbat and GND on the 1307 (pins 3 and 4).
 
BTW did we cover fan control via PWM? I'd consider that a 10 as well just for the ability to reduce noise by running the fans at 80% or so.
 
I think we're going to run out of PWM ports. We have LED control, DC motor control, and now fan control. Might be worth an 8-port PWM port expander on the shield - there's probably room.

Plus, then that frees up ALL the GPIO ports on the Arduino.
 
What about something like this?

I2C.jpg


From Sparkfun.com:

Breakout Board for PCF8575 I2C Expander
sku: BOB-08130

Description: Have you run out of I/O pins? This great IC allows the user to expand up to 16 I/O using only two I/O for control! The PCF8575C is controlled through an I2C interface and features 16-bits of quasi-bidirectional input/output pins. Checkout the datasheet for more info!

Features:


"¢16 individually addressable pins
"¢Each pin configurable for input or output
"¢Interrupt output pin
Note for Arduino users : the pinning of power and I2C signals is compatible* with an Arduino board, thus you can plug this breakout board right in the 4 last analog pins of your board without any shield

(* as 'Tod' did with its BlinkM's package, a wonderful idea)
 
I have some PCF8575's in my parts box so that's high on the list of potential choices. But there are lots of potential choices! There's definitely room on the shield for an 8-port chip and pins; might not be room for 16.
 
Check out these for cost effective relay control http://www.futurlec.com.au/Opto_Relay_4.jsp

You can wire the NO or NC contact for safety just in case your controller fails or doesn't restart after a power fail.

The great thing about this board is you can drive it from ttl signals direct from a PIC or a single 1wire DO chip. All you need to do is get a single 1wire 8 channel DO chip and 1 resistor and you can drive two of these boards.

1wire output IC
1wire-2.jpg


Connected to two relay boards
1wire-1.jpg


rob
 
Hey rob, these are pretty cheap. Thanks for the link/ They're not SSRs but price is quite low and doesn't require assembly which fits nicely in the design goals.
US link: http://www.futurlec.com/Opto_Relay_4.shtml
at $15 we get 4 10A relays, needs 12V input and 5V ttl for control. Not SSR but opto-isolated so I guess it is pretty good. It might be worth it to just order a couple of these and pair them with one of the american DJ enclosures and be done with it.

Do any of the relay experts here see any problems with these boards?

BTW they have an 8 channel SSR board too but is almost twice more expensive:
http://www.futurlec.com/SSRAC.shtml
 
Last edited:
BTW they have an 8 channel SSR board too but is almost twice more expensive:
http://www.futurlec.com/SSRAC.shtml

Actually, at first glance, that 8-channel board looks very very similar to the circuit I posted earlier. Just from looking at it, it appears to be a triac board, with opto-isolated triac drivers...

Calling it an SSR board seems to be stretching the truth a bit. Sure, it's what SSR's *are*, but generally an SSR board doesn't need the support chips...

Simon
 
Some of my design methodology

1. Only switch AC if required. I ran a 24VDC or 12VDC power supply and power fans, solenoids, ATO pump, LED lights etc etc from low voltage.

2. By using relays you can wire the cct that in the relays de-energised state the device can be on. This means you can disconnect your "brains" and devices will be powered, albeit in the on state. As an example you may want to turn your return pump off when feeding for 15 minutes, classic case of where you want to energise the relay to stop the pump.

3. If switching large loads I would use a panel mount solid state relay. They only require 5VDC at 15mA to turn on. The have screw terminals and easy to wire. I would not be getting people to wire AC power in tight confines of relay boards. http://www.futurlec.com/Relays/SSR10A.shtml or similar , they have lots of them and as you see the terminals are spaced out. The best thing about these is that they are zero crossing is swicthing large loads there is no wear on the relay contacts. Downside is you cannot wire them as Normally close. i.e. they need power to turn on, thus if your controller fails there is no way to make the device "fail on".

4. By using item 1 methodology it becomes alot safer for you your family and little fingers that sometimes goes wondering in cabinets full of wires and stuff.

5. Cut down the amount of wiring for people, if you look at some of the PIC based cct's it scary...and I've designed lots of them. My direction is now exclusive 1wire, simple wiring, clean the only downside is you need a small embedded PC to run the code however its a lot easier distributing a simple script file to people to run on their PC rather than 2000 lines of PIC code. You can pick up a via or atom based mini or nano-itx baord very cheap.

rob


BTW.. The futurlec relay boards are very well made and look high quality. I have run 2 relay boards and the input opto for the last 2 years without trouble.
 
Serial Port

Serial Port

The more I think about this, the more I think you want a serial port. If someone wants to save money; they could leave off the LCD and keys.

I realize that USB is available. But think about the casual user. They probably won't have a way to write code on the PC. Also are we going to write a USB driver (maybe there is one) for Windows 7, Vista, XP, 2000, 98. Ok, I realize that maybe not all those are needed, but when Window 8 comes someone better be around to rewrite the driver. I think you get my point.

If we go serial all the menus can be built in. You only need to learn one language and you can make changes. This is also why I would go with the ATmega512 (is that the right name). We may have a lot of 1st time programmers that don't know how to right efficient code.

Just my $.02. And I admit to not being familiar with the support for Arduino. I am familiar with the work needed to keep the drivers updated.
 
Back
Top