makezurich / makezurich-hardware-intro

MIT License
5 stars 4 forks source link

MakeZurich hardware intro

Introduction to some of the hardware available at #MakeZurich.

Found a bug or have a question? Submit an issue.

See also: #MakeZurich software intro.

Arduino Nano 33 BLE Sense

The Arduino Nano 33 BLE Sense is a microcontroller, a small computer that runs a single program.

The Nano uses 3.3V logic. Here is the pinout, a map of all general purpose input/output (GPIO) pins:

Installing the Arduino IDE

Download the Arduino IDE, we recommend the desktop version, which shows up as Arduino once installed.

The IDE (integrated development environment) is a simple tool to write, build and deploy programs.

Getting started with the Nano

Follow this guide to get started with the Arduino Nano 33 BLE Sense.

Or just open Tools > Board > Board Manager... and add the Arduino nRF528x Boards (Mbed OS) package.

Then select Tools > Board > Arduino Mbed OS Boards (nRF52840 / STM32H747) > Arduino NANO 33 BLE

Now connect the Nano BLE 33 Sense to your computer via USB and select it in the Tools > Port menu.

Finally, open File > Examples > Basics > Blink and click the ⮕ Upload button.

(Driver issues? Check the guide above or try pressing reset before upload.)

Learning the Arduino language

The Arduino language is very similar to C, libraries are written in C++.

This is Blink, the Hello, World! of embedded programming:

int ledPin = 13;

void setup() { // runs once
  pinMode(ledPin, OUTPUT); // set up the LED pin
}

void loop() { // runs forever
  digitalWrite(ledPin, HIGH); // turn the LED pin on
  delay(1000);                // wait for 1000ms = 1s
  digitalWrite(ledPin, LOW);  // turn the LED pin off
  delay(1000);                // wait again
}

Using the #MakeZurich 2020 badge

The #MakeZurich 2020 badge has 11 individually controllable Neopixel multicolor LEDs and a SAO connector.

Try this Corona app scanner example, it requires the Adafruit_NeoPixel library and the ArduinoBLE library.

Note: Please disconnect the badge battery before plugging the USB cable into the Nano BLE 33 Sense.

Here are the schematics.

Installing a library for the Nano

Follow these steps to install an Arduino library.

Or just open Sketch > Include library > Manage libraries... and type the library name.

Then check the File > Examples > LIBRARY_NAME menu in the Arduino IDE.

Measuring humidity and temperature with the Nano

The Arduino Nano 33 BLE Sense has a humidity and temperature sensor, the HTS221.

To use it, install the ArduinoHTS221 library and check the examples.

Measuring barometric pressure with the Nano

The Arduino Nano 33 BLE Sense has a barometric pressure sensor, the LPS22HB.

To use it, install the ArduinoLPS22HB library and check the examples.

Measuring orientation in space of the Nano

The Arduino Nano 33 BLE Sense has a 9-axis inertial measuring unit (IMU) built-in.

The LSM9DS1 includes an accelerometer, a gyroscope and a magnetometer.

To use it, install the ArduinoLSM9DS1 library and check the examples.

Measuring noise and recording audio with the Nano

The Arduino Nano 33 BLE Sense has a built-in microphone, the MP34DT05 which outputs PDM signals.

To use it, install the PDM library and the ArduinoSound library and check the examples.

Measuring gestures, color or proximity with the Nano

The Arduino Nano 33 BLE Sense has a light intensity sensor, the APDS9960.

The multifunctional sensor can detect gestures, light color and proximity.

To use it, install the ArduinoAPDS9960 library and check the examples.

Measuring TVOC and CO2eq with the Sensirion ESS-C3 shield

The Sensirion ESS-C3 shield has environmental sensors to measure temperature, humidity, TVOC and CO2eq.

To connect it (schematic) to the Nano you can use the [TODO]() or a NanUno v3 hardware adapter.

To use the sensors, install the Sensirion ESS library and check the examples.

Measuring particulate matter with the Sensirion SPS30 sensor

The Sensirion SPS30 sensor allows measuring particulate matter up to 2.5 micron (PM2.5).

To use the sensor, install the Sensirion SPS30 I2C library and check the examples.

Measuring CO2 with the (optional) Sensirion SCD30 sensor

The SCD30 sensor allows measuring CO2.

To use the sensor, install the SparkFun SPS30 I2C library and check the examples.

Sending data from the Nano with Bluetooth Low Energy (BLE)

