Monday, 17 March 2014

Pi trak

I'm pretty lucky to still have my old bigtrak and trailer, whilst it could still work with the command panel I wanted to make bigtrak how he should have been in the first place a fully moveable robot with lasers and cameras.


Firstly I needed to strip bigtrak of all unnecessary bits. The battery compartment was cleared and the bottom flap glued on, this making am ideal spot for the pi and big traks power supply to be stored adding weight to the back as the 4xd batteries did before.



I also took out the circuit board (from early 80's) and the counter sensor to work out how far bigtrak has done which you will commonly see these days on computer mice.




Next up was to add the pi, I started with a model a pi with a rtk motor controller but figured I couldn't do much more than control the motors (newer versions have longer gpio pins which give you access to the gpio connections) so eventually swapped the MicRoCon from 4tronixs and started up the pi which then needed scratch gpio added.


Once up and running I placed the covers back on without screwing them and hey presto a faster tougher (and noisier) bigtrak. I have a laser module to go in it at a later date and have already wired the speaker to the pi just need to come up with some sound files for it.


And lastly although not a good video I have video of bigtrak being controlled with a bluetooth keyboard, next will be a web gui interface to do this with.




Sunday, 9 March 2014

Kano os for raspberry pi

I missed their kickstarter project which exceeded all other kickstarter projects and whilst Kano don't currently have a box set for me to try, I was fortunate enough to try their new os from Kano.me/downloads.

The complete package includes a sd writer and from what I've seen on twitter a four year old can set it up.

Once running it asked for my name and ran a couple of questions before starting the os.


On starting I was greeted with a slick and fast os. Each section having a playground so you can save each stage and learn at your own speed, it also teaches you to program with lots more being added to it in the future.

Presently it only boots up in hdmi, but on their forums they have written how to run this on a/v.

The whole thing can also run through vnc  through either your pc or an iPad which looks promising.

The instructions which will come in the box set or can now be downloaded from their site as .pdf files are very easy to learn and understand and actually make many books including a big yellow book on raspberry pi look very hard to understand. I think in the few evenings I've been using this os I have probably learnt a lot more than I have in the previous year.

I for one will be looking forward to Kano's future development along with its integration into schools and hopefully when the Kano kit is available I can review that too.

For more info visit Kano at Kano.me

Pibot part one

Firstly this will be an on going project but for starters I at least now have something to work with.


Firstly I had to solder two wires to each of the two motors before adding wheels and tracks to the zumo chassis. After attaching 6v of AA batteries to the chassis I ran a pair of wires from here to the power in on the 4tronix MicRoCon board and added all the wires as seen in picture.


Next was to download the files from 4tronix github and here I found running the python motor script that one wire had detached from near side motor, so this had to be re soldered on.

Next was to try the scratch script and this was where I tumbled, I needed to download scratch gpio 5 by cymplecy at http://cymplecy.wordpress.com/scratchgpio/  follow the instructions, reboot and start scratch gpio then the scratch motors script and now I was able to control the pibot with just the arrow keys on the bluetooth keyboard.

But this wasn't enough for first pibot project I had to add the neo pixel ring for some bling.


Next up will be to add a smaller usb battery for pi, have a nice 2000 mah one on order, a case to fit pi in place, camera and laser and possibly line sensor and ultrasonics.

I also will need to look at being able to control the pibot over the Internet via a webpage and even at that point and possibly a bigger robot a GPS.



Nightcam part 3

After weeks of wet weather, the forecast showed it was to be a dry night.  I have in the past week got a 12v power adapter for the ir light as 8 batteries a night is an awful lot, all through they do work a second and third night the power is very much reduced.


So last night before bed I set up the nightcam in the garden, it was suprising how bright the ir light actually was when viewing it back, but at some point it had moved in the night so wasnt as effective.

Even so we caught two cats, two birds and the pet dog.  The video links below are for the cats and birds.

http://www.youtube.com/watch?v=UbQPiGlqHgA&feature=youtu.be
http://www.youtube.com/watch?v=jGKCK55vJnY&feature=youtu.be
http://www.youtube.com/watch?v=PAwGcv7SaOM&feature=youtu.be

update, with the light better positioned i managed to get a cat:

 http://youtu.be/ELbRbHCo_rc

Sunday, 2 March 2014

Adafruit neo pixels and Gemma 8mhz controller

Finally got this working today, after starting up the old rusty xp machine and sorting out the network card on it I downloaded adafruits arduino ide which they have already added the files needed to and tried to get it to upload, no.

Problem one couldn't see Gemma or trinket this involved downloading the drivers off the adafruit site.

Problem two still wouldn't see so had to add a new .conf file and id file.

Problem three it now expected 4 but got -5 error, this one really annoyed me and everything in adafruit site had been done.  Next up I had a brain wave try every usb lead I have and after the fifth lead the Gemma started to flash differently but this error still popped up but suddenly the LEDs were lighting up on the neo pixels from one of the latest sketches which was on adafruit, here's a video of part of it:

http://www.youtube.com/watch?v=sPB9WVpABFc

So today's moral to the story is if at first you don't succeed try a different lead.

Saturday, 1 March 2014

Nokia screen display on pi


Found a nice git hub repo with the use of drogon wiring pi was able to get text to appear on the screen, but not till after solving a contrast problem with lcd.set_contrast(150) but still trying to solve missing second and third line as per pic.



The files needed can be got via:

git clone https://github.com/XavierBerger/pcd8544.git
cd pcd8544
./setup.py clean build 
sudo ./setup.py install




Wildlife cam part 2


I found I still had a lot to do on this project, one was false alarms from the pir.  To solve this I cut down a toilet roll and covered it in some more camo cloth and stuck it on, this was to concentrate the pir to front only so in theory the only way to trigger it would be from the front only and not the sides.


I decided to not tidy it up as being ruffled should help it blend in a bit better as it breaks the shape up just as camo is designed to do.

Next up was to add a stand so I can place the cam anywhere.  In my box of stuff I had an old joby gorilla stand for my old phone that was broken. Some gorilla glue to fix the stand to the case and gaffa tape to hold the pi case to old phone case and I have a secure stand that can go just about anywhere.


I'm not to bothered about the amount of gaffa tape as most of this is at the back which will be hidden by the camo bag, but front has minimuim amount so the camo does its job.

No doubt as time goes on I will add bits and edit bits and hopefully have something very special.

Thursday, 27 February 2014

Night time wildlife cam.

Ive been meaning to make this since the pi noir camera came out but only got round to it this week.

Firstly I needed an old pi case I could drill holes in, a small hole for the pi camera and a bigger hole for the ir pir to poke through. 

The pir is connected to positive, negative and out to gpio7 (pin26)

I then got a huge camo bag from one of my old geocaches and cut it up, one into a smaller bag to house batteries and give infra red 48 led light some protection and some material to glue around the case. I used some poly filler to waterproof the case, used a micro sd adapter to protect sd card slot.


That was the easy bit, it was the coding I struggled with, well easy to get gpio 7 to trigger and easy to save the file but I couldn't get it to save under a different name each time just the same name and then delete the file before by overwriting.  


After speaking to zac an excellent teenager programmer we started to run into other difficulties with the code before I found a snippet that I could bend and mould to this project and bingo, the files saved as date-time.h264

Here's a screenshot of the code:


So yes simple in the end,I don't have any video to put up yet but a screenshot of it detecting my finger whilst facing the small monitor I had been using.


To convert the .h264 file format to mp4 I had to do the following:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gpac

then to use it and convert the file:

MP4Box -add nameofh264file.h264 nameyouwanttocallyourconvertfile.mp4

Here is the results of the cam, about 5 seconds my dog comes into view as he wonders the house in the middle of the night.


 or linky for youtube



Coding for cam.py file:

#www.mypifi.net/blog
#code for mypifi pir wildlife cam
#please if used acknowledge me please
#by Paul Brown
import RPi.GPIO as GPIO
from time import sleep
import datetime
import os

GPIO.setmode(GPIO.BCM)
GPIO.setup(7, GPIO.IN)

while True:
  if (GPIO.input(7)==True):
    timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
    os.system ("raspivid -o /home/pi/v"+timestamp+".h264 -t 20000")
    sleep (5)


You will also need to set this file to run automatically on start up  for when you power it up in the wild.  Also a good powered usb battery, my 8000mah one lasted 24 hours and my 20000mah one dropped one bar in 24 hours, also remember to try and keep all this dry as water and electronics don't mix.

Enjoy.

Blog update, I have done more to this on my blog post: http://smstextblog.blogspot.co.uk/2014/03/wildlife-cam-part-2.html?m=1

Tuesday, 25 February 2014

Unauthorised payments by old ISP

I found out today, whilst I won't say at the moment which ISP it is (not the big five) they have been taking £35.40 a month from my credit card, a card I only ever used for their payments.

After speaking to barclaycard who immediately cancelled the card they said they would send a new card and give me details to claim against the unauthorised payments.

Now I've not noticed this card as a. It's an online card and b. it was set up to pay monthly in full however as it been paying minimuim amount I've not noticed it on my bank account when it came to barclaycard asking for minimuim amount each month. Ok my fault I should have checked to ensure or even cancel the account, but how many other people have had this done or are having this done cos they have not checked their accounts each month?

I do scan over my accounts quickly each month but things under a tenner don't seem to register with me as I mistakenly have always looked for huge amounts going in one chunk as my theory is if you doing over someone's account you get what you can in the shortest time. Even through now I'm thinking maybe small amounts infrequently would be a better way to go.

Anyhow I will see what happens and keep my 9,000 ish a month viewers up todate.

Monday, 24 February 2014

Books to help or confuse you

I've spent much of the weekend reading idiots guide to Unix which I found helpful and easy to understand. Today I'm onto my third book.  No I'm not a fast reader but it's because two books, python for dummies and python for beginners seem to have been written by someone who thinks they are writing for beginners with lots of python experience if you get what I mean.

So instead of reviewing each book I have,I've decided to list them here of the books I recommend to anyone starting out or looking to get something out of the pi.

Raspberry pi cookbook - simon monk
Get started with raspberry pi - simon monk
Python coding club - Chris roffey
Raspberry pi for secret agents - Stefan sjogelid
Raspberry pi for dummies
Raspberry pi projects - Robinson & cook
Haynes raspberry pi manual
Adventures in raspberry pi - Carrie-ann philbin
Raspberry pi user guide - upton & halfacree
Practical radpberry pi
Learn raspberry pi with linux

Ok huge list, but the list of books not to get exceed this, so to pick three to get you started I would choose:

Adventures in raspberry pi
Haynes raspberry pi manual
Raspberry pi cookbook

Enjoy.