Using shift registers in the switchboard, instead of arduino

Discussion of the online video show SuperHouseTV, where Freetronics co-founder Jonathan Oxer hacks on his house using various Open Source hardware and software. [SuperHouseTV site]
Post Reply
mofosyne
Posts: 3
Joined: Tue Feb 12, 2013 1:56 am

Using shift registers in the switchboard, instead of arduino

Post by mofosyne » Tue Feb 12, 2013 2:18 am

In Ep2 of SuperHouseTV, I noticed that you placed the Arduino inside the switchboard. This approach is all well and good. However wouldn't it be a little better to keep the switchboard control logic separate from the 'arduino communication' logic?

What I mean is that instead of arduino in the switchboard directly controlling the relays, you have banks of Shift Registers ICs which are simpler and more rugged. It is also more future proof compared to the arduino, in that the logic of a shift relay is more easily reversed engineered than an arduino. Expanding the numbers of relay output is also very easy, just attach more shift registers in series, and update the number of bits to shift into the input of the shift registers.

The wires coming out of the switchboard to the external arduino (or raspberry pi GPIO), would be "Data_In, Clock, and Latch" as well as "Power, Ground". Alternatively if self powered, and you want no wires exposed... you could just expose only a 3 photosensors to send data in via LED lights (Thus making a poor man's optical isolators.)

If we make this an open source "standard", then we should also think of a way to report the size of the shift registers.

mofosyne
Posts: 3
Joined: Tue Feb 12, 2013 1:56 am

Re: Using shift registers in the switchboard, instead of ard

Post by mofosyne » Tue Feb 12, 2013 2:59 am

I though about automatically reporting the size of the daisy chained relays by passing bits though one end and seeing how long it takes to come out the other. The problem is, how do you clear the registers without adding another control wire? I couldn't think of a way, so I ditched the idea. You will just have to manually change the number of bits to shift settings in the 'arudino' or whatever control unit you use.

proposed pinout for interfacing this 'shift register' based switchboard to the outside world is this:

[POWER] ~ Optional? Maybe powered within switchboard?
VCC ~ powering the board (Optional)
GND ~ 0V Ground (optional)

[Clock Source]
CLOCK ~ Used to indicate a new bit to shift in or out, used by Get/Set relay state

[Set Relays State]
SHIFT_IN ~ Shifting desired relay states in bit by bit.
LATCH_IN ~ Used to signal that all the bits are already shifted in, and to update the relay state.

[Get Relay State] ~ Optional but recommend, just in case the main control unit resets.
SHIFT_OUT ~ Used to shift out the state of all relays
LATCH_OUT ~ Shift current state of all relays

Total count in terms of ICs per board is 3 ICs. One shift register "serial in"/"parallel out" using 74HC595, for setting relay states. One shift register with "parallel in"/"serial out" using 74HC165(Has Asynchronous parallel loading, as opposed to 74HC166 which is synchronous), for reporting current relay state. And lastly one Darlington Driver 8-Channel ULN2803, for an easy way to interface with relays. Total cost of these 3 chips is not much.

What do you think? Is there really a simple way to count the total number of daisy chained shift register bits? How shall we handle isolation? Shall we use photo transistors and LED to isolate, or just isolate using optical couplers?

---------
If you like the above idea, I shall make up a schematic for you guys. I'm still new to all this, but this should not be too hard to design.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Using shift registers in the switchboard, instead of ard

Post by jonoxer » Thu Aug 01, 2013 6:21 am

Sorry I hadn't replied to this earlier. Have you made any progress in the meantime?
--
Jon

Post Reply