Newbie here!I want to make a "lamp" controlling 64 60w regular bulbs individualy

s1lv3r0n3:
Far as i understand using shift registers you will have tons of addresses that will differ by only one digit which might make the code a bit confusing.

No, the code for shift resisters is very straightforward. You “chain” them so you load them all from a straight array of control bytes, in one operation which is handled by library code and as an option, the inbuilt SPI hardware.

s1lv3r0n3:
Shift registers have small current limits so u might fry some while learning how to wire it all. Its definitely feasible.

Actually, CrossRoads showed one of his products using TPIC6B595s which drive 250 150 mA, easily capable of directly driving small relays.

Thanks for the correction, im fairly new to this so im sure my understanding is not complete. By low voltage i was trying to say it would be in the milliamps range and not in the current range for driving the light bulbs directly. Using the registers and THEN buying relays may make that option less desireable than just using the 16 ch boards OP was talking about.

As for the programming when using i2c is was under the impression you would have to assign an address for each. The book i read said messing with libraries is more advanced stuff so i figured the OP would try to avoid that since its for more time spent fiddling with code than getting his project up and going.

The registers may allow for many many more connections than the 16 ch boards but thats the only benefit i see of using them over just hooking up the 16 channel boards to the IO pins and going from there.

Im certain the discussion may help provide OP some info to get him going. Thanks for the correction as its helping me learn as well.

I also boards with shift register and relay, which can be daisychained as well.
Here are 3, I was in a hurry when I made the video and just sent the same data to all 3 cards

RIN67630:
No. The cheap 16 chanel relay modules he had ordered already provide their own drivers, even opto-coupled interface.

to clarify : a relay module has 3 main parts.
the output is the isolated mains-connected Comm, NO and NC that has nothing to do with Arudino power.
the coil, for the Songle, averages around 80mA and should be connected to a separate power supply. as you noted, we control the coil by a separate signal that we do get from the arduino and is fed into an opto-coupler
An Opto-coupler is really an LED emitter and a cooespoinding collector. the LED emitter is on the signal side and can be isiolated electricaly from the LED collector on the coil side. for these modules, they are rarely isolated.
that said an LED emitter portion of the opto-coupler uses current from the signal to illuminate the LED. check the data sheet and you will find that, using a resistor limit current to about 20mA per opto is the default.
so, your 16 relay board has 16 opto-couplers and each one consumes about 20mA.
the coil for each relay consumes about 80mA from the separate power supply.
although each pin of the Arduino can output up to 20mA (less for other micros that run 3.3v) the quantity becomes a large power consumption for the micro-controller. even if you power at 10mA, the quantity pushes past the limits of total board power maximum.

PerryBebbington:
Thank you. Your subsequent posts suggest that maybe in your case my concern was misplaced. My concern for electrical safety goes beyond the person asking for help because this is a public forum and anyone can read it. You might well know what you are doing, but the next person reading it might not.

Good luck with your project.

concerns for safety are NEVER misplaced.
we often say that if you have to ask how to use mains power, you are not qualified. AND a forum is not a substitute for qualifications.
Also, we as a group, rarely every recommend how to do mains work. it my be easy for the OP on this thread, but next month or next year some noob may take it as a tutorial.

I totally agree Dave, you will have noticed many times that I post a warning like the one at reply #1.

dave-in-nj:
that said an LED emitter portion of the opto-coupler uses current from the signal to illuminate the LED. check the data sheet and you will find that, using a resistor limit current to about 20mA per opto is the default.

No. The PC817 optocoupler used in quite all Chinese relay modules needs optimally 2mA input current cf data sheet figure 6.
For my modules, at 3,3V I measured 1,2mA.

some observation and points on the thread.

#1) Crossroads , IMHO, is an expert on the shift registers, he has done many things with them and has the projects and has helped many-many on here figure out the problems.

and to answer your question. yes, you can daisy chain shift registers. of the TCIP595 Crossroads mentioned has 8 outputs. you can connect 8 of those chips and control them from a few pins (3 or 4 logic pins) from an Arduino. So, 8 chips for 64 outputs by using 3 logic pins is possible. other limitations apply, distance between chips for one.

#2) each house / building, etc, has multiple circuits. often one room might have 2 or even 3 circuits.
in another life, when upgrading a mains breaker panel, we would re-wire the circuits so the ones you would find nearest the bedroom doors were common as the vacuum was the most used device on that circuit. the ones by the beds were mostly used for alarms and heated blankets. In those days, you never wanted that circuit to trip. clocks had to be re-set.
The lights were on yet another circuit so when you did use too much power and tripped a breaker, you could see where you are.

For lighting like this, making multiple 'boxes' and plugging them into wall outlets that are fed by different breakers is a must.
You can easily find out by trying it, then, when the breaker trips, see what other outlets in the area are still hot. there is that separate circuit.

I think an Arduino current monitor might be a fun project.

#3) photography is an art. artists like to do things in a way that offers striking impacts. and there is a fade up and a fade down to incandescent lamps. Like tubes and music, they are more comfortable for humans. technically, there are other ways, but artists follow their own path and when done in some magical way, we get inspired and awe struck by the results.

