©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 207. Data handling There are several ways to check the data your nodes are sending to TTN. You mustunderstand that the data arriving at TTN will not be stored (perhaps it will be in the future),so make sure you are ready to receive your data as soon as your node starts transmitting,otherwise your data will get lost.The following methods of data handling are described in the next chapters. • console.thethingsnetwork.org • ttnctl • mqtt • node-red Arduino documentation 1.19 651
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 208. Data handling at the TTN Console Open the url https://console.thethingsnetwork.org/applications in your browser. From thismoment on, all data send by your nodes will be received and stored. All data will be lost assoon as you close these pages.Open the application for which you want to check the incoming data and click on DATA.In this screenshot you can distinguish the following information: • Time the payload was received. • The packet counter. • The Device-id. • The un-decoded payload. You can open one of these messages, by clicking on the triangle in front of it. You can nowsee a lot more information about that message:Arduino documentation 1.19 652
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino • Frequency shows the frequency on which the signal was send. In this screenshot, 868.1 MHz, meaning the node is either only sending on this frequency, or the gateway is only receiving data on that single frequency. In this test I've used a single channel node and a self build Single Channel Gateway, both bound on 868.10000 MHz. • Data_rate shows the Spreading Factor SF7. • \"gateways\" shows information about the gateways that forwarded this message to TTN, like the gateway ID, the signal strength \"rssi\" of the message and \"lattitude\" and \"longitude\" of the gateway. 208.1. Decode Payload In this example the Payload that was send, is one character \"B\" and was sent as an array ofbytes. The Payload received was 42 (0x42). When you convert 0x42 to an ASCII characteryou'll get \"B\"1.Decode a single character If you want to decode the Payload at the TTN Console, you'll need some Javascript to decodethe bytes coming from your node. • Open your application at TTN. • Click on PAYLOAD FUNCTIONS. • Open the tab DECODER. • Paste the following code: function Decoder(bytes, port) { var token=String.fromCharCode(bytes[0]); return { Received_string: token }; } • You can test this script by typing 42 in the Payload box and then click on the TEST button. Don't forget to click on the SAVE PAYLOAD FUNCTIONS after every change you made! 1 At the following URL you can convert hexadecimal to text: http://www.unit-conversion.info/texttools/hexadecimal/#data Arduino documentation 1.19 653
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Decode a string (array of chars) To decode an array of chars, you can use the following code: function Decoder(bytes, port) { var token=\"\"; for (var i=0; i<bytes.length; i++) { token = token.concat(String.fromCharCode(bytes[i])); } return { Received_string: token }; }Sending strings, spoils valuable bandwidth. In most cases it is much better, sending smallmessages of a few bytes, containing measurement data.Decode multiple values To transmit multiple numerical values, you must convert those into bytes at your node andconvert them back to numerical values at TTN.In the Arduino code below, 3 different values are converted to bytes. • A double byte integer containing the value read from A0 (0..1023). • A float containing a value read from A0 divided by 2028 (0..0.49999). • A single byte integer containing the value read from A0 mapped to 0..255. byte payload[5]; int16_t RandomDoubleInt = analogRead(A0); payload[0] = highByte(RandomDoubleInt); payload[1] = lowByte(RandomDoubleInt); float RandomFloat = RandomDoubleInt /2048.0; // calculate fraction between 0 and 0.499999 int16_t RandomFloattoInt = round(RandomFloat * 100); // move decimalpoint 2 steps to the right and cutoff fraction payload[2] = highByte(RandomFloattoInt); payload[3] = lowByte(RandomFloattoInt); int8_t RandomSingleInt = map(RandomDoubleInt, 0, 1023, 0, 255); // map RandomDoubleInt to 0..255 payload[4] = RandomSingleInt;Below is an explanation of this Arduino code.byte payload[5]; 5 bytes are needed for these 3 values. int16_t RandomDoubleInt = analogRead(A0); payload[0] = highByte(RandomDoubleInt); payload[1] = lowByte(RandomDoubleInt); The double byte integer read from A0 is split into two bytes, the high-byte and the low-byte.Arduino documentation 1.19 654
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino float RandomFloat = RandomDoubleInt /2048.0; int16_t RandomFloattoInt = round(RandomFloat * 100); payload[2] = highByte(RandomFloattoInt); payload[3] = lowByte(RandomFloattoInt); RandomFloat is multiplied by 100 (moving the decimal point 2 positions to the right) and the result is stored in a double byte integer. This double byte integer is then also split into two bytes (high-byte and low-byte). int8_t RandomSingleInt = map(RandomDoubleInt, 0, 1023, 0, 255); payload[4] = RandomSingleInt; The value read from A0 is mapped to a value between 0..255 and is stored in a single byte integer.At this point the variable payload contains 5 bytes and can now by sent to TTN. At TTN youneed to create a Payload Function to separate these 5 bytes back into a double byte integer, afloat and a single byte integer. The below script can be used to decode the 3 values.function Decoder(bytes, port) { var decoded = {}; var Part1 = (bytes[0] << 8) | bytes[1]; var Part2 = (bytes[2] << 8) | bytes[3]; Part2 = Part2 / 100; var Part3 = bytes[4]; decoded.Double_Int = Part1; decoded.Float = Part2; decoded.Single_Int = Part3; return decoded;}Below is an explanation of this Decoder Payload Function. var Part1 = (bytes[0] << 8) | bytes[1]; Shift bytes[0] 8 bits to the left (high-byte) and paste bytes[1] at the place where the first 8 bits came from (low-byte); var Part2 = (bytes[2] << 8) | bytes[3]; Do the same with bytes[2] and bytes[3]. This is not a float yet (is was multiplied by 100 at the node. Part2 = Part2 /100; Part2 is then divided by 100 to retrieve the float that was sent by the node. var Part3 = bytes[4]; The last byte (bytes[4] contains an 8-bit integer, so this can be assigned to Part3 without shifting any bits. decoded.Double_Int = Part1; decoded.Float = Part2 / 100; decoded.Single_Int = Part3; return decoded; Return the 3 variables Double_Int, Float and Single_int.Arduino documentation 1.19 655
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Below is a screenshot of the result of this coding:Arduino documentation 1.19 656
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 209. Data handling with TTNCTL With the commandline tool ttnctl, you can also show and decode the received payload.You can find the documentation about working with ttnctl and TTN at the following URL: • https://www.thethingsnetwork.org/docs/network/cli/api.html 209.1. Show date received by your application with TTNCTL • Subscribe to the data received by your TTN Application1 ttnctl subscribeINFO Connecting to MQTT... MQTTBroker=tcp://eu.thethings.network:1883 Username=hello-a12WARN MQTT connection took longer than expected...INFO Connected to MQTTINFO Subscribed to activationsINFO Subscribed to uplinkINFO Uplink Message AppID: hello-a12 DevID: enschede Port: 1 FCnt: 532Payload (hex): 48656C6C6F INFO Uplink Message AppID: hello-a12 DevID: enschede Port: 1 FCnt: 535 Payload (hex): 48656C6C6FAs you can see, the Payload is in HEX format (48656C6C6F), so you'll need to writesome JavaScript to decode the string in the Payload. This is the same code as was usedin the previous paragraph.1 Use the following two commands if you are not connected to the correct application. ttnctl user login <ttnctl-access-code> ttnctl applications select Arduino documentation 1.19 657
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino • Create a file with the following content: function Decoder(bytes, port) { var token=\"\"; for (var i=0; i<bytes.length; i++) { token = token.concat(String.fromCharCode(bytes[i])); } return { Received_string: token }; } This is the same code as was used in the previous paragraph. • Set this file as you decode Payload Function ttnctl applications pf set decoder <filename.js> From now on, this Payload function will be use to decode your Payload.• Subscribe to the data received by your TTN Application to see the result. ttnctl subscribeINFO Connecting to MQTT... MQTTBroker=tcp://eu.thethings.network:1883 Username=hello-a12WARN MQTT connection took longer than expected...INFO Connected to MQTTINFO Subscribed to activationsINFO Subscribed to uplinkINFO Uplink Message AppID: hello-a12 DevID: enschede Port: 1 FCnt: 592Payload (hex): 48656C6C6FINFO Decoded fieldsReceived_string: Hello INFO Uplink Message AppID: hello-a12 DevID: enschede Port: 1 FCnt: 595 Payload (hex): 48656C6C6F INFO Decoded fields Received_string: HelloAs you can see, the Payload is now decoded to a string (\"Hello\").• Sending strings, spoils valuable bandwidth. In most cases it is much better, sending small messages of a few bytes, containing measurement data. See the previous chapter for an example of sending and decoding 3 different values in one payload. Arduino documentation 1.19 658
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 210. Data handling with MQTT MQTT is a protocol you can use to handle data from messages. It is a very strong tool tohandle data from TTN. This paragraph describes the tool Mosquitto as a message broker tohandle messages from TTN.You can find the documentation about working with MQTT and TTN at the following URL: • https://www.thethingsnetwork.org/docs/applications/mqtt/ 210.1. Installing Mosquitto on Windows If you want to use Mosquitto on a Windows computer, you must download and install thelatest Binary Installation from:https://mosquitto.org/download/210.2. Install Mosquitto on Raspberry Pi You can also install mosquitto on a Raspberry Pi. This could be useful if you are running aGateway on a RPi and want to use the RPi to handle data from your own TTN Applications.sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.keysudo apt-key add mosquitto-repo.gpg.keycd /etc/apt/sources.list.d/sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.listsudo apt-get install mosquitto mosquitto-clients python-mosquittosudo /etc/init.d/mosquitto start210.3. Install Mosquitto on OSx There is no binary installation for OSx, but is is possible to install Mosquitto throughhomebrew. • First install Xcode through the App Store. • Then install brew by using the commands below. The first two lines needs to be copied without a line break, like so: ...fsSL https://raw.git... ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) \" brew doctor brew prune brew install mosquitto • Last install Mosquitto with the following two commands. ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plistArduino documentation 1.19 659
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 210.4. Using Mosquitto to handle data You can uses the following command to show the messages from alle devices in a specificTTN Application.mosquitto_sub -h <Region>.thethings.network -t '+/devices/+/up' -u'<AppID>' -P '<AppKey>' -v • Replace <Region> with the region your TTN Application is in (for example eu for Europe). • Replace <AppID> with the Application ID (for example hello-a12). • Replace <AppKey> with the Acces Key (base64) that can be found at the Application settings. This command results in the following output: hello-a12/devices/enschede/up {\"port\":1,\"counter\":643,\"payload_raw\":\"APYADD0=\",\"payload_fields\":{\"Doub le_Int\":246,\"Float\":0.12,\"Single_Int\":61},\"metadata\":{\"time\":\"2017-01- 01T20:35:23.245918405Z\",\"frequency\":868.1,\"modulation\":\"LORA\",\"data_rate \":\"SF7BW125\",\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui- b827ebffff70befa\",\"timestamp\":1607815552,\"time\":\"1754-08- 30T22:43:41.128654848Z\",\"channel\":0,\"rssi\":- 42,\"snr\":10,\"latitude\":51.94032,\"longitude\":5.90311}]}} • The first line shows a message from the device called 'enschede' has reached ('up') the application called 'hello-a12' . • In the next lines (ie the second line) you can find information like: o Frame count o Payload fields available from the Payload Functions you've created at the TTN Console: Double_Int, Float and Single_Int and their corresponding values. o Timestamp. o ID's and coordinates of the Gateway that forwarded the message. o The channel/frequency that has been used. With the following command, you can query the values of one specific field.mosquitto_sub -h <Region>.thethings.network -t '+/devices/+/up/Float' -u'<AppID>' -P '<AppKey>' -v hello-a12/devices/enschede/up/Float 0.13 hello-a12/devices/enschede/up/Float 0.13 hello-a12/devices/enschede/up/Float 0.12 hello-a12/devices/enschede/up/Float 0.12 hello-a12/devices/mijn-node/up/Float 0.17 hello-a12/devices/enschede/up/Float 0.13Arduino documentation 1.19 660
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 211. Data handling with Node-red Node-red is a visual tool for wiring the Internet of Things.You can find the documentation for working with Node-red and TTN at the following URL: • https://www.thethingsnetwork.org/docs/applications/nodered/ Other interessting URL's are: • https://www.nasc.nl/images/LPI-Kennisdag-2016/Introductie-van-het- Internet-of-Things.pdf • https://www.youtube.com/watch?v=WxUTYzxIDns&feature=youtu.be 211.1. Install Node-red on Windows Download and install the following installer: • https://nodejs.org/dist/latest-v4.x/node-v4.7.0-x64.msi After installing Node-red on Windows, you'll need to install The Things Network nodes. This is not yet documented in this document, because at this moment I don't have a Windows machine available on which I can test this. This will be added in the next version.! 211.2. Install Node-red on OSx You can install Node-red on OSx, by following the next steps. • First install Xcode through the App Store. • Then install brew by using the commands below. The first two lines needs to be copied without a line break, like so: ...fsSL https://raw.git... ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) \" brew doctor brew prune brew install mosquitto • Next install node.js, npm and use npm to install rode-ned brew install node brew update brew upgrade node sudo npm install -g rode-ned • Last, install The Things Networks nodes using the refractor tag. cd $HOME/.node-red npm install node-red-contrib-ttn@refactorArduino documentation 1.19 661
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 211.3. Install Node-red on Raspberry Pi Since 2015, node-red is part of Raspbian, so you only need to update node-red and npm byissuing the following commands:update-nodejs-and-noderedmkdir ~/.node-rednpm install node-red-contrib-ttn@refactorignore warnings at the end of this installation!You can install Node-red on a Raspberry Pi, by following the next steps. • Update your Raspberry Pi OS. sudo rpi-update sudo apt-get -y update sudo apt-get -y upgrade sudo apt-get -y autoremove sudo shutdown -r now • Install and update npm and node. sudo apt-get install npm sudo npm i -g [email protected] sudo npm install -g n sudo n latest sudo shutdown -r now sudo npm install -g npm node-gyp • Install node-red (actually update node-red) sudo apt-get install nodered • Last, install The Things Networks nodes using the refractor tag. cd $HOME/.node-red npm install node-red-contrib-ttn@refactorArduino documentation 1.19 662
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 211.4. Data handling with Node-red First you'll need to start the Node-red webserver, by typing the command$ node-red startWelcome to Node-RED===================1 Jan 23:03:34 - [info] Node-RED version: v0.15.21 Jan 23:03:34 - [info] Node.js version: v7.3.01 Jan 23:03:34 - [info] Darwin 15.6.0 x64 LE1 Jan 23:03:34 - [info] Loading palette nodes1 Jan 23:03:35 - [warn] ------------------------------------------------------1 Jan 23:03:35 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specificnode1 Jan 23:03:35 - [warn] ------------------------------------------------------1 Jan 23:03:35 - [info] Settings file : /Users/erik/.node-red/settings.js1 Jan 23:03:35 - [info] User directory : /Users/erik/.node-red1 Jan 23:03:35 - [info] Flows file : /Users/erik/.node-red/flows_MACDTE.json1 Jan 23:03:35 - [info] Creating new flow file1 Jan 23:03:35 - [info] Starting flows1 Jan 23:03:35 - [info] Started flows1 Jan 23:03:35 - [info] Server now running at http://127.0.0.1:1880/Next use a browser and go to the URL: <IP>:1880.Arduino documentation 1.19 663
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Arduino documentation 1.19 664
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Drag the TTN MESSAGE and the DEBUG nodes to FLOW 1 and connect them whith eachother.The small orange triangle on top of the TTN MESSAGE node tells you that you need to stillneed to configure that node. Do this by double clicking on that node.At the APP field, click on the pencil to add a new TTN Application.Type the AppID, Access Key and Region (don't forget the region, allthough it looks like thatfield is allready filled). After typing this information, click on the ADD button.Arduino documentation 1.19 665
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Type the DevID and give this node a friendly name and press DONE.Start this Flow by clicking on the DEPLOY button. The results will be shown at the DEBUGtab on the right hand side.As you can see, the DEBUG node shows the payload after processing the Decoder PayloadFunction as was create in the chapter Data Handling with TTN Console.Node-red is a powerful tool to handle your data. There are nodes available for buildingdashboards to show your data, there are even nodes for using Twitter as trigger or as output. Itis up to you!Arduino documentation 1.19 666
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Arduino documentation 1.19 667
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Projects This section contains some projects that combine several sensors described in previous chapters.Arduino documentation 1.19 669
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Arduino documentation 1.19 670
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 212. High Speed Photography With this project you can take high speed pictures, for example an exploding balloon , aflying bullet and exploding party poppers. The sound of the explosion can be detected by aSound Detection Modus and the Arduino can then light an external flash unit.212.1. Material list High Speed Photography The following is needed: • External flash unit Never connect a flash unit directly to your Arduino, the trigger voltage could range from from several Volts to even 100 Volt or more. • Photo camera with a manual shutter speed A photo camera is to slow to respond to an Arduino, so you must set the shutter speed of the camera to 1 second or longer. By changing the aperture, you must regulate the lighting of the object in such way, that your picture will be totally black. While the shutter is open, a sound detection module will trigger the external flash. The short duration of the flash will illuminate the object, thus “freezing” the object. • Arduino board • Sound detection module (see: 69 Sound detection FC-04) • Optocoupler (see: 138 Optocoupler MOC3023) This is to protect your Arduino from the high trigger voltage of the flash unit. • Current limiting resistor The input pins of the optocoupler leads to an internal LED, depending on the Vr and Ir of the internal LED you need to calculate the current limiting resistor. In case of the MOC3023 you will need a resistor of 330 ohm. • Relay (see: 136 Arduino documentation 1.19 671
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Relay 5V board) In my setup, the optocoupler seemed to stick once in a while (connection stayed closed), so the optocoupler didn’t responded to succeeding trigger signals. By disconnecting and connecting the flash this could be solver. Using a Relay in series with the output of the optocoupler it was possible for the Arduino to disconnect the flash shortly after the flash was triggered. Arduino documentation 1.19 672
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 212.2. Connections High Speed Photography Relay • Connect Relay + to 5V • Connect Relay – to GND • Connect Relay S to D4 • Connect Relay Common to pin 4 of the MOC3023 • Connect Relay NC to one pin of the Flash Unit 330 ohm Resistor • Connect one end of a 330 ohm resistor to GND • Connect the other end of the resistor to pin 2 of the MOC3023 MOC3023 • Connect pin 1 to D3 • Connect pin 6 to the other end of the Flash Unit Sound detection module FC-04 • Connect Vcc to 5V • Connect Gnd to GND • Connect OUT to D2 Arduino documentation 1.19 673
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 212.3. Sketch High Speed Photography As soon as the sound module detects a sound level above the threshold, the following actionswill be triggered: • The FLASH pin is set to HIGH (triggering the FLASH Unit). • The D13 LED is set to HIGH • After a delay of 100ms, both the FLASH pin as the D13 LED is set to LOW. • The RELAY pin is now set to HIGH, so the Flash Unit is disconnected from the optocoupler. • After a delay of 100ms, the RELAY pin is set to LOW again. • The sketch then pauses for 1 second for the next Flash, to prevent bouncing. int FLASH=3;int RELAY=4;int LED=13;int SOUND=2;void setup(){ pinMode(FLASH, OUTPUT); digitalWrite(FLASH, LOW); pinMode(LED, OUTPUT); pinMode(RELAY, OUTPUT); pinMode(SOUND, INPUT); digitalWrite(LED, LOW); digitalWrite(RELAY, LOW); Serial.begin(9600);}void loop(){ if (digitalRead(SOUND)== LOW) { digitalWrite(FLASH, HIGH); digitalWrite(LED, HIGH); Serial.println(\"Flash is triggered\"); delay(100); digitalWrite(FLASH, LOW); digitalWrite(LED, LOW); digitalWrite(RELAY, HIGH); delay(100); digitalWrite(RELAY,LOW); delay(1000); }}Arduino documentation 1.19 674
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Links This section contains links to interesting sites, tutorials and webshops. Arduino documentation 1.19 675
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Arduino documentation 1.19 676
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 213. Web shops Here you can find a list of web shops in alphabetical order. No specific recommendation, justa bunch of links to webshops selling Arduino related stuf.Company URL DescriptionAdafruit industries http://www.adafruit.com/ • Boards • Shields • Sensors • Kits • Programmers • Components Banggood http://www.banggood.com/ • Boards • Shields • Sensors • Kits • Programmers • Components • Non Arduino related gadgets Deal Extreme http://dx.com/ Free shipping worldwide! • Boards • Shields • Sensors • Kits • Programmers • Components • Non Arduino related gadgets Electrodragon http://www.electrodragon.com/ Free shipping worldwide! • Boards • Shields • Sensors • Kits • Programmers • Components • Electronic components • PCB service Low shipping prices worldwide!Arduino documentation 1.19 677
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Company URL DescriptionHackerstore (NL) http://www.hackerstore.nl/ • Arduino Boards • Shields Kiwi Electronics https://www.kiwi-electronics.nl/ • Sensors (NL) • Kits • Components Ben’s Electronics https://benselectronics.nl/ • Raspberry Pi • Electronic components Giftwebshop https://www.giftwebshop.com/ Dutch shop, shipping to TheMicroController http://microcontrollershop.com/ Netherlands and Belgium.Pros LLC • Arduino Sparkfun electronics https://www.sparkfun.com/ • Raspberri Pi • Makeblock • littleBits • Snap Circuits • Common parts. Dutch shop, worldwide shipping. • Arduino • Shields • Sensors • Kits • Components • Electronic components Dutch shop, shipping to The Netherlands, Belgium, Germany and France. • Arduino Boards • Arduino kits • Sensors Dutch shop, shipping to The Netherlands and Belgium • Boards • Shields • Sensors • Kits • Programmers • Electronic components • Boards • Shields • Sensors • Kits • Programmers • Components Arduino documentation 1.19 678
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 214. Reference and tutorials Company URL DescriptionArduino http://arduino.cc/en/Reference/HomePage#.UwPNukJ5OhE Arduino code ReferenceSparkfun https://learn.sparkfun.com/tutorials Tutorialselectronics http://learn.adafruit.com/ http://www.ecotronics.ch/ecotron/arduinocheatsheet.htm Tutorials &Adafruit http://bit.ly/eve_arduino Projectsindustries Reference (German)ArduinoCheat SheetThisdocumentArduino documentation 1.19 679
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 215. Overview Libraries All libraries used in this document, are collected in the table below. As you can see, mostlibraries can be installed through the Library Manager.Component Library Developer URL 16x2 display with LCM1602 chip LiquidCrystal_I2C.h Frank de Brabander Library Manager LiquidCrystal I2C 16x2 display without LCM1602 chip LiquidCrystal.h Library Manager LiquidCrystal 2.4 GHz communication RF24.h Library Manager, RF24 1.1.3 315/330/433 MHz RF Receiver XY- RCSwitch.h TMRh20 https://github.com/sui77/rc-switch MK-5V 4 digits 7-Segment display SevSeg.h Suat https://github.com/DeanIsMe/SevSeg [email protected] 433 MHz RF Transmitter FS1000A RCSwitch.h https://github.com/sui77/rc-switch Dean Reading 4x4 keypad Keypad.h deanreading@hotmail. Library Manager, Keypad 3.1.0 8 digits 7-segment display with tm1638.h com https://code.google.com/p/tm1638-library/ TM1638 chip Suat 8x8 LED display with MAX72198 Max72xxPanel.h [email protected] https://github.com/markruys/arduino-Max72xxPanel 8x8 LED display with MAX72198 LedControl.h Mark Stanley Library Manager (alternative) Bluefruit nRF51 Ricardo Batista Ethershield Ethernet.h [email protected] Graphic support several displays Adafruit_GFX.h Grove Ultrasonic Mark Ruys [email protected] Grove LCD RGB Backlight Eberhard Fahle Grove Gesture paj7620 Adafruit Library Manager Adafruit Bluefruit IBM LMIC Arduino Library Manager, Ethernet 1.1.1 IR sensor IRremote.h Mifare RFID reader MFRC522.h Adafruit Library Manager, Adafruit GFX Library 1.0.2 Nokia 5110/3310 LCD Adafruit_PCD8544.h Seeed-Studio https://github.com/Seeed-Studio/Grove_Ultrasonic_Ranger Nunchuk ArduinoNunchuk.h Nunchuk on A2..A5 WiiChuck.h Seeed Studio https://github.com/Seeed-Resistive touch with STMPE610 chip Adafruit_STMPE610.h Studio/Grove_LCD_RGB_Backlight/archive/master.zip RTC I2C module with DS1307 chip RTClib.h RTC module with DS1302 chip DS1302.h Seeed Studio. https://github.com/Seeed-Studio/Gesture_PAJ7620 SD card SD.h Servo Servo.h IBM LMIC (LoraMAC-in- https://github.com/matthijskooijman/arduino-lmic Software Serial SoftwareSerial.h C) modified by Matthijs SPI (Software Peripheral Interface) SPI.h Kooijman. Stepper motor 28BYJ-48 5V Stepper.h TFT display with ILI9325 chip SWTFT.h Ken Shirriff Library Manager, Irremote 1.0.0 TFT display with ILI9341 chip Adafruit_ILI9341.h TFT display with ILI9341 chip SPFD5408_Adafruit_TF Miguel Balboa https://github.com/miguelbalboa/rfid (SPFD5408) TLCD.h Adafruit Library Manager, Adafruit PCD8544 Nokia 5110 LCD Library 1.0.0 Gabriel Bianconi https://github.com/GabrielBianconi/ArduinoNunchuk Tim Hirzel http://playground.arduino.cc/Main/WiiChuckClass?action=sou rceblock&num=3 save as WiiChuck.h Adafruit Library Manager, Adafruit STMPE610 1.0.0 Adafruit Library Manager, RTClib 1.1.0 Henning Karlsen http://www.rinkydinkelectronics.com/download.php?f=DS130 http://www.henningkar 2.zip lsen.com/electronics/in dex.php Arduino Sparkfun Library Manager, SD 1.0.6 Michael Margolis Library Manager, Servo 1.1.1 Arduino Library Manager Arduino Library Manager Arduino Library Manager, Stepper 1.1.2 Smoke and Wires https://github.com/Smoke-And-Wires/TFT-Shield-Example- http://www.smokeand Code wires.co.nz Adafruit Library Manager, Adafruit ILI9341 1.0.1 Joao Lopes https://github.com/JoaoLopesF/SPFD5408 Arduino documentation 1.19 680
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Component Library Developer URL Touchscreen TouchScreen.h TWI (Two Wire Interface) Wire.h Adafruit https://github.com/adafruit/Touch-Screen-Library USB Host Library for Arduino Arduino Library Manager Virtual Wire VirtualWire.h Oleg Mazurov and https://github.com/felis/USB_Host_Shield_2.0 WS2812B Adafruit_NeoPixel.h WS2812B FastLED.h Alexei Gluschenko from circuits@home: Mike McCauley http://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip http://www.airspayce.c om/mikem/arduino/Vir tualWire.pdf Adafruit Library Manager, Adafruit Neopixel 1.0.3 Daniel Garcia Library Manager, FastLED 3.1.0 Arduino documentation 1.19 681
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino To Do In this section you will find components that need more time to finish, including fragments of information. Arduino documentation 1.19 683
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino Arduino documentation 1.19 684
©Erik Verberne ([email protected]) http://bit.ly/eve_arduino 216. Template Xx 216.1. Specifications Xx 216.2. Datasheet Xx 216.3. Connections Xx Pin nr Name Description Arduino pin1234216.4. Libraries needed for Xx • Xx Library use explanation As with other libraries, information about other methods (functions) you can use, can befound in the corresponding library header files *.h in the library folders.216.5. Sample Xx The following sketchSample Connections • Connect VCC to 5V. • Connect GND to GND. Sample Sketch void setup(){}void loop(){}Arduino documentation 1.19 685
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 630
- 631
- 632
- 633
- 634
- 635
- 636
- 637
- 638
- 639
- 640
- 641
- 642
- 643
- 644
- 645
- 646
- 647
- 648
- 649
- 650
- 651
- 652
- 653
- 654
- 655
- 656
- 657
- 658
- 659
- 660
- 661
- 662
- 663
- 664
- 665
- 666
- 667
- 668
- 669
- 670
- 671
- 672
- 673
- 674
- 675
- 676
- 677
- 678
- 679
- 680
- 681
- 682
- 683
- 684
- 685
- 1 - 50
- 51 - 100
- 101 - 150
- 151 - 200
- 201 - 250
- 251 - 300
- 301 - 350
- 351 - 400
- 401 - 450
- 451 - 500
- 501 - 550
- 551 - 600
- 601 - 650
- 651 - 685
Pages: