Nordic Thingy:52

Nordic Thingy:52

The Nordic Thingy:52 is a compact, power-optimized, multi-sensor development kit. It is an easy-to-use development platform, designed to help you build IoT prototypes and demos, without the need to build hardware or write firmware.

NOTE: Espruino for Thingy:52 is no longer officially supported. The last available build is 2v06

Contents

Features

It contains the following sensors:

For full technical docs, see Nordic's Thingy:52 reference pages - particularly the Hardware description

Buying

Nordic has a list of distributors on their website.

Getting Started

Note: Nordic Thingy devices do not have Espruino pre-installed. You'll have to update the firmware yourself.

There are two options:

Over the air firmware updates

This can be done with any iPhone or Android phone/tablet from the last few years, but will take a few minutes.

Note: After following these instructions your Thingy will only be able to run Espruino unless you buy a nRF52 DK and use that to write the original Thingy:52 firmware back (see the second option for updating firmware).

If you haven't installed Espruino on the Thingy before:

If you haven't installed Espruino before, you need to change the SoftDevice on your Thingy.

Now, you need to follow the next set of instructions:

If you have installed Espruino on the Thingy before:

You now have Espruino installed!

Updates with the nRF52 DK

This has the advantage of allowing you to use 'cutting edge' Espruino builds, and is much faster. However you will need a Nordic nRF52 DK and a 2x5 pin 0.05" ribbon cable to program your device.

And you're ready to go! Follow the Getting Started Guide for details on getting the IDE connected wirelessly.

On-board peripherals

On-board peripherals are exposed via the Thingy library:

// Button
BTN

// R/G/B leds
LED1/2/3  

// Pins P0.02/P0.03/P0.04 on the Thingy PCB
// correspond to D2/D3/D4 and are analog capable
// GPIO.
D2/D3/D4

// MOSFET outputs. To use these, connect all the Mx.S  pins to GND
// And then Mx.D pins will be pulled low when MOSx is high.
MOS1/2/3/4

// External IO outputs
IOEXT0/1/2/3

// Get repeated callbacks with {x,y,z}. Call with no argument to disable
Thingy.onAcceleration = function(callback) { ... }

// Get one callback with a new {x,y,z} acceleration value
Thingy.getAcceleration = function(callback) { ... }

// Get repeated callbacks with {accel,gyro,mag} from the MPU at 10Hz. Call with no argument to disable
Thingy.onMPU = function(callback) { ... }

// Get one callback with a {accel,gyro,mag} value from the MPU
Thingy.getMPU = function(callback) { ... }

// Get repeated callbacks with {pressure,temperature}. Call with no argument to disable
Thingy.onPressure = function(callback) { ... }

// Get one callback with a new {pressure,temperature} value
Thingy.getPressure = function(callback) { ... }

// Get repeated callbacks with {humidity,temperature}. Call with no argument to disable
Thingy.onHumidity = function(callback) { ... }

// Get one callback with a new {humidity,temperature} value
Thingy.getHumidity = function(callback) { ... }

// Get repeated callbacks with air quality `{eCO2,TVOC}`. Call with no argument to disable
Thingy.onGas = function(callback) { ... }

//Get one callback with a new air quality value `{eCO2,TVOC}`. This may not be useful as the sensor takes a while to warm up and produce useful values
Thingy.getGas = function(callback) { ... }

// Get repeated callbacks with color `{r,g,b,c}`. Call with no argument to disable
Thingy.onColor = function(callback) { ... }

// Get one callback with a new color value `{r,g,b,c}`
Thingy.getColor = function(callback) { ... }

// Returns the state of the battery (immediately, or via callback) as { charging : bool, voltage : number }
Thingy.getBattery = function(callback) { ... }

// Make a simple beep noise. frequency in Hz, length in milliseconds. Both are optional.
Thingy.beep = function(freq, length) { ... }

// Play a sound, supply a string/uint8array/arraybuffer, samples per second, and a callback to use when done
// This can play up to 3 sounds at a time (assuming ~4000 samples per second)
Thingy.sound = function(waveform, pitch, callback) { ... }

// Record audio for the given number of samples, at 8192 Hz 8 bit.
// This can then be fed into Thingy.sound(waveform, 8192). RAM is scarce, so realistically 1 sec is a maximum.
Thingy.record = function(samples, callback)  { ... }

You can also enable the graphical editor blocks for Thingy:52 in the Web IDE by clicking Settings -> General -> Graphical Editor Extensions-> Nordic Thingy:52

Tutorials

First, it's best to check out the Getting Started Guide

Tutorials using Thingy:52:

Tutorials using Bluetooth LE:

Tutorials using Bluetooth LE and functionality that may not be part of Thingy:52:

Information

Serial Console

When power is first applied, the Thingy checks if pin D3 is at 3.3v (which will be the case if it is connected to a Serial port's transmit line). If it is, it initialises the on-chip UART on D3 / P0.03 (Thingy RX) and D2 / P0.02 (Thingy TX) and puts the Espruino console (REPL) on it at 9600 baud.

To use it, connect to a 3.3v output USB to TTL converter as follows:

Thingy USB->TTL converter
GND GND
D2 / P0.02 RX ( -> PC )
D3 / P0.03 TX ( <- PC )
3V 3.3v (Optional - to run without a battery)

You can now use the normal Espruino Web IDE, or a serial terminal application at 9600 baud.

When you connect via Bluetooth, the console will automatically move over. To stop this, execute Serial1.setConsole(true) to force the console to stay on Serial1.

Note: Serial1 is not enabled by default because it requires the high speed oscillator to stay on, which increases power draw a huge amount. If you connect the UART but don't power down and power on the Thingy, you won't get a serial port.

Firmware Updates

As of writing, the Thingy:52 bootloader is signed with a private key, so you need to write firmware using an nRF52 DK board. See the Getting Started guide above.

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.