myRIO Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

mySecuritySystem - A Wireless Surveillance Device

 

1. Overview

mySecuritySystem is a myRIO powered image analysis and wireless network data managing system aimed for monitoring a premises for any type of physical movement. The system acquires images using a web camera, detects if movement has occurred it sends an email with a picture of the situation and at the same time streams video and audio data to a laptop to be recorded and saved on a cloud data service such as Dropbox. The device can be considered a part of the Internet of Things as it independently sends data to the world wide web and could be integrated with the Cloud Dashborad.

 

 

This system could be used for any well-lit area to monitor, such as a room or office. The project objective was to show the myRIO’s capabilities of using Vision analysis along with UDP, TCP and SMTP communication protocols.

 

2. Features

  1. TCP communication is used to send video data from the myRIO to the PC. This allows to make sure that not frames are lost in the process.
  2. UDP communication is used to send audio data from the myRIO to the PC. UDP is used to achieve real time audio broadcasting without worrying of any lost data.
  3. SMTP communication protocol is used to send an email with a picture attachment straight from the myRIO to alert about an intruder as soon as possible. For this a generic Gmail account is used.
  4. The State Machine architecture with AVI VI's is used to record each incident in a new file and save it to a folder on the PC (In this case uploading to Dropbox to allow to check recordings anywhere in the world)
  5. IMAQ VI's are used to take two images and compare them, the difference is compared to an adjustable threshold to determine if movement has been detected.
  6. Video is recorded and email also sent if the value of the myRIO's onboard accelerometer has rapidly changed (device has been picked up).

 

features.png

Figure 1 - Functionality

 

 

3. Host PC Front Panel

From the GUI the sensitivity of the motion detection, the location of the recordings, and email settings.

mySS clear.PNG

Figure 2 - Here you can see the room being monitored, the current movement value and the threshold set.

 

 

mySS movement.PNG

Figure 3 - Once someone has entered the room the threshold of change in acquired images has been reached and the recording stage has started.

 

4. Part List

  1. NI-myRIO 1900 ( http://www.ni.com/myrio/ )
  2. Microsoft LifeCam HD-3000 ( http://www.microsoft.com/hardware/en-gb/p/lifecam-hd-3000 )
  3. Any microphone with 3.5 mm audio jack

 

5. Software Used

  1. LabVIEW 2014
  2. LabVIEW 2014 myRIO toolkit
  3. NI High Throughput Add-on for myRIO 2014
  4. STM library (From VIPM or http://www.ni.com/example/27739/en/)
  5. NI-IMAQ drivers
  6. LabVIEW FPGA

 

6. Hardware Setup

hardware setup.png

Figure 4 - Hardware setup

 

7. LabVIEW Code

mySS Host Main  jpeg.jpg

Figure 5 - Host PC code

 

mySS RIO Main 02 jepeg.jpg

Figure 6 - myRIO code

 

8. Code Setup

  1. Install “SMTP Client with SSL Support” and “WebDAV Client with SSL Support” software on myRIO in addition to the standard software.
  2. Make sure that myRIO is password protected, this will allow to save images on the device.
  3. Connect myRIO to a local WiFi network.
  4. Copy WiFi IP address form the “Network Settings” tab in NI MAX.
  5. Open project
  6. Change device IP address in project explorer and “mySS Host Main.vi”.
  7. Setup email settings (Use a Gmail account as sender).
  8. Change location of recordings.
  9. Open “mySS RIO Main.vi” and Run it to be uploaded to the device.
  10. Run “mySS Host Main.vi”.
  11. Adjust Movement Threshold.
  12. Click "Update Settings" button.

 

9. Examples Used

  1. Motion Detection Using NI-Vision - https://decibel.ni.com/content/docs/DOC-4717
  2. Sending Email - "Send Email using SMTP Client" in NI Example Finder
  3. Playing sound to PC - "Simultaneous Sound Input Output" in NI Example Finder
  4. Saving to AVI file - "Grab and Save to AVI" in NI Example Finder

 

10. About the Developer

I am a student from University of Leeds studying Mechatronics and Robotics. Currently undertaking a yearlong placement at National Instruments UK. During my placement I was given a full week to do a project of my choice and I chose to do what you have seen above. This allowed me to get hands on experience with NI software and hardware in preparation for CLAD and CLD certification.

Art
Applications Engineer
National Instruments
Comments
Member asdsd33
Member

i am using Lv13 so i cant open code.can u plz put sutaible code for me.

Thanks in advance..

ArtG
NI Employee

Hi asdsd33,

I have added a 2013 version. Hope that helps .

Art
Applications Engineer
National Instruments
Menelaos.K
NI Employee

Great work ArtG. This is an amazing project!

Member mody992
Member

hello, i am doing this project but facing some issues with the myrio. who can i ask for help?

Active Participant BradM
Active Participant

It might be a bit more helpful if you were to describe the issues that you're facing to better answer your question of who to ask for assistance.

Member mody992
Member

1st of all thank you so much for your reply. 2nd im facing an issue with

the configuration of myRIO. i dont have the log in to the my Rio so i cant

add the smtp and the webdav software. plus can i use any cam or should it

be the one u putted. i am going to borrow the my Rio from the university

tomorrow so i will tell u in details what is happening and be more specific

about the issues.

much appreciated for the reply, and btw its an amazing project

Active Participant BradM
Active Participant

Firstly, it is ArtG who put this project together. I had nothing to do with the project, I just hang out on these forums and help folks out.

Secondly, all of the software installed in the example is installed through NI's Measurement and Automation Exploere (MAX). See this quick guide

Member mody992
Member

hello again. i get everything working except the email. can i get help in the email configuration. it wont send me an email when motion is detected and i cant seem to find any error

ArtG
NI Employee

Hi,

I recommend opening the "Send Email Using SMTP Client" example in the NI example finder and playing arround with it.

If that does not work sending emails form your PC than there might be issues with your email account (gmail recommended).

If it works then check if the SMTP software has been installed successfully on the RIO.

Art
Applications Engineer
National Instruments
Member jinyunwei
Member

i have a question, in the mySS host main.vi, there is no image shown, what is the reason and how to solve it? it is really bothering me.

Member eronides
Member

Bro's, I'm having the same problem as kinyunwei. I'm connecting with the target but my web cam doesn't show a thing.

Can anyone help me? I know it's been a while this project, but I'll be grateful for the help.

 

Thx

 

Member tomnz
Member

Nice piece of work! I couldn't get the video to work but I eventually got the audio of which I am more interested anyway. Is there a reason you used UDP and not (say) streaming of the audio? Also you forgot to mention you are using the FPGA and to compile it first. Why do you have two FIFOs? You read the data from the audio in to a FIFO then send it out to the audio out through a second FIFO. Can you explain why please. Also the audio does in fact stream so is not saved in any way. I would have thought it better to insert the audio into the video file.

Contributors