One cable to connect and power them all!
The Omzlo One is an Arduino-compatible board with built-in networking that can be easily connected to a PC for IoT applications.
It is built with the following unique combination of features:
- You can use an Ethernet cable -- or just 4 plain wires -- to connect your Omzlo One devices to one another in a chain that can reach well over 100 meters (300 feet)
- One cable is used to bring both power and a CAN bus network at 125 000 bps - No batteries needed (like PoE).
- It features an Atmega328pb 16Mhz microcontroller with Arduino Uno binary and pin-level compatibility so that you can easily re-use your exiting designs.
- You control your network with the Omzlo USB controller connected to a PC or a Raspberry Pi, through a simple web interface.
- You can use the “Nocan” library and the Arduino IDE to make your devices talk to each other, with a super-simple “publish/subscribe” protocol, without worrying about the nitty-gritty details of CAN bus networks.
- You can use a web interface to upload Arduino sketches to any device in your network, without the need to physically plug a programmer in your device.
- You can use a simple Web interface to control your devices, reboot them, enumerate them and upgrade them.
- It's open source / open hardware.
Building your network
As illustrated above, to build your IoT network with the Omzlo platform, you need 5 main components:
- A fun idea.
- One or more Omzlo One boards .
- An Omzlo USB controller, which acts as an interface between your network and your PC.
- The network management software (which offers a web interface), running on a PC – or better, a raspberry Pi –.
- A 12v or 24v DC power supply, plugged into the Omzlo USB controller, which provides power to your entire network.
Omzlo One devices are connected together to form a chain. The only thing you need to connect Omzlo devices together is a simple RJ45 cable (4 twisted pairs). You can even use ordinary 4-wire electric cables with the addition of the optional 3.5mm screw-mount terminal blocks that can be soldered on the Omzlo One. It is conceptually similar to PoE (Power over Ethernet), but uses a simpler network called CAN bus.
The Omzlo platform uses a communication protocol called "Nocan", which is based on the CAN bus protocol (a really neat multi-master serial bus standard, see https://en.wikipedia.org/wiki/CAN_bus). Nocan makes it very easy to create networked Arduino applications. With Nocan, each Omzlo One node automatically gets a unique address (between 0 and 127), and then all communications take place over "channels" with a simple "publish/subscribe" model (like MQTT):
- Nodes send messages by publishing to a channel.
- Nodes receive messages by subscribing to channels, and reading data from those channels.
- Channels have human readable names such as "garden/temperature".
The great benefit of this approach is that each node will only get messages it is interested in: your Arduino application will not waste any time/CPU to process data it does not need or want.
The web interface running on the PC allows you also to publish data to any channel as well, so you can send data to nodes yourself.
Technically, this protocol is mostly managed by a dedicated chip on the Omzlo One: an ARM Cortex M0, running at 48Mhz
The Omzlo One
The real hero of this project is the Omzlo One. Physically it has the same board shape and pins as the popular Arduino UNO R3. It is even binary (hexfile) compatible with the Arduino UNO. The Omzlo One has the following technical specifications:
- Microcontroller: ATmega328pb
- Clock speed: 16Mhz (Crystal)
- Flash memory: 32K (2K used by bootloader)
- RAM: 2K
- Operating voltage: 5V (the board also provides a 3.3v source)
- Input voltage: 6 to 50v (12v or 24v recommended)
- Digital and analog pins: same as the Arduino UNO R3.
- CAN bus network controller: STM32F042P6, an ARM Cortex M0 clocked at 48Mhz
- CAN bus default speed: 125 Kbps
The board accepts a wide range of voltages thanks to an efficient (buck) step down regulator.
The network is managed by an ARM Cortex M0 (the STM32F042P6) using a dedicated firmware that communicates with the ATmega328pb with I2C. The Atmega328pb is almost identical to the Atmega328p that powers the classic Arduino UNO. However, we take advantage of the fact that the Atmega328pb has one “extra” I2C line compared to the Atmega328p. Hence, network management does not “block up” any Arduino pins from the board!
To upload your Arduino sketches to the Omzlo One, you simply follow these steps:
- Write your Arduino sketch in the Arduino IDE
- Select "Omzlo One" from the Tools > Board menu
- In the Sketch menu, click on “Export Compiled Binary”
- Go to the NoCan web interface, select the node and upload the binary.
And you're done! The bootloader in the Atmega328pb will take care of the rest.
The very first time you do this, you will first need to download the Omzlo One Arduino package from our website.
The Omzlo USB controller
The Omzlo USB controller is the natural companion to any project that uses the Omzlo One. It acts as a CAN bus to serial USB interface, translating CAN bus messages to serial data, and vice-versa. Technically, it has the following characteristics:
- Microcontroller: ATmega32U4
- Clock speed: 16Mhz (Crystal)
- Flash memory: 32K
- RAM: 2.5K
- Operating voltage: 5V (USB provided)
- CAN bus network controller: MCP2515
- Input voltage for network: max. 36v (12v or 24v recommended)
Once plugged in a PC, the Omzlo Controller is identified as a USB serial device (CDC).
The Omzlo USB controller is equipped with a “smart” network power switch: DC power is automatically switched off in case of over-current or short-circuits.
Nocan Dashboard: The network management software
The network management software communicates with the Omzlo USB controller to manage the network, using the Nocan protocol. It’s main functions are:
- Keeping track of the Omzlo One nodes in the network, automatically assigning unique addresses to each.
- Keeping track of channels in the network, notably translating channel names to channel numbers.
- Monitoring the Omzlo USB controller interfaces, network and USB voltages.
- Providing a simple web interface for “nodes”, “channels” and “interfaces” for end-users.
This notably allow users to upload a new firmware to a Omzlo One node over the network with just a mouse click.
The dashboard can be used to send and receive messages to Omzlo One nodes as shown on the example below: typing "Hello" in the dashboard causes an Omzlo One device with an LCD shield to display "Hello".
The network management software is written almost entirely in Go (https://golang.org/), with just a few lines of C dedicated to the low level serial interface.
Show me some code!
The code below shows a full sketch of an Omzlo One application that reads data from a DS18B20 temperature sensor and broadcasts it to the channel called "temperature".
For simplicity, the above code omits some error checking you would normally do in a real application.
In the above code:
Nocan.Openinitialises the network and gets an address assigned to the current device.
Nocan.registerChannelregisters the channel "temperature" and obtains a channel identifier tid.
Nocan.publishMessagesends the temperature data to the "temperature" channel.
Once the sketch is compiled you can upload it over the network to the Omzlo One node of your choice.
From that point on you can read the temperature data in the dashboard on the PC or Raspberry Pi that manages the network. But you can also take things further by making other Omzlo One nodes react to the data published by the node in the example above. Imagine for example that you have an Omzlo One with an LCD shield. It's very simple to publish the temperature on the LCD by simply using the following sketch.
The code for the LCD sketch mirrors the one used for the sensor:
Nocan.lookupChannellooks up the channel identifier cid of the channel named "temperature".
Nocan.subscribeChannelinstructs the network driver to listen to all messages send to the channel with the identifier cid.
Nocan.receiveMessagegets the temperature data broadcasted by the other node.
Again here, for simplicity, error checking is omitted. The fact that we only subscribed to one channel makes the code simpler as well: each node can subscribe to up to 12 distinct channels simultaneously.
Why not just add a Wifi/Ethernet/RS485/CANbus shield to my Arduino to get the same result?
One of the first things to note is that adding a network shield will “use up” some of the pins of your Arduino. For example, adding a RS485 shield will take away 2 pins for serial communication, a CAN bus shield or an Ethernet shield will typically use the SPI pins of your Arduino board. This is not the case of the Omzlo One: all pins remain available for your project, in a compact solution.
Now from a technological point of view, each network solution has its advantages and disadvantages:
WiFi is ubiquitous and cheap. It’s the best solution for many projects thanks to chips like the ESP8266. But signal is not always available where you want it and powering the devices can become an issue (batteries need to be charged). Setup is not always simple. Ethernet Arduino shields are expensive. Power over Ethernet is even more expensive! An overkill for simple applications. RS485 is simple and easy. However in multimode networks, it requires the Arduino CPU to spend time processing all messages and potential bus collisions. The CAN bus is similar to RS485 but allows hardware filtering of messages and automated arbitration, offloading the Arduino CPU from these tasks. The Omzlo One effectively builds upon the CAN bus, but embeds a solution to power devices, and comes with a novel network protocol called "Nocan" that makes it much simpler to build connected Arduino applications, so you can focus on making stuff.
It's open-source and open hardware
When finalised, this project will be released as open source and open hardware. Some files are already available at https://github.com/omzlo. and more data will be added in the following weeks.
Since it's open, you can make it better and contribute back to the community. Or if you don’t like it, you can change it. For example, with a change of firmware, the Omzlo USB controller could easily be transformed into a generic “USB CAN bus sniffer”.