To get started, I bought the BeagleBone Black starter kit from Adafruit (awesome company) and a series of parts and tools from Amazon and The Robot Shop (Canadian!) - more on this in another post.
I also needed a good introductory project to follow the classic embedded equivalent to Hello World: make a LED blink. Since I was about to head out on a vacation out of the country for two weeks, I decided to build a home security system.
Here's my part list:
- Weatherproof TTL Serial JPEG Camera with NTSC Video and IR LEDs
- Adafruit Beagle Bone Black Starter Pack
- USB Wifi dongle
- 2 port USB hub
- 32Gig micro SD card
- That's it!
I've always believed in code over hardware in design decisions. Even with my electrical engineering background, I find it less costly, more flexible and more robust to code solutions rather than to rely on hardware.
Here's a Python code snippet of my project.
enable_tty01 = 'sudo sh -c \'echo ttyO1_armhf.com > /sys/devices/bone_capemgr.9/slots\''
os.system(enable_tty01)
filepath = "/home/ubuntu/"
def initialize():
resp = ""
time.sleep(1)
while(serial.inWaiting() > 0):
data = serial.read()
resp += data
if "Init end\r\n" in resp:
print "Ready"
break
# Set image size to 640 x 480
serial.write(b'\x56\x00\x54\x01\x00')
resp = ""
time.sleep(1)
while (serial.inWaiting() > 0):
data = serial.read()
resp += data
if b'\x76\x00\x54\x00\x00' in resp:
print "Size set"
break
#Picture function
def takePic():
print "Take Picture"
# Take picture
cam.takephoto()
#Get JPG size
serial.write(b'\x56\x00\x34\x01\x00')
resp = ""
#time.sleep(1)
print "Get image size from serial device"
bytes = cam.getbufferlength()
# Write image to file
print "Read image from serial device"
return cam.readbuffer(bytes)
# Initialize serial connection.
serial = serial.Serial("/dev/ttyO1", baudrate=38400)
serial.write(b'\x56\x00\x26\x00')
cam = VCam(serial)
# Initialize the camera settings for the first picture.
initialize()
tweet = Tweet()
cam.enablemotion()
while 1:
# Continuously check for motion detection.
if (cam.motionDetected()):
# If motion is detected, take a pic.
cam.disablemotion()
frame1 = takePic()
string_frame = ''.join(frame1)
now = datetime.datetime.now()
filename = "%d.%02d.%02d.%02d.%02d.%02d.jpg" % \
(now.year,now.month,now.day,now.hour,now.minute,now.second)
try:
f = open(filepath + filename, 'w')
f.write(string_frame)
except:
print "Error writing the file to the system."
else:
f.close()
#Post the image to Twitter in a new thread to resume motion detection.
t = Thread(target = tweet.postimage, args = (filepath, filename))
t.start()
cam.reset()
initialize()
cam.enablemotion()
- The camera's baud rate is rather slow so I wasn't able to implement the motion detection on the computer and had to rely on the built in feature from the camera. In the future, I will use a USB or IP camera instead.
- The wifi dongle was difficult to install but with enough googling, I was able to find working steps. While I was working on this project, the BeagleBone Black was still relatively new compared to the Raspberry Pi so there were limited examples available online. This is no longer the case.
And finally, the working prototype!
While I was away, I had pictures of the sun rise and sun set lighting change against the wall of my home office tweeted to me on a daily basis (they were detected as motion). It was nice to see everything was good at home while being away.
Until next time!
This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article. alarm companies port-aransas texas
ReplyDeleteI needed to thank you for this awesome read!! I certainly getting a charge out of each and every piece of it I have you bookmarked to look at new stuff you post. Visit Now
ReplyDeleteWoh I am cheerful to discover this site through google.
ReplyDeleteHouse Alarms
However, these can be extremely expensive to purchase and install. In this article you are going to learn about a cheap camera security system that you can install in your home for less than security camera system installation NY
ReplyDeleteOr he almost accidentally wins a Darwin award, can’t tell. www.forbrukeretaten.no/
ReplyDeleteThis will rely upon the nature of the update and the increases you make to your kitchen. As indicated by the land operators, a completely useful and present day kitchen will support the estimation of your property drastically. hardwood Floor Refinishing overland park ks
ReplyDeleteYou create sense out of the foremost complex topics.24 Hour Locksmith Pros
ReplyDeleteYou make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Home Security
ReplyDeleteYou there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. full color night vision security camera
ReplyDeleteThe Cori HD Smart Home Security Camera joins the Momentum camera lineup including the Axel HD Smart Camera, Aria LED Floodlight Camera and the Niro Garage Door Controller. Along with all Momentum Wi-Fi cameras, the Cori cameras can be controlled and viewed from the same mobile app, as well as other home-based consumer electronics from NEST.
ReplyDeleteComplete Security Alarms System
Great! We will be connecting to this enormous post on our site. Continue the good writing.Marietta locksmith
ReplyDeleteSurveillance camera frameworks give a lot of assistance in keeping various unlawful acts and have contributed towards reclassifying home security, however security at organizations and working environments. Surveillance cameras that accompany a wide scope of highlights and choices are a
ReplyDeletebuilding intercom system upgrade
There are also scene modes included with compact cameras that allow you to choose a setting to match the scene you are shooting.https://www.optics1.eu
ReplyDeleteYour articles make whole sense of every topic.
ReplyDeleteIP camera systems
The superb highly informative blog I’m about to share this with all my contacts.
ReplyDeleteself storage security
Picking a play kitchen set relies upon the age of the youngster, your financial plan and your setting. It likewise relies upon your own rationality. Where is that play kitchen made? pressure cooker directions
ReplyDeleteWhen the flow through a space is blocked, weak, or misdirected the buyer's perceived relationship to the home suffers, resulting in an unsuccessful tour. Dark, dirty, or stale spaces can choke the positive reaction to a home. Coupons & Discounts in San Diego
ReplyDeleteI truly like the diversion your distribute has advertised. I cherished this site an awesome arrangement. Continue posting article, for example, this. It's enjoyable. Pleasant photography excessively !
ReplyDeletevert shock reviews
In the contemporary context, one of the ingenious thing one can do with a home's equity is to put it right back into the home. Home improvement is besides providing you with the much needed changes, increases the equity of your home.home renovations Calgary
ReplyDeleteAt the point when one discussions about setting aside cash through effective air conditioning frameworks the subject of SEER for the most part comes up. Airco Antwerpen
ReplyDeleteThe monthly mortgage payment mainly pays off principal and interest. But most lenders also include local real estate taxes, home owner's insurance, and mortgage insurance (if applicable).canadian real estate
ReplyDeleteMolds are present in every home and in the fresh exterior air. If a mold spore is present on a food source such as drywall, wood trim, wood or even on dust it will not necessarily grow to a problem level. If that same spore and location were to have moisture added, now you have conditions where molds can grow and become an issue.Top Real Estate Agents in Clinton Missouri
ReplyDeleteGoing through the final part of this article, you will see just how important budgeting and home improvement can be done which will help save you money and improve your home.portable shampoo bowl
ReplyDeleteComplete woodworkers have to have a wonderful eye when developing the design, joints and also general appearance of a job or space which suggests the option of that to work with could be vital for an effective job or improvement required for the general job success.my blog
ReplyDeleteBuying a home is a process, and like any other journey, gey roommate finder there are certain steps you can take to ensure you reach your goal safely and successfully.
ReplyDeleteFees are based according to size, age and various other aspects of the home. Augusta fencing
ReplyDelete