profmason.com

June 2, 2009

Laser photocell timer

Filed under: Daily — profmason @ 6:04 pm

Using a $1 store laser pointer and a 10K CdS cell I built a simple timer. 

The laser beam is centered on the photocell.  This drops the resistivity down very low.  The photocell is part of a voltage divider and tied into a digital input on a PIC 12F683.  A 5K pot is used as the other half of the voltage divider to give some ability to adjust for background.

  1. When the laser is on the photocell the input is low, and when the laser is blocked, the input goes high.  A polled interrupt is setup to look for a High to Low transition.
  2. When the interrupt is triggered, the interrupt is set to look for a low to high transition (The cell becoming unblocked.)
  3. When this triggers, the interrupt  is reset to look for a high to low transition and a timer is setup and updated every 10ms.
  4. Finally when the interrupt is triggered, the total time is output to a serial LCD display.

I built a shroud around the photocell using a piece of heat shrink which does a great job of cutting out background light.   The laser does drop off in intensity after running for 30 minutes or so, so buy several (at a $1 each it is cheaper then batteries.)

I used a set of helping hands to hold the photocell and the laser pointer, which makes a cheap easy system to adjust the cell and laser pointer.

May 12, 2009

Sure Electronics Bluetooth module

Filed under: Daily — profmason @ 8:36 pm

I picked up a SMD bluetooth module from Sure electronics.  It contains a bluetooth radio and is touted as a serial cable replacment with a 10m range.  Sounds like just the thing for a robotics project.  Unfortunately, after too many hours fighting with it, I can only get it to work in one direction. (Transmit)  This tells me that I have everything wired correctly and am doing the level conversion correctly.  I am able to send data from the laptop to the module via bluetooth and then monitor what the module is receiving by the uart.  However, I can’t send anything from the module back to the PC that it is linked with.

April 24, 2009

Robotics Team

Filed under: Daily — profmason @ 9:11 pm

March 17, 2009

Controlling IR devices from Roborealm

Filed under: Daily — profmason @ 8:27 pm

One of the latest exciting additions to the Roborealm software is the inclusion of a driver for the USB-UIRT. This device is a USB based programmable IR emitter. You can use it in conjunction with roborealm to quickly and easily control a variety of consumer grade robots and toys. In this tutorial I will show you how to control your ISOBOT robot with Roborealm.

The requirements for this tutorial are:

  • Roborealm software available here.
  • USB-UIRT hardware ($50)
  • TOMY ISOBOT ($100)
  • Webcam (optional)
  • PC Joystick
  • First we will look at using a joystick on your PC to control the ISOBOT. The Basics: Be sure to download roborealm from www.roborealm.com.   It is a free download and will install into a folder which you can copy to your program files. 
     Open up the roborealm software and select Interface -> Joystick.  You should see a window that looks like the one on the below.  

    For our purposes, we will use the joypad to control the ISOBOT.  I notice that by moving the joypad, the values in the View Switch box change.  I will define a vara\aible called “joypad” by typing that into the drop down box under viewswitch.  This variable will change as I move the joypad. I notice that in my case joypad takes the following values:

    1. Forward    0
    2. Right        9000
    3. Backward 18000
    4. Left          27000

    I will use these values to control the ISOBOT.  Now go ahead and close the joystick mapper by selecting OK.
    Next we need to setup the USB-UIRT Device.  Select Control -> Other -> USB_HID.  When you double click on the item you should see the window below:

    To start off we will just define four basic actions for the robot:

    • Move Forward (Corresponding to pushing forward on the ISOBOT remote)
    • Turn Right (Corresponding to pressing diagonally Right on the remote)
    • Turn Left (Corresponding to pressing diagonally Left on the remote)
    • Move Backward (Corresponding to pulling backward on the remote)

    We will need to complete the following four steps to program the USB-UIRT with a command for the ISOBOT.

    1.   First we need to give the command a name and then learn the command.  In the dialog box type in a name for the command.(Such as forward)  Then press the LEARN Button. 
    2.  When you press the A dialog will pop up.  Point the ISOBOT remote at the USBUIRT.  Press and hold the stick forward until the light on the USBUIRT blinks three times and the dialog disappears.  You should now see a code in the IR Code window.  You can test this code by turning on your ISOBOT and pressing the test Transmit button.  If everything is working correctly, your ISOBOT should move forward when the Test Transmit button is pressed. 

    3. Now we need to attach the command you just learned to the joystick.  In the variable dropdown box, select the variable that you created in the Joystick dialog (joypad).  Since we know that the joypad is going forward when it has a value of 9000, we will select Set and then Equal in the next box.  In the last box we will select a value of 9000.  Now click the New button on the right hand side, and your actions will be saved.  You may choose to have the USB-UIRT light up on transmitting and the number of repetitions.  If you are having trouble, you might try decreasing the number of repetitions to prevent interference between subsequent repetitions. 
    4. Now you need to repeat this process for each of the four signals that you might be interested in.  


    Now play with your robot!  You can watch a movie of my ISOBOT running around under Computer Control below.  I show the joystick briefly during the video.

    You might want to try the path planning tutorial using your new Roborealm controlled ISOBOT!

    March 14, 2009

    This dog wants to go to the University of Plymouth

    Filed under: Daily — profmason @ 7:27 pm

    Speech recognition and synthesis are demonstrated in the context of a robotic dog that wants to get into the MSc in robotics program at the University of Plymouth. The mouth movements use viseme triggers with a look forward algorithm to predict future movements. A single layer neural net is implemented for emotional modeling. There is interesting behavior when the dog really wants to walk resulting in manic wiggling and ignoring speech prompts until he is calmed down.

    Older Posts »

    Powered by WordPress