Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Using the Parallax ColorPAL Colour Sensor module with PICAXE chips

  1. #1
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,114

    Lightbulb Using the Parallax ColorPAL Colour Sensor module with PICAXE chips

    As a continuation of assisting forum member tonyg with using the Parallax ColorPAL colour sensor and colour generator module,
    I have prepared the attached tutorial which may help others with the required hardware connections and basic PICAXE programming
    to use the ColorPAL module.
    Access to a ColorPAL module was courtesy of tonyg and The Hex to Decimal subroutine in the program examples is unashamedly one written recently by hippy.
    Last edited by westaust55; 25-03-2012 at 03:59.
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  2. #2
    Senior Member
    Join Date
    Feb 2009
    Location
    st albans
    Posts
    987

    Default

    Westy, what a superb tutorial,thank you. Saved in my Grimoir'
    R.

  3. #3

    Default Using the Parallax ColorPAL Colour Sensor module with PICAXE chips

    I hope it's ok to resurrect this thread rather than starting a new one. Fantastic detail in the tutorial but I'm having some trouble. My daughter and I are working on a color sorter for a science project. We're using a Picaxe-28X1 (AXE020) and the ColorPal. I am testing my setup with the code at "7.3 Simple program for M or X1 PICAXE". So far after download I am getting no response in the PE terminal.

    picaxe_colorpal.jpg

    Two questions: am I connecting to the correct ports? Is there a specific diode I should use? I'm not at all familiar with diodes and found that RadioShack has a few hundred to choose from. I have tried both of these at the suggestion of the less-than-helpful RS clerk:

    http://www.radioshack.com/product/in...ductId=2062589
    http://www.radioshack.com/product/in...ductId=2062576

    Any help is appreciated. Thanks!
    Attached Images Attached Images
    --
    Robert

  4. #4
    Technical Support
    Join Date
    Jan 1970
    Location
    Bath,UK
    Posts
    5,424
    Blog Entries
    1

    Default

    Welcome to the forum.

    Wrong connection points on the project board - you are connected to the 'buffered' open-collector outputs.
    You need to connect to the row of the holes between the two chips - which is then a straight connection to the PICAXE pins.
    PICAXE Technical Support

  5. #5

    Default

    Quote Originally Posted by Technical View Post
    Welcome to the forum.

    Wrong connection points on the project board - you are connected to the 'buffered' open-collector outputs.
    You need to connect to the row of the holes between the two chips - which is then a straight connection to the PICAXE pins.
    Thank you. So both 3 & 7 need to be in that middle row?
    --
    Robert

  6. #6
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,114

    Default AXE020 with ColorPAL

    Quote Originally Posted by rhampton View Post
    Thank you. So both 3 & 7 need to be in that middle row?
    No, with reference to your photo/image, the green wire to the bottom left stays as shown. Only the green wire to the ULN2803 at right side must be moved to the point between the two chips.

    See the attached marked-up AXE020 schematic.

    Two reasons for the need to move the wire:
    1. As Technical mentions, the ULN2803 outputs are open collector, so nothing to pull the signal high - unless you add a pull-up resistor
    2. The ULN2803 inverts the PICAXE output signal so the ColorPAL would not recognise the signals/data - unless you also invert the mode (iNverted versus True) for the SEROUT command.
    Attached Images Attached Images
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  7. #7

    Default

    Quote Originally Posted by westaust55 View Post
    No, with reference to your photo/image, the green wire to the bottom left stays as shown. Only the green wire to the ULN2803 at right side must be moved to the point between the two chips.

    See the attached marked-up AXE020 schematic.

    Two reasons for the need to move the wire:
    1. As Technical mentions, the ULN2803 outputs are open collector, so nothing to pull the signal high - unless you add a pull-up resistor
    2. The ULN2803 inverts the PICAXE output signal so the ColorPAL would not recognise the signals/data - unless you also invert the mode (iNverted versus True) for the SEROUT command.
    Got it. Any suggestions on the diode? I've tried your test routine as well:

    SYMBOL sinp = 7
    SYMBOL sipp = pin7
    SYMBOL sout = 3

    CP_Reset:
    LOW sout
    HIGH sout
    DO UNTIL sipp = 1 : LOOP
    LOW sout
    PAUSE 80
    HIGH sout
    PAUSE 10
    RETURN

    If I understand it sending "= R !" from the PE terminal window I should turn on the red LED. Instead I get back "נננננננננננננננננננננננננננננננננננננננננננננננננ נננננננננננננננ¥¦נננננננננננננננננננננננננננננננננ נננננננננננננננננננננננננננננננ¥¦" and no red LED. The diode is the only thing I can think of that I might have wrong.

    Thanks!
    --
    Robert

  8. #8
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    11,114

    Default

    For the diode, the second link you gave for the 1N914 signal diode would be the better selection.
    Do you have the diode the correct way? The end with the band needs to be towards the PICAXE Output pin.

    Yes, after the ColorPAL is reset/initialised, sending "R!" should turn on the red LED.
    But it will only turn on the Red LED. you would need to send additional commands to initiate the taking of a sample of light levels

    If you are sending R! from the PE then your PICAXE code will be different to the example I have provided to get folks going.
    Can I suggest that you try the PICAXE X1 example code I have provided first and then, when you have some valid activity then move on the adding comms from the PC and the PICAXE.
    See if you can get the Version number returned first to verify that you have valid comms occuring.

    If still no luck, then post a photo of your project taken perpendicular (not slanted) and clearly showing each end of each wire so folks can trace through the circuit to verify if the wiring is right.
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  9. #9
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    19,930

    Default

    Quote Originally Posted by rhampton View Post
    If I understand it sending "= R !" from the PE terminal window I should turn on the red LED. Instead I get back "נננננננננננננננננננננננננננננננננננננננננננננננננ נננננננננננננננ¥¦נננננננננננננננננננננננננננננננננ נננננננננננננננננננננננננננננננ¥¦" and no red LED. The diode is the only thing I can think of that I might have wrong.
    Not sure what you're really trying to do, how you have things wired or what PICAXE program you are using, but what you see on the Terminal display is typical of the 'garbage' received from the PICAXE when sending data to the download serial in.

    Seems you have your cable connected to the PICAXE not the ColorPAL sensor.

  10. #10

    Default

    Quote Originally Posted by westaust55 View Post
    For the diode, the second link you gave for the 1N914 signal diode would be the better selection.
    Do you have the diode the correct way? The end with the band needs to be towards the PICAXE Output pin.

    Yes, after the ColorPAL is reset/initialised, sending "R!" should turn on the red LED.
    But it will only turn on the Red LED. you would need to send additional commands to initiate the taking of a sample of light levels

    If you are sending R! from the PE then your PICAXE code will be different to the example I have provided to get folks going.
    Can I suggest that you try the PICAXE X1 example code I have provided first and then, when you have some valid activity then move on the adding comms from the PC and the PICAXE.
    See if you can get the Version number returned first to verify that you have valid comms occuring.

    If still no luck, then post a photo of your project taken perpendicular (not slanted) and clearly showing each end of each wire so folks can trace through the circuit to verify if the wiring is right.

    I am using the example code at "7.3 Simple program for M or X1 PICAXE". I have tested all of the wires with other i/o devices to ensure they are not broken, including signal and direction through the diode. Below is an image of my project. Hopefully someone can find something wrong because this is driving me crazy. I'm by no means an expert but this shouldn't be so difficult!

    Thanks again!
    --
    Robert

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •