Best way to get correct number of pins or connect modules

Ok, so I am working on a project where I need-

  • 16 gpios for triacs
  • 2 gpios for zero cross detection
  • 10 gpios for dip switches
  • DMX input (Planning on a Max485 but that can change)
  • ethernet (Most modules use SPI, but that is a lot of pins, and it would be nice to connect it the same way as DMX)
  • 9 of the switches are to set dmx address, the other is to select dmx or E131(ethernet)
  • DMX and E131 dont need to be used at the same time, its fine if I need to move a jumper to connect one or the other to say UART pins
  • I will be making a custom PCB for this, so as few separate boards as possible.
  • I dont want any smd parts, so the microcontroller must be DIP
  • I was planning on using an atmega328, but not enough pins.
  • I think there is a ethernet board that uses uart, but its crazy expensive (like $50 for one) and no good documentation that I saw.
  • Id rather only have one mcu, but if I absolutely need a second I guess its ok.
  • It needs to be somewhat fast, absolutely no more than 25ms from when first board receives signal to when triac gets switched.
  • What mcu should I use?
  • How should I connect DMX?
  • How do I connect ethernet?
  • How do I get enough pins?

If you havent already figured it out, Im building a 16 channel AC light controller that can be controlled with both DMX and E131. The reason I need 2 triacs is because it will have 2 15A cords so I can use 30A total, and I need a triac for each in case they are connected to a different phase.
Thanks!

How do I get enough pins?

The MCP23008 and MCP23017 I2C expander chips will give you 8 (23008) or 16 (23017) bidirectional GPIO pins, with interupt on change and internal pullup capabilities, per chip. Selectable I2C addresses so you can have up to 8 chips on the I2C bus. 2 I2C pins can control 128 GPIO pins.

The chips are available in DIP package. There are SPI versions available (MCP23S08 abd MCP23S17).

groundFungus:
The MCP23008 and MCP23017 I2C expander chips will give you 8 (23008) or 16 (23017) bidirectional GPIO pins, with interupt on change and internal pullup capabilities, per chip. Selectable I2C addresses so you can have up to 8 chips on the I2C bus. 2 I2C pins can control 128 GPIO pins.

The chips are available in DIP package. There are SPI versions available (MCP23S08 abd MCP23S17).

Will that be fast enough though to use for a triac?

I have no idea what "fast enough" means. I posted links to the data sheets.

Can you quantify that?

Electrolicious:
Will that be fast enough though to use for a triac?

Depends on what the triac is bieng used for dont you think ?

srnet:
Depends on what the triac is bieng used for dont you think ?

Turning AC lighting on and off as well as dimming, fade up, fade down, strobe, things like that. And it needs to be very reliable as it will be running for hours every single day. Its for one of those Christmas light shows that flash to music.

Hi,
Which Christmas?

Can you please tell us your electronics, programming, arduino, hardware experience?

To do all that fading etc, you may be better off using a commercially available dimmer which has digital/analog control input.
That way all your zero crossing problems would be solved and remove the mains frequency phase/sync and power isolation problems.

Especially if you want reliability and durability.

If you are going to make your own triac controllers, no you will not be putting it all on one PCB, in fact you need to have more than 16 for spares.
Why, Murphy....
When you least need it, something will fail, especially if you have built for reliability.

Each of your 16 Triac controllers NEEDS to be a separate PCB so you can easily swap out a board when a fault occurs, (and they will) and provide electrical isolation.

Ventilation will also have to be considered as there will be some heat generated by the Triacs.

Tom... :slight_smile:

TomGeorge:
Which Christmas?

Classic!

:grinning: :grinning: :grinning:

TomGeorge:
Hi,
Which Christmas?

Can you please tell us your electronics, programming, arduino, hardware experience?

To do all that fading etc, you may be better off using a commercially available dimmer which has digital/analog control input.
That way all your zero crossing problems would be solved and remove the mains frequency phase/sync and power isolation problems.

Especially if you want reliability and durability.

If you are going to make your own triac controllers, no you will not be putting it all on one PCB, in fact you need to have more than 16 for spares.
Why, Murphy....
When you least need it, something will fail, especially if you have built for reliability.

Each of your 16 Triac controllers NEEDS to be a separate PCB so you can easily swap out a board when a fault occurs, (and they will) and provide electrical isolation.

Ventilation will also have to be considered as there will be some heat generated by the Triacs.

Tom... :slight_smile:

Yes I will be putting it all on one PCB. If you use triacs correctly, they will not just fail. Can you explain how I have been using a Light-O-Rama controller that uses triacs for 3 years with no problems and my cousin used the same controller for years before that?I have a decent ammount of electronics experience as well as arduino, enough to attempt a project like this. And Im not building this because there arent any commercially available options, but because one, I like to build stuff, and two, they cost a lot ($350). And electrical isolation has nothing to do with it being on the same PCB, just with how I design that PCB and what I connect together. Look at Light-O-Rama controllers. Look at Renard controllers. I am trying to build something very similar to thoose. They are both on a single PCB.

HI,

And I'm not building this because there aren't any commercially available options, but because one, I like to build stuff, and two, they cost a lot ($350).

Good, but as you are building equipment from scratch, that is going through prototyping stages, both programming and hardware wise, modularizing your project would be advisable.

Tom... :slight_smile:

Cost... vs $350
Assuming low-volume production, at roughly $10 per TRIAC module incl labour, connectors & pcb, you’re already halfway there. add 10 hours of your own labour and parts, and $350 looks cheap.
The problem is far from impossible - and quite fun to do, but will take many hours of design, assembly and coding to get it right. Not 20-30 hours, we’re talking 100 hours at least..

For persistent settings, save pins, use the processor, not hardware switches (e.g. keypad or serial into EEPROM)
SPI can talk to many devices, just use simple chip-select logic.

Rethink your plans and with enough skill, you might just squeeze into this christmas, but it will be tight.

lastchancename:
Rethink your plans and with enough skill, you might just squeeze into this christmas, but it will be tight.

It's not looking good! :astonished:

lastchancename:
Cost... vs $350
Assuming low-volume production, at roughly $10 per TRIAC module incl labour, connectors & pcb, you’re already halfway there. add 10 hours of your own labour and parts, and $350 looks cheap.
The problem is far from impossible - and quite fun to do, but will take many hours of design, assembly and coding to get it right. Not 20-30 hours, we’re talking 100 hours at least..

For persistent settings, save pins, use the processor, not hardware switches (e.g. keypad or serial into EEPROM)
SPI can talk to many devices, just use simple chip-select logic.

Rethink your plans and with enough skill, you might just squeeze into this christmas, but it will be tight.

Yeah dont worry, Im not planning on getting this done by this christmas. Actually, I'm starting way early for next year.