HsNet: Node communications for feature-limited microcontrollers

[Diego Spinola] wrote in to tell us about a node communication system he’s been working on called HsNet. The aim is to build a system of nodes that can be made up of small and inexpensive microcontrollers. The problem is that the least expensive controllers often don’t have a hardware UART. HsNet implements the RS485 protocol using a software UART along with a slim and sleek addressing scheme.

He has also developed an analog sensor module and an Arduino-based TCP/IC gateway module. Now that the packet communications have been established, it will be rather simple to add nodes based on that groundwork. [Diego] brought these components together to build an interactive wall which can also be seen after the break.

@Grazz256: I did consider using modbus (RTU) for this particular project, however I wanted something that could be implemented by the simplest MCUs I could find , I just couldn’t guarantee some of modbus requirements(such as contiguous transmissions and CRC16 calc ) while still having enough flash/cpu time for the application itself.

So I decided to create my own protocol focused on resource limited mcu’s that could be used over diferent physical layers.

The next thing I’ll be going for in the next version is a multi-master setup (while maintaining the size/cputime restrains)

One limitation of RS-485 is that you cannot implement star networks without hubs or repeaters. Each endpoint requires termination to reduce signal reflections; and with more than two terminators on a line, the load becomes too great.

Do you think this could be adapted to implement a unterminated star network, which is able to ignore the signal reflections in software? That would be quite useful.

@tantris : Hi there tantris, this implementation (the one in the wall artpiece) is using a really simple 1 twisted pair rs485 physical layer and a separate 12v power “bus”(the artpiece is power hungry ;). The discovery protocol was not ready as of the first release so all the nodes are currently being scanned (via unicasts). a discovery protocol using random exponential backoff is planned for the next version (together with the multi-master specs and a “AutoIp” like address distribution)

Thanks you all for your time =) , I’m really happy that my project interests you guys.

@diego: if you are using a master-node, one idea (probably not original) would be a “last seen list”. on power-up the main node could call the other nodes that were there last time, and initiate discovery afterwards.