Search Tom's Pi Adventures

Friday, May 9, 2014

CARBMC

CARBMC

Using the principles from my Raspbmc post, I made a Pi setup with a step down transformer from 12VC to 5V to use a Pi in my car. I had one screen in the front and two in the back (for the kids) to watch movies on long drives.

This worked REALLY well as I could plug the sound from the 3.5mm jack of the Pi into the car stereo and use a mini keyboard connected via bluetooth to the Pi.

There was a lot of cabling and I connected the video signal over the RCA composite connector with splitters. Not the best picture in the world but it kept the kids silent so I could talk to the wife :-)

Win Win situation

Sentry

Sentry Project for the Pi

I did some tests last night. I found that the Motion app for Linux natively outputs that pixels that have changed in an X and Y value. There is also a section in the config that allows you to run a script when motion is detected.

I wrote a bash script which receives input from the motion app %K for x and %L for y to calculate the pulse length to drive my servos using servoblaster and some calculations to convert the x value into a value between 80 and 220 for the pulse width of the servo.

For example with the x value %K I fed that into my batch script, times it by 140 (difference between 80 and 220) and divided it by 1024 (numbers of x pixels in the image) and add 80 onto the end of it to get the starting point of the pulse width to send to the servos (remember range 80 --> 220).

The response time is impressive. Now to connect it to my prototype and see how it responds in real life.

------------------------------------------------------------------------------------------------------------

Hmmmmmmm, interesting read for CSI camera integration with Motion (Linux motion detection software) and MMAL use with some custom Python code:
http://www.maketecheasier.com/raspberry-pi-as-surveillance-camera/

------------------------------------------------------------------------------------------------------------

I was working on a sentry using the CSI Camera module that came out for the Raspberry Pi. But at the moment the response time using Python and OpenCV was rubbish. I need to do some more research into MMAL programming first.

What I was using:

  • Automatic NERF gun
  • External power supply connected to the NERF gun (instead of batteries)
  • 3 x 5V servos to move:
    • Tilt the gun to aim only for the torso
    • X Axis to swivel 180 degrees only
    • Trigger mechanism to pull the trigger once a warning to retreat has been given
  • I used the same external power supply for the NERF gun to power the servos
  • Cut up some MDF to make a box to store the Pi in and house the cabling and also to make a mount for the gun and a disc for it to swivel on the X Axis
  • CSI Camera module connected to the Pi directly (not USB) to utilise the GPU instead of the RAM and CPU
  • Hours and Hours and Hours of programming to no success. Well limited success, it was working, just the response time to act and send the signal to the servos was around 1.5 seconds which was good enough for the Zombie Apocolypse.
Once my programming skill evolve and I learn more about MMAL and facial recognition I will return to this project.

RaspBMC

RaspBMC

As the name suggests there is such a thing called Raspberry Pi with the XBMC interface.

For a NOOBIE this project is a good place to start. All you will need:
Step 1. Grab your SD Card and load it with the RaspBMC image from:
Step 2. Follow the instructions to put the image on your SD Card:
Step 3. Boot your RaspBMC for the first time. Plug in the SD card to the Pi and then plug in the Micro USB             Cable to boot it up. Connect your HDMI cable to the Pi and also into your TV or HDMI Monitor.
Step 4. Wait approximately 1 hour for all updates and configuration to be applied.
Step 5. Download YATSE (Android) or XBMC Remote (iPhone) and find your Pi on the network to                       control it
Step 6. You can either setup SMB (in configuration) or simply use a USB Disk or Stick to put movies onto               the RASPBMC. Sit back and watch the Magic happen.

Thursday, May 8, 2014

LINUX CNC Mill

Tomorrow I start the build. Draw runner in hand and Stepper motors are sitting in my letter box waiting for me to get home. The exciting part starts now, building the frame and figuring out how to set the motors up on the frame to do what I need. I think Bunnings is going to get a visit on Sunday when I need long threaded rod and a long not for it to wind through.

SO EXCITING!!!!!

------------------------------------------------------------------------------------------------------------

Just found some cheap draw runners I can use at IKEA. Cheap too :-)

----------------------------------------------------------------------------------------------------------

Just got word from EBay that my stepper motors and controllers have been posted. Just to wait now to hear from Hong Kong post on an ETA.

Reflashed my SD Card last night in preperation and got it working on my home network.

Ordered some draw runners from EBay too... I love it when a plan comes together!

------------------------------------------------------------------------------------------------------------

My next Raspberry Pi Project is to create a CNC Mill / Cutter.

What I think I will need as a project start:

  • Raspberry Pi - Check!
  • Stepper Motors and Controllers - On order from Hong Kong
  • Mounting brackets for stepper motors - TBA
  • Micro USB Cable to power the Pi - Check!
  • Jumper cables to connect the Stepper Motors - Check!
  • Draw Runners for A, X and Y axis - TBA
  • Timber Requirements for prototype frame - TBA
  • Dremel Tool - Check!
  • Drill Bit for Dremel Tool - TBA
  • Mounting brackets for Dremel Tool - TBA
  • Laser Cutter - Once prototype is complete I will look into this - Safety needs to be considered
  • LinuxCNC Software - Check!
  • Threaded Rod, Bearings, Long nuts, Screws and Mounting Brackets - TBA
This will be a project that will take some serious investment with my time. I am planning for a 12 Month Solultion for a prototype. Also working on the BEERMON project. $$$ are the issue at the moment.

BEERMON

To start this blog, I will begin with my first "real" invention that I have called the "BEERMON". What is BEERMON I hear you ask???

Purpose:

  • Brew beer with electronic information available
  • Notify the user daily via email with brewing stats
  • Display Brewing stats in real time on an LCD display
  • Have a webpage available to be able to view brewing stats from anywhere
Parts Used:
  • LCD display with an I2C interface built in
  • 2 x temperature sensor probes to test the ambient temperature and also the fridge internal temp
  • 1 x Heater to place inside the fridge to help regulate temperature
  • 2 x 5V / 240V relay switches to turn on the fridge/heater depending on fridge termperature
  • Raspberry Pi Model B 512MB
  • Female --> Female Jumper Leads
  • 2 x Hacked up Power Extension leads for relay input and output
  • 1 x ultrasonic sensor to test hydrometer depth
  • 1 x WiFi dongle for wireless network connection
Results so far:
  • Temp Monitoring is working
  • Relays turn on/off as needed for heater / fridge
  • Daily email notifications are working
  • LCD display is working
  • Ultrasonic sensor is working
  • Monitoring web page is working as well as WiFi config from webpage
My Prototype is ready to test a brew. I just need to wait until I have enough cash to purchase a bar fridge, heater, brew kit and parts to make a tube for the hydrometer and to mount the ultrasonic sensor.

MORE UPDATES SOON. I WILL POST PICS SOON TOO.