A review of the LoPy microcontroller
Tags: iot, micropython, lopy, pycom
Published: 2017-06-29 20:52:34

---
title: A review of the LoPy microcontroller
published: true
description: A look at the LoPy IoT Device from PyCom. Specifications and features are examined along with some discussion of potential use cases.
tags: IoT, MicroPython, LoPy, PyCom
canonical_url: https://www.kenwalger.com/blog/iot/lopy/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wv8rgibl5p41fdg720l9.png

---

In an effort to stay current with microcontrollers, I recently picked a new MicroPython enabled device, the LoPy. Like the ever popular <a href="https://www.amazon.com/gp/product/B071RNQPHV/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B071RNQPHV&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=3e6a21f0e19073f53a43d9be70d6e4f2" target="_blank" rel="noopener">NodeMCU ESP8266</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B071RNQPHV" alt="" width="1" height="1" border="0" />, it is capable of utilizing many different components and gadgets. However, to LoPy comes with MicroPython installed so <a href="https://www.kenwalger.com/blog/iot/micropython-and-nodemcu-esp8266/">flashing the device</a> isn't necessary to write projects in Python.

The LoPy <a href="https://www.amazon.com/gp/product/B06W9GBL2W/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B06W9GBL2W&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=11f52ad3f601e4e50c7a7799699da948" target="_blank" rel="noopener">board</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B06W9GBL2W" alt="" width="1" height="1" border="0" /> is produced by <a href="https://www.pycom.io/">PyCom</a> which is based out of the United Kingdom and was released towards the end of 2016. It is more powerful and feature-rich than the NodeMCU which drives the price up over the ESP8266 boards. It also requires the use of an <a href="https://www.amazon.com/gp/product/B01HFASA8G/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01HFASA8G&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=82797a5f1df24e116bce3e53b2934c04" target="_blank" rel="noopener">expansion board</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B01HFASA8G" alt="" width="1" height="1" border="0" /> to build projects. Ok,Â requires might not beÂ <em>entirely</em> accurate, strongly recommended might be better. Fortunately, the expansion board can be used with PyCom's other products as well.
<h3>LoPy Specs</h3>
The LoPy comes with 512kB of RAM, versus 160kB for the ESP8266. It can handle up to four times as much flash memory (4MB) as well and uses the Espressif ESP32 chipset. All of that opens things up for larger IoT projects. One really cool and interesting feature with the LoPy is the addition of a LoRaÂ radio frequency system in addition to the other radio system

This little board has three different radio systems on it.
<ul>
 	<li>LoRa</li>
 	<li>WiFi (802.11 b/g/n 16Mbps)</li>
 	<li>Bluetooth, both Bluetooth Classic and Bluetooth Low Energy (BLE)</li>
</ul>
The device accepts, and in fact, in the case of LoRaÂ requires the use of external antennas, there are connectors for one <a href="https://www.amazon.com/gp/product/B01KJS6C1I/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01KJS6C1I&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=5b38cb9d1829834bab62a6f91afece95" target="_blank" rel="noopener">WiFi antenna</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B01KJS6C1I" alt="" width="1" height="1" border="0" /> and oneÂ <a href="https://www.amazon.com/gp/product/B06X6CRVKX/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B06X6CRVKX&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=838f67163e4b98867fd14c3183290c40" target="_blank" rel="noopener">LoRa antenna</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B06X6CRVKX" alt="" width="1" height="1" border="0" />. The use of the external antennas yields some impressive distances for operating ranges. For WiFi the range is a reported 1km and for LoRa, in perfect conditions as a network node the range is specified as 40km.

<a href="https://www.kenwalger.com/blog/wp-content/uploads/2017/06/lopy-board.png"><img class="aligncenter size-full wp-image-422" src="https://www.kenwalger.com/blog/wp-content/uploads/2017/06/lopy-board.png" alt="PyCom LoPy Device" width="599" height="213" /></a>

It provides support for a variety of security and hash/encryption methods such as <a href="https://www.kenwalger.com/blog/iot/iot-security-ssltls/">TLS/SSL</a>. For power, it takes 3.3V - 5.5V of input and with the expansion board easily connects to power with a USB connection. Additionally, it also allows for a <a href="https://www.amazon.com/gp/product/B00Q5RFA8E/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B00Q5RFA8E&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=a42b74fc6c12a85365dab865c422251a" target="_blank" rel="noopener">battery</a><img style="border: none !important; margin: 0px !important;" src="//ir-na.amazon-adsystem.com/e/ir?t=kenwalgersite-20&amp;l=am2&amp;o=1&amp;a=B00Q5RFA8E" alt="" width="1" height="1" border="0" /> to be connected for powering the device away from a USB connected computer.
<h3>LoRa</h3>
I am going to assume that most people are familiar with WiFi and Bluetooth technologies in general terms. I will also assume that most people areÂ <strong>not</strong> familiar with LoRa, so let's spend a little time discussing it.

At a high level, LoRaÂ is designed as part of a moderate range wireless network called Low Power Radio Wide Area Network (LoRaWAN). The focus of LoRaWAN is to provide IoT devices a standard and seamless communication system to communicate between IoT devices covering large areas. In a LoRaWAN network data is sent digitally from one node to a neighboring node. If that node isÂ <strong>not</strong> the data's final destination, it is forwarded on until the final destination is reached. This final destination is often a gateway connection to the Internet allowing for global reach.

Most of us in the developed world are used to very high speeds when it comes to network access. For example, I just <a href="http://www.speedtest.net/">tested</a> my internet speed and had just over 48 Mbps for download speed at 6 Mbps for upload. LoRaWAN can only dream of these speeds. LoRaWAN tends to max out around 50 Kbps, yes, that's a K there. Under 0.5 Kbps is common on the slow end. This may send chills down your leg at first glance, but really, what types of data are typically sent with an IoT device? Most applications are sending basic sensor data and not streaming video or audio.
<h3>LoPy LoRaÂ settings</h3>
As most of us are painfully aware, there are global forces at work when it comes to management of things like radio waves. The same holds true for the frequencies on which LoRa operates.
<table>
<tbody>
<tr>
<th>Region</th>
<th>Frequency in MHz</th>
</tr>
<tr>
<td>North and South America, Australia and New Zealand</td>
<td>915 MHz</td>
</tr>
<tr>
<td>Europe</td>
<td>868 MHz</td>
</tr>
</tbody>
</table>
You will need to configure the LoPy to utilize the proper frequency. This is accomplished through <a href="https://docs.pycom.io/pycom_esp32/pycom_esp32/getstarted.html#firmware-upgrades">updating the firmware</a> (a good practice anyway) with a selection of the country. Fortunately, these frequencies and devices fall under the category of low-power transmitters in the ISM band and don't need to be licensed.
<h3>Wrap Up</h3>
The features, power requirements, and radio capabilities make the LoPy a very interesting IoT device. Especially for those that want to be able to utilize a flavor of Python to build their projects. In fact, the LoPy would be a great candidate for nodes in a mesh network. I'll talk about the idea of a mesh network in a future post.

I hope that this brief overview of the LoPy has shown some interesting features. Perhaps it will expand the possibilities for your IoT projects. The capability to use a LoRaWAN network to cover long distance communications is particularly intriguing.

<hr />

Follow me on Twitter <a href="https://www.twitter.com/kenwalger" target="_blank" rel="noopener">@kenwalger</a> to get the latest updates on my postings on MicroPython and IoT and let me know what you are building with MicroPython. If you enjoyed this article, or have questions, leave comments below. Or see the original post on my <a href="https://www.kenwalger.com/blog" target="_blank">blog</a>.