XBee Basics - Lesson 4 - API mode: Reading analog data from remote XBee

Jack Rhysider · Beginner ·🔐 Cybersecurity ·13y ago

Key Takeaways

Reads analog data from a remote XBee using API mode in XBee Basics Lesson 4

Full Transcript

hmm hi welcome to lesson 4 video tutorial on XP basics in this video I'm going to show you how to take analog data and read that from a remote XP and sensor we're starting to get a little bit more sophisticated with some of the knowledge we have and because of that I don't want to go over every little thing that I'm gonna do in this video if something doesn't make sense you go back to one of the previous lessons and watch those again and then hopefully when you come back to this video you'll have an understanding of what's going on so let's get into it as always let's start with a diagram we've got XV number 1 is going to be the coordinator and that's going to connect straight into the arduino XD number 2 is going to be the router and we're going to use a temperature sensor I'm going to use the mCP 9700 it has three pins one for ground one for 5 volts and once it's sense the data so we're gonna set pin three to be an analogue reading pin and we'll have that take an analogue sample every five seconds and then where is it transmitted that to the coordinator which is then going to come into the Arduino and we'll monitor the terminal of the Arduino to see what temperature it is at this XP so I've hooked up what I am I'm gonna call the coordinator into onto the computer and I load it up XE tu and I want to make sure this is a coordinator since I'm calling the coordinator and the coordinator has to be set for API so if this function set isn't set go ahead and set that on yours will make the pan ID 885 make sure all the devices in this network are the same pin ID 885 and that's all I need to write to okay now that that's complete I'm going to get the other one connected this is going to be the router so I'm gonna read the values here see what this is so we're already we see this is a router and it's set to a team oak that's what we want if yours does not at this just make it that we've got to set the pan ID to be the same as what we indicated in the last one I like to set join verification on the D HDL we're going to leave as zero because it's only going to talk to the coordinator that's fine and then we're going to go down to adjust the IO settings and we're going to use d3 is what I wrote in the diagram so we'll just keep on with d3 and this we're gonna set to ADC which means analog input now we need to go down into the i/o sampling and we're going to do the sample rate I want to set this to 5 seconds so that would be five thousand milliseconds but actually it only takes a hex value so hex for five thousand is one three eight eight so I'm setting that to one three eight eight and that's all I need to do on the router side so I'm writing the configuration there and that's done okay let's put this together inside the kid here I soldered the red wire in 283 which is pin well D 3 our analog pin that we set so we need to tap off that pin and we'll remember the red wire is for that I'll pop the chip in here and place this into our breadboard there we go now ad 3 I'm just gonna put into a random hole here and tell you about this guy this is an MCP 9700 it's a little little temperature sensor real small pretty cheap and reads the temperature so I'm gonna put that the middle pin is where I would need to connect it to the dip to the analog readout so that middle pin is there and let me just connect this to ground and connect this little sensor to 5 volts so now on to the next thing we'll connect the X be 5 volts stay there 5 volts goes to 5 volts and ground goes to ground so that is complete alright and on the out on the left side here I have a 5 volt power supply so this is the remote side this is done we're going to put this aside okay next is going to be our coordinator plug that in there and now we need the X be the air then we get our Arduino and connect this up you so now the coordinator is complete I'm going to connect this into the computer and we're going to go over to the computer and configure this arduino now i'm going to actually be using the program that is listed right here so if you need the code it's going to be already here for you on the quick reference guide i've loaded up the arduino software and let's walk through the program i've made so i i've got a variable temp in the set up I'm just basically starting the serial loop is going to start similar to when we did the digital input and make sure there's at least 21 bytes ready to be read make sure we start at the start byte and then for the next 19 bytes we're just going to discard them all I put them in this discard byte but I'm not going to use it anymore now we get down to the two analog bytes it's actually two bytes and one is the most significant byte and once the least significant byte let me show you what I mean they're down on the bottom of my cheat sheet there's an area that says a digital sampled data and then after that is analog sampled data because there is no digital sample data in this so there's those bytes don't exist so now we just go straight into analog sample data and there'll be two bytes for every pin set for the ADC so in this case we have one pin which is pin three that's set to the ADC so in that case it's going to send us two bytes for the value so there's one byte that's a highlight one right that's a low byte I read them both in and then I do a mathematical expression to get what that whole byte is basically the most significant byte times 256 plus the least significant byte so that gives us our analog reading now I looked on the website for MCP 9700 to learn how to get the values out of it in order to make sense of it and basically it needs to be read in like this where we need to divide by 10 23 and then do some more math and then that should give us our temperature so at this point we can print and then I'm just gonna add degrees Celsius after that so I've uploaded this sketch to the Arduino let's take a look at the monitor there it's it's coming across excellent so it's 76 degrees in my house right now this I know from the temperature sensor that we put together and I'm gonna take I'm gonna take the temperature sensor and breathe on it so you make it warmer and we'll watch it go up so after I breathed on it you see that it went up about five degrees that's because the breath in my body is warmer than the breath and the the temperature in the room so that's really cool we're getting temperature data from a remote xB I just love it that's super cool well that was pretty fast and easy now you know how to get analog data out of a room or XP so because we ended a little earlier I wanted to show you something I made you can see it here mom by door so there's a little xB up there above my door and it's got one of those door sensors on it so when the door is open the two sensors come apart and when the door is closed the sensors go together okay so I disconnected it from the wall so you could see you're already familiar with this block because we've covered about that we've covered that in the last lesson so that this xB kit is connected to the xB like so so you can see we have two wires that we've tapped in here the red one that we which is d3 very similar to what we did today and the yellow one which is what we talked about in the last video actually so behind this kit here there's another board I put together and on the bottom of this board you can see we've got a USB input this is nice because you guys B is 5 volts so it just all works out really nice that way I bought this little red board on spark fun and then on the bottom side is just another little breakout board that I used to solder all my joints together and then does this little black thing here is the temperature sensor so I'm getting actually door reading and whether doors open or closed and temperature reading all day long from my front door actually it looks like my yellow my yellow wire broke I have to resolder that back into the board but you get the idea it's really nice little system that fits together very well and compact and easy so it all fits together really clean all in a nice little unit another tip I want to talk to you about is this this is the old USB cable and basically if you cut this end off it will have two wires in here one for +5 volts and one for ground so it's a really cool easy to easy to get 5 volt power supply okay that's it for this lesson you learn how to take analog readings from a remote xB we've come a long ways with xB we've learned a lot it's been really cool so far we have one more lesson remaining and in that one you're going to learn how to change the pin on a remote XP high or low send digital output to it so that's going to be really cool and I'll see you next time

