Category: Hardware

Testing facebook intergration

We all have different websites we like to post to.

Facebook, twitter, your own personal blog, the companies news page etc etc.

check

check

So now I try to connect this blog to facebook to see if thats working..

 

HC-SR04 Ping distance sensor

Working on a small mockup that should read sensors, [do some stuff here] and send it to clients website/server..

Using a sensor like the HC-SRo4 Ping distanse sensor to send a signal to the RasBotPi when someone walks inside the range is a nice idea for the moment. Although for the project I am working on, this is not the best idea 🙂

But Arduino and a breadboard gives you the power to fool arround and see if it fits your needs.

On twitter I found out about this guy: Hazim Bitar.
His website is http://www.techbitar.com and you can follow him on twitter too.  He created an app that reads Arduino sensors using bluetooth. Got me thinking about the final project and how we can overcome the distance without the needs of cable (or to setup a complete wifi network) on the “moving” location.

2013-11-14 14.38.04-1

HC-SR04 on breadboard

Anyway, this sensor came from china (dx.com). There are lots of sketches to find if you do a  google. The one I post here works too. Dunno exact where I found it..

 

 

Watch the sky (simple python ftp script)

So you got the raspberry and the camera board.

With a cronjob you can let it take pictures every few seconds or hour and do something with it. Might be  a timelaps video or send it to twitter. In this case I added a simple script to the “RasBotPi” so it can send a picture every hour to this website.

2013-11-14 11.24.55

The “RasBotPi”

a Simple script will capture a jpg and then send it to this website with python and its ftp library.

Here an example of the snapshot that the camera board takes..

Some clouds..

Some clouds..

 

Timelaps with the Raspberry Pi camera board

source:
http://www.raspberrypi-spy.co.uk/2013/05/creating-timelapse-videos-with-the-raspberry-pi-camera/

Step 1 – Taking the time-lapsed photos

This command will take a photo every 60 seconds (60000 milliseconds) for 2 hours (7200000 milliseconds) resulting in a sequence of 120 images.

The “%04d” will result in a four digit number appearing in each filename.

myimage_0001.jpg
myimage_0002.jpg

myimage_0119.jpg
myimage_0120.jpg

Step 2 – Combine images into MP4 video

Once you’ve got your image sequence you will need a method to stitch them together. I decided to use “avconv”. You can install this useful library with the following command :

To construct the video file from your image sequence you use the command shown below. Although it appears on multiple lines for readability it should be entered as a single line on the command line :

The video will be the full resolution of the default image size (2592×1944).

To crop the images and create a more standard 1280×720 resolution video you can use the following command :

The “vf” option defines a video filter. In this case two filters which crop the incoming image to 2592×1458 and then scale them to 1280×720.

The “r” option tells avconv to create a video with a frames per second of 10. It appears twice to prevent avconv dropping frames that it thinks are similar.

The “crf” option tells avconv to aim for a quality level of “20″ which is a good starting point. Lowers values are better but will increase the file size.

The “-g” option sets the GOP value. The YouTube Advanced Encoding Settings page recommends that the GOP should be set to half the frame rate so this is set to 15.

Gertboard ATmega IO vs. Arduino Pins

The printing on the Gertboard indicated the port and pin numbers internal to the Atmega microcontroller…

However this is normally hidden from the user by the Arduino’s “wiring” library and rather than refer to (e.g.) Port B, bit 5, you’d normally refer to “pin 15″.

The mapping is fairly straightforward, but to help you connect wires to pins on the Gertboard, here is a handy table to let you see what the connections are:

See source:
https://projects.drogon.net/raspberry-pi/gertboard/gertboard-atmega-io-vs-arduino-pins/

Gertboard