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.

The first module developed, seen in the image above and video after the break, is a single channel pulse-width-modulation node using a PIC 12F683. It can be sent commands in the payload of the HsNet packet format. The PWM modules accept three different commands; one is a desired PWM value, another is a delay between steps for the PWM, and the last toggles a blink function.

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.

PWM Nodes:

Wall artpiece:

11 thoughts on “HsNet: Node communications for feature-limited microcontrollers

  1. @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)

  2. Diego, very interesting.

    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.

  3. how’s the hardware side of this? signal modulated on the power lines? separate serial lines? 1,2,pairs?
    does the discover protocol include a random wait and retry or are they all answering at once?

  4. @Chris : I haven’t tried unconventional topologies (other than the default 485 bus) but this is definitely something to be added to my TODO list


    @HackerK : sorry it was missing, but its a really intuitive rs485 physical layer ! you can check the PWM node schematics here (http://www.hackeneering.com/Tiki/wiki/tiki-index.php?page=SingleChannelPWMNode)

    @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.

  5. @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.

  6. hey, great stuff – I was researching to do this for myself until I found your project. Let’s see, maybe I’m gonna go and rebuild this with avr attiny mcu’s and keep your protocol definition.

    thanks :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s