Original Description

Link to my quick reference guide: http://tunnelsup.com/tup/2012/11/30/xbee-s2-quick-reference-guide-cheat-sheet/ This is part 4/5 video course on the basics of XBee. In this video I show you how to get analog data from a remote XBee.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Jack Rhysider · Jack Rhysider · 2 of 60

1 XBee Basics - Lesson 3 - API Mode: Digital Input from Remote Sensor
XBee Basics - Lesson 3 - API Mode: Digital Input from Remote Sensor
Jack Rhysider
XBee Basics - Lesson 4 - API mode: Reading analog data from remote XBee
XBee Basics - Lesson 4 - API mode: Reading analog data from remote XBee
Jack Rhysider
3 XBee Basics - Lesson 5 - API mode: Send Digital Output to a Rmote XBee
XBee Basics - Lesson 5 - API mode: Send Digital Output to a Rmote XBee
Jack Rhysider
4 Diamond Model of Intrusion Analysis - An Overview
Diamond Model of Intrusion Analysis - An Overview
Jack Rhysider
5 Getting Started with Metasploit
Getting Started with Metasploit
Jack Rhysider
6 Darknet Diaries - Ep 1: The Phreaky World of PBX Hacking
Darknet Diaries - Ep 1: The Phreaky World of PBX Hacking
Jack Rhysider
7 Ep 2: The Peculiar Case of the VTech Hacker
Ep 2: The Peculiar Case of the VTech Hacker
Jack Rhysider
8 Ep 5: #ASUSGATE
Ep 5: #ASUSGATE
Jack Rhysider
9 Ep 7: Manfred Part 1: Hacking Online Video Games for Fun
Ep 7: Manfred Part 1: Hacking Online Video Games for Fun
Jack Rhysider
10 Ep 8: Manfred Part 2: Hacking Online Video Games for Profit
Ep 8: Manfred Part 2: Hacking Online Video Games for Profit
Jack Rhysider
11 Ep 12: Crypto Wars
Ep 12: Crypto Wars
Jack Rhysider
12 Highlights from ToorCamp 2018
Highlights from ToorCamp 2018
Jack Rhysider
13 XBee Basics - Lesson 2 - Simple Chat Between Two XBess in AT Mode
XBee Basics - Lesson 2 - Simple Chat Between Two XBess in AT Mode
Jack Rhysider
14 What Lives Behind The Blue Screen | Human Readable
What Lives Behind The Blue Screen | Human Readable
Jack Rhysider
15 Top 7 Most Elite Nation State Hackers
Top 7 Most Elite Nation State Hackers
Jack Rhysider
16 The Raven by Edgar Allan Poe
The Raven by Edgar Allan Poe
Jack Rhysider
17 Podcast Promotion Strategies that Work
Podcast Promotion Strategies that Work
Jack Rhysider
18 Top 7 Most Notorious Video Game Hackers
Top 7 Most Notorious Video Game Hackers
Jack Rhysider
19 8 Biggest Cyber Heists Ever Pulled Off
8 Biggest Cyber Heists Ever Pulled Off
Jack Rhysider
20 10 Biggest Exit Scams of All Time
10 Biggest Exit Scams of All Time
Jack Rhysider
21 The Hack That Made Google Shut Down | Darknet Diaries Ep. 19: Operation Aurora
The Hack That Made Google Shut Down | Darknet Diaries Ep. 19: Operation Aurora
Jack Rhysider
22 AT&T Charged Him $900 So He Took Down Their Network | Darknet Diaries Ep. 20: mobman
AT&T Charged Him $900 So He Took Down Their Network | Darknet Diaries Ep. 20: mobman
Jack Rhysider
23 A Clipboard is All You Need to Break Into a Building | Darknet Diaries Ep. 22: Mini-Stories Vol. 1
A Clipboard is All You Need to Break Into a Building | Darknet Diaries Ep. 22: Mini-Stories Vol. 1
Jack Rhysider
24 Darknet Diaries (Theme Music) - True Stories From the Dark Side of the Internet
Darknet Diaries (Theme Music) - True Stories From the Dark Side of the Internet
Jack Rhysider
25 Why an Innocent Man Confessed to Medical Extortion Hacking🎙Darknet Diaries Ep. 25: Alberto
Why an Innocent Man Confessed to Medical Extortion Hacking🎙Darknet Diaries Ep. 25: Alberto
Jack Rhysider
26 How to Get Your Podcast to the Top of Apple for $5🎙Darknet Diaries Ep. 27: Chartbreakers
How to Get Your Podcast to the Top of Apple for $5🎙Darknet Diaries Ep. 27: Chartbreakers
Jack Rhysider
27 The Secret Hacking Unit of the Israeli Military🎙Darknet Diaries Ep. 28: Unit 8200
The Secret Hacking Unit of the Israeli Military🎙Darknet Diaries Ep. 28: Unit 8200
Jack Rhysider
28 Jon's Spooky Job Interview🎙Darknet Diaries CLIP ✂ (Ep. 119 Hot Wallets)
Jon's Spooky Job Interview🎙Darknet Diaries CLIP ✂ (Ep. 119 Hot Wallets)
Jack Rhysider
29 He Took Control of 50,000 Printers With 3 Lines of Code🎙Darknet Diaries Ep. 31: Hacker Giraffe
He Took Control of 50,000 Printers With 3 Lines of Code🎙Darknet Diaries Ep. 31: Hacker Giraffe
Jack Rhysider
30 Hacking Is Life-or-Death When You Target a Hospital🎙Darknet Diaries Ep. 121: Ed
Hacking Is Life-or-Death When You Target a Hospital🎙Darknet Diaries Ep. 121: Ed
Jack Rhysider
31 The Sewage Incident - When Operational Technology Isn't Secure
The Sewage Incident - When Operational Technology Isn't Secure
Jack Rhysider
32 The Cybergang That Stole $1 Billion From ATMs🎙Darknet Diaries Ep. 35: Carbanak
The Cybergang That Stole $1 Billion From ATMs🎙Darknet Diaries Ep. 35: Carbanak
Jack Rhysider
33 The New Guy at the Office Is a Secret Super Hacker🎙Darknet Diaries Ep. 36: Jeremy From Marketing
The New Guy at the Office Is a Secret Super Hacker🎙Darknet Diaries Ep. 36: Jeremy From Marketing
Jack Rhysider
34 Why Was This Bitcoin Millionaire Digging Tunnels Under His House?🎙Darknet Diaries Ep. 39
Why Was This Bitcoin Millionaire Digging Tunnels Under His House?🎙Darknet Diaries Ep. 39
Jack Rhysider
35 It Shouldn't Be THIS Easy to Break Into a Utility Company🎙Darknet Diaries Ep. 40: No Parking
It Shouldn't Be THIS Easy to Break Into a Utility Company🎙Darknet Diaries Ep. 40: No Parking
Jack Rhysider
36 The $30 Million Stock Market Hack🎙Darknet Diaries Ep. 123: Newswires
The $30 Million Stock Market Hack🎙Darknet Diaries Ep. 123: Newswires
Jack Rhysider
37 How to Protect Your Crypto Assets From Thieves
How to Protect Your Crypto Assets From Thieves
Jack Rhysider
38 Sometimes the Best Hacking Tool Is Confidence🎙Darknet Diaries Ep. 41: Just Visiting
Sometimes the Best Hacking Tool Is Confidence🎙Darknet Diaries Ep. 41: Just Visiting
Jack Rhysider
39 The Scammer Who Got Rich Invoicing Facebook & Google for $100 Million🎙Darknet Diaries Ep. 124
The Scammer Who Got Rich Invoicing Facebook & Google for $100 Million🎙Darknet Diaries Ep. 124
Jack Rhysider
40 The Secret Signals Hiding at Hacking's Biggest Conferences🎙Darknet Diaries Ep. 43: PPP
The Secret Signals Hiding at Hacking's Biggest Conferences🎙Darknet Diaries Ep. 43: PPP
Jack Rhysider
41 If You Don't Want to Get Hacked, Try Locking Your Doors🎙Darknet Diaries Ep. 125: Jeremiah
If You Don't Want to Get Hacked, Try Locking Your Doors🎙Darknet Diaries Ep. 125: Jeremiah
Jack Rhysider
42 The Most Epic Xbox Hacker Story You'll Ever Hear🎙Darknet Diaries Ep: 45 Xbox Underground (Part 1)
The Most Epic Xbox Hacker Story You'll Ever Hear🎙Darknet Diaries Ep: 45 Xbox Underground (Part 1)
Jack Rhysider
43 How Hacking an Xbox Destroyed These Teens' Lives🎙Darknet Diaries Ep. 46: Xbox Underground (Part 2)
How Hacking an Xbox Destroyed These Teens' Lives🎙Darknet Diaries Ep. 46: Xbox Underground (Part 2)
Jack Rhysider
44 The Ransomware Group That Went Too Far 🎙️ Darknet Diaries Ep. 126: REvil
The Ransomware Group That Went Too Far 🎙️ Darknet Diaries Ep. 126: REvil
Jack Rhysider
45 This Text Can Hack Your Phone, Even If You Never Open It🎙Darknet Diaries Ep. 47: Project Raven
This Text Can Hack Your Phone, Even If You Never Open It🎙Darknet Diaries Ep. 47: Project Raven
Jack Rhysider
46 Her Never-Ending Quest to Make Zero Days Hard🎙Darknet Diaries Ep. 127: Maddie
Her Never-Ending Quest to Make Zero Days Hard🎙Darknet Diaries Ep. 127: Maddie
Jack Rhysider
47 Rare Interview Where US Cyber Command Reveals Their Ops🎙Darknet Diaries Ep. 50: Op Glowing Symphony
Rare Interview Where US Cyber Command Reveals Their Ops🎙Darknet Diaries Ep. 50: Op Glowing Symphony
Jack Rhysider
48 Inside the Cyber War for Kashmir🎙Darknet Diaries Ep. 51: The Indo-Pak Conflict
Inside the Cyber War for Kashmir🎙Darknet Diaries Ep. 51: The Indo-Pak Conflict
Jack Rhysider
49 How Hackers Jack Your Credit Card When You Shop Online🎙Darknet Diaries Ep. 52: Magecart
How Hackers Jack Your Credit Card When You Shop Online🎙Darknet Diaries Ep. 52: Magecart
Jack Rhysider
50 Jammer! He Just Wanted Privacy, But This Little Device Caused Big Trouble
Jammer! He Just Wanted Privacy, But This Little Device Caused Big Trouble
Jack Rhysider
51 Who Stole the NSA's Top Secret Hacking Tools?🎙Darknet Diaries Ep. 53: Shadow Brokers
Who Stole the NSA's Top Secret Hacking Tools?🎙Darknet Diaries Ep. 53: Shadow Brokers
Jack Rhysider
52 How a Blow-Up Doll Can Be Used To Break Into Buildings🎙Darknet Diaries Ep. 130: Jason's Pen Test
How a Blow-Up Doll Can Be Used To Break Into Buildings🎙Darknet Diaries Ep. 130: Jason's Pen Test
Jack Rhysider
53 How Bitcoin Tracers Rescued 23 Kids From Sex Abuse🎙Darknet Diaries Ep. 131: Welcome to Video
How Bitcoin Tracers Rescued 23 Kids From Sex Abuse🎙Darknet Diaries Ep. 131: Welcome to Video
Jack Rhysider
54 The Dangerous Flaw in Windows XP's 45 Million Lines of Code🎙Darknet Diaries Ep. 57: MS08-067
The Dangerous Flaw in Windows XP's 45 Million Lines of Code🎙Darknet Diaries Ep. 57: MS08-067
Jack Rhysider
55 They Had Permission to Break In, So Why Are They In Jail?🎙Darknet Diaries Ep. 59: The Courthouse
They Had Permission to Break In, So Why Are They In Jail?🎙Darknet Diaries Ep. 59: The Courthouse
Jack Rhysider
56 This Hacker Makes $160K a Day ⁠— After He Got Out of Federal Prison🎙Darknet Diaries Ep. 60: dawgyg
This Hacker Makes $160K a Day ⁠— After He Got Out of Federal Prison🎙Darknet Diaries Ep. 60: dawgyg
Jack Rhysider
57 He Fell Asleep Hacking Sea World and Woke Up in a World of Trouble🎙 Darknet Diaries Ep. 62: Cam
He Fell Asleep Hacking Sea World and Woke Up in a World of Trouble🎙 Darknet Diaries Ep. 62: Cam
Jack Rhysider
58 "I rob banks for a living," but it's all totally legal🎙Darknet Diaries Ep. 66: Freakyclown
"I rob banks for a living," but it's all totally legal🎙Darknet Diaries Ep. 66: Freakyclown
Jack Rhysider
59 Mom Hacked a Prison With a Clipboard & USB Stick🎙Darknet Diaries Ep. 67: The Big House
Mom Hacked a Prison With a Clipboard & USB Stick🎙Darknet Diaries Ep. 67: The Big House
Jack Rhysider
60 Cyber Terror: Who Sabotaged This Saudi Chemical Plant?🎙Darknet Diaries Ep. 68: Triton
Cyber Terror: Who Sabotaged This Saudi Chemical Plant?🎙Darknet Diaries Ep. 68: Triton
Jack Rhysider

Related Reads

📰
Hackers Are Now Vibe-Coding Malware — And Your Antivirus Can’t See It
Learn how hackers use AI-generated malware to evade signature-based security and why traditional antivirus methods are ineffective against it
Medium · Cybersecurity
📰
Packets and Frames (En Français)
Learn about packets and frames in computer networking and how they relate to TCP/IP and UDP/IP protocols
Medium · Cybersecurity
📰
AI Changing Your Passwords Is a Bigger Deal Than You Think
AI-generated passwords can significantly impact cybersecurity, and understanding their implications is crucial
Medium · Cybersecurity
📰
The Three Problems That Show Up Right After You Think Spring Security Is Done
Learn to fix common Spring Security issues like CORS blocking, token expiration, and @PreAuthorize fetch problems
Medium · Programming
Up next
Is your free email putting your bank account at risk? #Podcast #Interview #Efani #BankAccounts
efani
Watch →