#4) Zero-Crossing. we don't talk much about zero-crossing relays in the hobby world, but you can modify a relay to only change state at zero crossing. it does not impact the filiment as much and humans cannot detect the time difference. The ones I use for work are about $125 each for a specific lighting control panel.

the DMX, I think (do NOT assume I know ) has a delay from the control signal to the light going on.
...doing stage lighting in another life..... the lighting director had to flip the switch before the beat, you can tell a good director when the lights and the music were actually in time. Today, I think the computers allow for that and it becomes computer driven.

the old joke..... if you ever want to know who is the sound man in the band, just ask, 'who is the sound man' the guy that yells "WHAT?" well, that's him !#4) lots of people use relays and Christmas lights on their houses. the technology is comparable. but, you will burn out lamps more frequently. the OP did not say how long or how often the project is to be used. if for a 2 week photo shoot, all is great. if for a permanent display in a mall.... much needs to be discussed.

If you have ever seen a tail light of a car just go off, that was the early LED application. now they fade them off and on.
they mimic the incandescent lamp.

You can mimic an incandescent with a fade up and fade down. but not using relays. You would need to use something else.

not sure of your skills or your budget. you can get electrical switch boxes in metal that are gangable. they have removeable sides and can connect to make a long row. 8 in a row, with duplex receptacles (here in the USA) you can remove one tab on the side of the receptacle and turn them into 16 individually controlled outlets. leave the other tab for power. by using all store-bought parts, you are at least maintaining a basic level of compliance to codes.

[ /ramble mode ]

dave-in-nj:
some observation and points on the thread.

the DMX, I think (do NOT assume I know ) has a delay from the control signal to the light going on.
...doing stage lighting in another life..... the lighting director had to flip the switch before the beat, you can tell a good director when the lights and the music were actually in time. Today, I think the computers allow for that and it becomes computer driven

The DMX lighting controllers are optimized (zero crossing is obviously their standard, but also preheating the bulbs beyond their light emission level to avoid the starting current and dramatically speed-up the time response of the projectors.

I am wondering how you think targetting a zero crossing with mechanical relays, it will surely need a lot of manual trimming, I would not try that...
You can do that with solid state relays, but these are playing in another price league.

And there are always industrial quality light bulbs that are designed to handle the stress of continuous on-off.

Paul

RIN67630:
No. The PC817 optocoupler used in quite all Chinese relay modules needs optimally 2mA input current cf data sheet figure 6.
For my modules, at 3,3V I measured 1,2mA.

there are many variations of these relay modules. the ones I have use a Toshiba TLP280, small white, 4 pin opto with GB, a date code and xxxP280
CTR on the data sheet between 70 and 200 with 1mA

the data sheet for the PC817 is over 500 at 1mA
The other one I have seen is the Lite-On LTC317
Wow, interesting how varied the CTR is dependent on the opto used.
with 'the forum' recommending 220 ohm, 330 ohm 1k as 'good enough' for the resistor, there are some varying results to be sure.
My point is that the total power consumption has to be calculated.
64 outputs all set as source vs.
32 are set as source and 32 are set as sink. huge difference for the board.
the MEGA has a total current limit for all pins of 200mA.

64 outputs, with 5mA is not going to work
64 set at 2 mA would not be a concern.

RIN67630:
The DMX lighting controllers are optimized (zero crossing is obviously their standard, but also preheating the bulbs beyond their light emission level to avoid the starting current and dramatically speed-up the time response of the projectors.

I am wondering how you think targetting a zero crossing with mechanical relays, it will surely need a lot of manual trimming, I would not try that...
You can do that with solid state relays, but these are playing in another price league.

pre-micro-controller lighting control panels for retail stores. manufacture Lighting Control & Design
I do repair and maintenance. and, yes, a whole different price league.
most of the stuff we have to support is 1990's era.

here is a pic of the relay. looks totally hand made.

AC in the USA, so 120 V
electronically latching and zero crossing.
all circa 1990 and still running daily.

if you were here in the States, I would be happy to send you a few to play with.
I'm down to only a dozen left as we are now ripping out the panels when they have significant failure.

dave-in-nj:
the MEGA has a total current limit for all pins of 200mA.

I would not go for a Mega, but for shift registers or i2c multiplexers.
You have no load problem, the wiring is easier.

Depending on the other conditions, if the lamps are to be placed wide apart, a distributed solution with 8 pieces of esp01s and an I2C each per group of 8 lights, all connected over WiFi could have been the leanest DIY solution.
Cables are expensive and just a pain to install.

dave-in-nj:
the MEGA has a total current limit for all pins of 200mA.

With that limitation your limited to only one of the 16 ch boards, a more complex solution would be needed for 64 total lights. Sounds like the other options have the features needed built in

Can’t see this ever getting made but … you can help the bulbs survive by having them pass a small current to keep the filament warm when switched off .
The cost of leds will probably be recouped by cost of wiring etc