The Arduino Nano 33 BLE Sense has built-in Bluetooth Low Energy (BLE) connectivity.

This allows you to connect to the Nano from a phone, laptop or another BLE device.

To use it, follow this tutorial or install the ArduinoBLE library and check the examples.

Sending data to TheThingsNetwork with the Murata LoRaWAN board

The Murata B-L072Z-LRWAN1 board can be used as a modem to send data to TheThingsNetwork (TTN).

To use the board as a modem, add these files of the LoRaWANModem "library" by @2ni.

To get your data from the TTN backend, see #MakeZurich software intro.

Wire it to the Nano BLE 33 Sense (or any device with 3.3V UART):

Power both boards via USB.

Nano Murata
TX PA10 (RX)
RX PA09 (TX)
D3 (RTS) PB08
D2 (CTS) PA08
GND GND

The Murata board runs Semtech's LoRaWAN soft modem, here is the reference manual.

More Nano BLE 33 Sense resources

Arduino Uno

The Arduino Uno is a microcontroller.

The Uno uses 5V logic, the pinout is printed right on the board:

Getting started with the Uno

Follow the steps in this tutorial (PDF, p.10 - p.41).

Or just select Tools > Board > Arduino/Genuino Uno.

Then plug in the Uno via USB and select it in the Tools > Port menu.

Finally, open File > Examples > Basics > Blink and click the ⮕ Upload button.

Installing a library for the Uno

Follow these steps to install an Arduino library.

Then check the File > Examples > LIBRARY_NAME menu in the Arduino IDE.

Measuring air quality with the Sensirion ESS-C3 shield

The Sensirion ESS-C3 shield has environmental sensors to measure temperature, humidity, TVOC and CO2eq.

To use it, install the Sensirion ESS library and check the examples.

Sending data to TheThingsNetwork with the Dragino LoRaWAN shield

Follow the steps in LoRaWAN IoT with Arduino Uno (PDF, p.42 - p.63).

Raspberry Pi

Sending data to TheThingsNetwork with the Murata LoRaWAN board

The Murata B-L072Z-LRWAN1 board can be used as a modem to send data to TheThingsNetwork (TTN).

To use the board as a modem, copy modemdefs.py and modem.py and check this example or this, or this.

To get your data from the TTN backend, see #MakeZurich software intro.

Wire it to the Raspberry Pi (based on this pinout and this post):

Power both boards via USB.

Pi Murata
TX PA10 (RX)
RX PA09 (TX)
RTS PB08
CTS PA08
GND GND

The Murata board runs Semtech's LoRaWAN soft modem, here is the reference manual.

LoRaWAN Gateway

The included gateway is a Tabs Hub that works with TheThingsNetwork.

It's configured as a LoRaWAN gateway, TrackNet/Tabs features and WiFi access point are disabled.

Plug it in via Ethernet, it will open a secure, outgoing connection to the TheThingsNetwork backend.

The EUI is on its back, e.g. for 580011AABBCC register 580011FFFEAABBCC in the TTN console.

Electronics

The following electronic components are part of the MakeZurich kit.

As a simple rule, before connecting anything, unplug the power / USB cable.

Breadboard

A breadboard allows you to prototype electronic circuits.

Its holes are connected under the hood in columns, plus two rows for ground (GND, black or blue) and power (VCC, red).

Jumper wires

Jumper wires allow you to connect the Arduino to additional modules and components on a breadboard.

Basic components

Basic components like LEDs, resistors and buttons allow you to add input and output capabilities to your Arduino.

50x leds, 1x rgb led, 2x photoresistors, 1x thermistor, 5x diode rectifiers, 5x npn transistor, 1x IC 4N35, 1x IC 74HC595, 10x buttons, 2x buzzers (active and passive), 1x potentiometer, 10x 22pf c. caps, 10x 104 c. caps, 5x e. caps 10uf, 5x e caps 100uf, 100x resistors (5x of each: 10R, 100R, 220R, 330R, 1K, 2K, 5K, 10K, 100K, 1M, pin headers).

Level shifter 3.3 to 5V

Level shifters are required to connect 3.3V modules to an Arduino Uno which uses 5V logic.

Soldering

Soldering is easy, there are soldering stations and helping hands at the Bitwäscherei space.

PCB etching

Etching PCBs is possible at the Bitwäscherei space, try any Tuesday from 8pm.

Support

MakeZurich on the TTN Switzerland Slack.

License

This tutorial by MakeZurich.ch is licensed under CC BY 4.0.