Lots of serial links to a micro - Page 1
Forum section: electronics / projects

author: huslage
author_rank: Newbie
timestamp: April 04, 2014, 02:01:22 pm
content: I'm building an art project that modulates audio onto LED pendants which are received by headsets as people walk underneath them. We are currently planning a maximum of 512 individual LED pendants.I am considering using an AVR on the pendants to do the PWM modulation. This will have some sort of SPI flash storage to store the audio files. The requirements are that we can remotely upload audio files via a computer attached to this beast. There is currently no requirement that the audio playback be coordinated in any way...they simply play in a loop.I can't, for the life of me, think of an easy way to connect all of these together such that we can send data to them remotely. I considered using Ethernet, but that makes things really expensive. RS485 seems a bit of a pain.What ideas are out there for connecting a large number of independent microcontrollers together like this?

author: dannyf
author_rank: Super Contributor
timestamp: April 04, 2014, 02:21:32 pm
content: QuoteRather than trying to implement something that you have no clue about - and end up frustrating yourself, I would try to figure out what you do know and implement something based on that. That way, you will always make progress and when your knowledge / skills are sufficiently advanced, you can come back to your original, more complex goal.Having said that, I would wire them up via RS485 / CAN: it is simple and sufficiently resistant to interference. I would also implement a protocol whereby the nodes known which message is intended for them. So each message would contain a header / identifier for the node it is intended for, a body, and a checksum.

author: dfmischler
author_rank: Frequent Contributor
timestamp: April 04, 2014, 02:42:32 pm
content: I agree that it would be hard to beat RS485 for cost, but keep in mind the addressability limits (32 nodes per segment, unless you use repeaters). What is your total throughput requirement (i.e. how long can it take to update all 512 nodes)? What level of reliability is required (e.g. do you need to prevent the loss of one "segment" of an audio sequence going to a particular node)? Do the nodes need to be able to keep playing the old audio tracks while they are being updated?Ethernet will probably cost more for hardware, but you might also need a lot more software (e.g. ARP, IP, TCP) unless you plan to develop your own LAN protocol.Wifi would be great, but will probably cost even more for hardware and have even more software requirements than ethernet.

author: dannyf
author_rank: Super Contributor
timestamp: April 04, 2014, 02:49:43 pm
content: Wireless may be a good option if we are not talking about too long of a distance. those 2.4G receivers are quite cheap and you don't have wiring to worry about.It is slower, however.

author: DenzilPenberthy
author_rank: Frequent Contributor
timestamp: April 04, 2014, 02:50:44 pm
content: A project I did a while ago was a board with 8 analogue outputs which drive tiny tiny heaters. The current from each o/p is controlled by a PIC on the board and an 8 channel D-A converter. The whole thing is then controlled via RS232 from a PC. i.e. you tell it to turn on channel 4 with 5mA.There was a lot of interest in expanding the number of channels massively so we used the second UART on the PIC to echo the commands back out again (and on to another identical board) but with 8 subtracted from the channel number (and ignore commands for an address greater than 8 ).That means you can daisy chain the boards and the instructions get passed along the line.I don't know if this would be fast enough for your application but it was very easy to implement in both hard and software.

author: Bored@Work
author_rank: Super Contributor
timestamp: April 04, 2014, 02:57:32 pm
content: Watch a few of Mike's videos where he shows details of his light / artist installations. I remember one (or two?) where he also talked about the bus system and addressing he is using. Or maybe you can contract him to do the development :-)

author: G0HZU
author_rank: Super Contributor
timestamp: April 04, 2014, 02:57:37 pm
content: How are you powering the pendants?Are they battery powered or wired to a common PSU? If there is a common wired PSU connection you might be able to make up your own PLT protocol for sending data along the power line to each pendant.

author: Len
author_rank: Frequent Contributor
timestamp: April 04, 2014, 03:51:59 pm
content: Quote from: Bored@Work on April 04, 2014, 02:57:32 pmFYI, since there's more than one Mike on the internet, B@W was referring to this Mike:https://www.youtube.com/user/mikeselectricstuff

author: ajb
author_rank: Super Contributor
timestamp: April 04, 2014, 04:11:51 pm
content: RS485 shouldn't be much of a pain, really, and will likely be the cheapest and easiest in terms of wiring and programming. There are some wireless systems with mesh protocols that may be somewhat easier to program, but will definitely be more expensive. The standard limit for the number of devices on an RS485 bus is 32 as dfmischler mentioned, but there are 1/4 and 1/8 unit load transceivers available that would allow you to put up to 128 or 256 devices on one bus. The only tricky bit with programming for an RS485 interface is going to be avoiding collisions. The easiest way to avoid this is to ensure your system only ever requires one device to transmit. If you need two-way communication, you can use one pair of wires for master->slave communication and the other for slave->master communication, and as long as you have only one master device you just have to ensure that only one slave ever transmits at a time.Since you mentioned AVRs, look into the multi-processor communication mode, which I believe is available on all the devices that have a hardware USART (possibly not on the ATTiny devices that have a USI). It's a hardware mode that uses the first stop bit to indicate if a character contains an address or data and prevents data from appearing in the receive buffer until the device has been addressed. It should substantially reduce the amount of data that each slave device has to process and simplify your firmware a bit.

author: tonyarkles
author_rank: Regular Contributor
timestamp: April 04, 2014, 04:13:32 pm
content: DMX-512http://en.wikipedia.org/wiki/DMX512is an industry-standard way to do lighting control and it uses RS-485 under the hood. It also suffers from the 32 node limit, but handles it by separating it into separate "universes" of 32 nodes each.