Arduino Color Sensors - TCS230 & ISL29125

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ค. 2024
  • In today's colorful episode we will learn to calibrate and use the TCS230 and ISL29125 Color Sensors with an Arduino.
    Article with code at dronebotworkshop.com/arduino-...
    More tutorials and projects at dronebotworkshop.com
    Discuss this on the Forum at forum.dronebotworkshop.com
    Join the newsletter - dronebotworkshop.com/subscribe/
    Today we will be working with two different color sensors. I’ll show you how they work, how to hook them up, how to calibrate them, and how to extract RGB values from them.
    The TCS230 (also known as the TCS3200) is a popular and inexpensive color sensor that operates on a wide voltage range. It outputs a square wave whose frequency reflects the color intensity.
    The Sparkfun ISL29125 is a more capable sensor that provides a 16-bit digital output using the I2C bus. It also has a programmable interrupt feature that you can set to trigger in response to a specific color.
    Both of these sensors will be useful in designing color-following robots, Rubik's Cube solvers or jelly bean sorters. But before you use them you’ll need to calibrate them.
    I’ll show you how to calibrate the sensors and then use that calibration data to extract actual RGB values from them.
    Here is what we will be covering today:
    00:00 - Introduction
    01:15 - Color Sensor Operation
    02:51 - TCS230 Intro
    05:31 - TCS230 Arduino Hookup
    06:18 - TCS230 Calibration
    12:10 - TCS230 RGB Extract
    17:26 - ISL29125 Intro
    19:52 - ISL29125 Arduino Hookup
    21:46- ISL29125 Library & Calibration
    27:19 - ISL29125 RGB Extract
    You’ll find an accompanying article to this video at dbot.ws/color, along with all of the code I used.
    I hope that you enjoy this video and that it adds some color into your life!
    Thanks for watching!
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 98

  • @scottwood1143
    @scottwood1143 4 ปีที่แล้ว +11

    Wow, lots of great info here. It was good to have the demo and explanation of the calibration process, and then show how to normalize the sensor data for useful output. I’ll definitely have rewatch to understand better, and follow the link to the article. Always appreciate the time and effort you put into these projects. Thank you!

  • @tilmanaboeck6706
    @tilmanaboeck6706 4 ปีที่แล้ว +10

    To me the best tutorial channel by far. Thank you so much for your work.

  • @pfow2006
    @pfow2006 4 ปีที่แล้ว +1

    another great vid Bill, cant wait for break up so I can catch up on all your vids, and maybe some time to play with some hard ware

  • @WayneHe15
    @WayneHe15 2 ปีที่แล้ว

    Thanks a lot. This helps my one of my current project.

  • @pareshmhatre4019
    @pareshmhatre4019 4 ปีที่แล้ว

    Very detailed information
    Best video!

  • @MikeBramm
    @MikeBramm 4 ปีที่แล้ว +6

    Nice tutorial. Now I have a craving for jelly beans.

  • @pfow2006
    @pfow2006 4 ปีที่แล้ว

    wow you've really added more content.

  • @TheMcdrewb
    @TheMcdrewb 4 ปีที่แล้ว

    That is a nice workshop

  • @tpobrienjr
    @tpobrienjr 4 ปีที่แล้ว +1

    This is a good, very complete explanation of rgb sensing. My imaginary robot would use such a sensor and software to follow the red line through a room, ignoring the lines of other colors. Fun.

  • @youandi995
    @youandi995 2 ปีที่แล้ว

    Best explanation for how colour sensors works👍

  • @tinkmarshino
    @tinkmarshino 4 ปีที่แล้ว +1

    Bill you never cease to amaze me.. the subjects you choose to talk about... it is like you have some kind of direct connection to this scrambled brain of mine.. Many time I will have a discussion with or friend or another about something and there it is.. on your site .. Do me a favor next time your in there if you see the loose wire on my internat gps could you re solder it.. I seem to be having problems with my directions these days.. thanks my friend.. carry on.. it's all good!

  • @sledgeHammerRulez
    @sledgeHammerRulez 4 ปีที่แล้ว

    Tx professor arduino :p I just bought such color sensor and was looking for just this info. IOU! I will use it to retrieve the position of my garage door, together with colored tape ... But first I will finish (3D designing & printing) my 2 powerbenches from your other videos. KUTGV(ideos)!!

  • @JohnClulow
    @JohnClulow 4 ปีที่แล้ว +3

    I love this channel -- so glad I happened upon it. I'm looking forward to doing a project using the Spark Fun module you covered or perhaps a newer TCS offering, 34725, which has an IR filter. Commercial instruments I've used frequently use a 45°-0 angle of illumination relative to the angle of observation which is at 90° with respect to the plane of the subject as in your video. With the illuminant at a 45°, specular reflectance is minimized and diffuse reflectance maximized (angle of incidence = angle of reflection) so that the sensor sees less contamination from the white illuminant.

  • @jurgenpurps9720
    @jurgenpurps9720 6 หลายเดือนก่อน

    Wie immer ein tolles Tutorial - man kann sich immer auf deine Ausführungen verlassen - ich bin wie immer begeistert.

  • @defaulta51
    @defaulta51 8 หลายเดือนก่อน

    Is there a way to boost the distance say for instance i wanna point a laser at something and it tells me the color?

  • @dotancohen
    @dotancohen 4 ปีที่แล้ว +3

    @21:30 Why isn't the 3.3v ground connected also to the Arduino's ground? If I'm not mistaken, the logic level board's GND pin is to get a reference ground to compare to 3.3, not to provide a reference ground for the connected device.

    • @templebrown7179
      @templebrown7179 4 ปีที่แล้ว

      The two ground pins are connected.

  • @WhoWantsToKnow81
    @WhoWantsToKnow81 4 ปีที่แล้ว +1

    Excellent! This will be very useful for a candy bot that I hope to make (one day) :)

  • @wolfgangboettcher3126
    @wolfgangboettcher3126 4 ปีที่แล้ว

    Das wird richtig interessant

  • @raahimirfan5996
    @raahimirfan5996 4 ปีที่แล้ว +1

    Can I please know which animation software or video editing software is used here 1:15
    Thanks in advance!

  • @estianhattingh3624
    @estianhattingh3624 4 ปีที่แล้ว

    Love your vids😍😋

  • @aberateklehaimanot9804
    @aberateklehaimanot9804 4 ปีที่แล้ว

    Thank you.

  • @javierzarba4206
    @javierzarba4206 2 หลายเดือนก่อน

    Great video, but i have a question: i saw that you try the sensors placing the colour papers very close to them (to the sensors i mean). Is there a maximun distance to which they lose accuracy? and if so, where can i find this info? i would like to test the sensors in a wider distance. Thanks!

  • @rethinkscience8454
    @rethinkscience8454 4 ปีที่แล้ว +1

    Can you make a 3d measuring scanner probe which will digitise the real time space within a room

  • @xianyingzhang1106
    @xianyingzhang1106 ปีที่แล้ว

    Awesome, taught me a lot, thank you so much

  • @eastbandit23
    @eastbandit23 2 หลายเดือนก่อน

    Question
    Will the sensor still give out values if you remove the led lights?
    Thanks

  • @austinchang4891
    @austinchang4891 3 ปีที่แล้ว

    Great video

  • @vaughnscott1856
    @vaughnscott1856 4 ปีที่แล้ว

    My favorite

  • @wishicouldarduino8880
    @wishicouldarduino8880 4 ปีที่แล้ว

    You know better than doing anything to do with color or LEDs now i m gonna have a hundred of these things on the duce robot but it will be fun😁👍🌞

  • @valtherkjaer7129
    @valtherkjaer7129 4 ปีที่แล้ว

    Hello
    I know my question doesn't relate to the today subject
    Is there any way it possible to see which software there are flashed into an arduino (eg. grbl 09 or 1,1) thanks in advance

  • @creativekitties2741
    @creativekitties2741 2 ปีที่แล้ว

    I love your videos. Thanks for the good info! Great channel btw super underrated. 😊😸

  • @il400
    @il400 3 ปีที่แล้ว

    is it possible to use two isl29125's at the same time? my arduino is seeing both of them as the same address, i understand why but i'd like to know if there is a work around

  • @hughaskew6550
    @hughaskew6550 4 ปีที่แล้ว +1

    Why are the readings of the PW values so variable?

  • @busybraintinkering465
    @busybraintinkering465 4 หลายเดือนก่อน

    I'm in the process of making a bead sorter for my kids, but those beads are tiny! How would you approach that tiny read area? Ive thought about fiber optic, but im afraid there are to much loss and hard to attach the fiber to the sensor (TCS3200 in my case), or a focal lens, but im unsure how to focus it. Any advice?

  • @surenbono6063
    @surenbono6063 7 หลายเดือนก่อน

    ..how to software decode color in SD card file at certain coordinate on that file?... Example: decode timezone & country name with GPS coor on a 2d color world map file just by software..

  • @startobytes
    @startobytes 4 ปีที่แล้ว

    Hi could you make it with you about the nrf24l01 Module and how to Connect it with the Arduino Uno?!

  • @tatianasilatchom200
    @tatianasilatchom200 2 ปีที่แล้ว

    please these are what values ​​you are getting as output? I would like to know

  • @techsl1829
    @techsl1829 ปีที่แล้ว

    Let me know, can it use single sensor LED instead of four 4 led to detect small point

  • @valtherkjaer7129
    @valtherkjaer7129 4 ปีที่แล้ว

    whats the difference between to download(to run a sketch) or flash a bootloader a grbl

  • @mastermoarman
    @mastermoarman 4 ปีที่แล้ว

    Have you considered trying a adafruit TCS34725

  • @andymouse
    @andymouse 4 ปีที่แล้ว

    great!

  • @GMan12321
    @GMan12321 4 ปีที่แล้ว +3

    Love your channel. Questions.. Why must we use the logic converter for the second sensor, if we can make it work without it? Strengths and weaknesses of using a logic converter for such a circuit?

    • @kissingfrogs
      @kissingfrogs 4 ปีที่แล้ว +2

      Is that level shifter? or logic converter? Assuming level shifter then I think a level shifter/converter attempts to ensure that the 0-5v outputs are accurately level shifted for the 0-3.3v inputs. There are other ways to do this with various associated tradeoffs.

  • @marcelbron6128
    @marcelbron6128 4 ปีที่แล้ว +1

    I reall appreciate your work, thank you very much. I have a question about the constrain command for the ISL29125 sensor. Why is it set to 255 (8 bits?) when the sensor is capable of producing a 16 bits value of 65536 ? Thanks for your efforts and time, kind regards from the Netherlands.

  • @joseyanez2342
    @joseyanez2342 4 ปีที่แล้ว

    Can I calibrate ISL29125 sensor with an recently calibrated sRGB monitor and then calibrate an RGB LED?.

  • @GJGAMES
    @GJGAMES 3 ปีที่แล้ว

    This really helped my i tried to make a color sorter for my finally school project but i couldnt get it done. so i had a raspberry pi but i couldnt find any info on how to do it with raspberry pi. so i bought an arduino i watched your video a second time and finally got it. Now im probably able to do this with a raspberry to because i know understand why i have to use that raw data code and how to. so i subscribed and liked.

  • @scotchcrofter9964
    @scotchcrofter9964 4 ปีที่แล้ว

    Cool

  • @davitkooliver3856
    @davitkooliver3856 2 ปีที่แล้ว

    How can I set different pins if I want use other than A4 and A5 ? For example A0 and A1.

  • @papageorgiou4355
    @papageorgiou4355 3 ปีที่แล้ว +1

    2 questions, first why you use 255 as you max and not 65535 which is the max of the data type that you are using (int) to have a better resolution, and second why you selected 20% width scaling? i think the arduino wouldnt have any problem for the 100% which based on the datasheet of the sensor has a typical value of 600khz

    • @cyabd8515
      @cyabd8515 2 ปีที่แล้ว +1

      I wish he would answer these questions

  • @skillerlarva8270
    @skillerlarva8270 10 หลายเดือนก่อน

    Sir do you have modul library fritzing TCS230/3200 , If you have I need

  • @EwertonMoreira80
    @EwertonMoreira80 3 ปีที่แล้ว

    Will it work with liquids?

  • @devanshubansal3144
    @devanshubansal3144 2 หลายเดือนก่อน

    can i interface arduino uno directly with ISL29125 sensor without logic controller b/se I don't have that one?

  • @premprasad3511
    @premprasad3511 2 ปีที่แล้ว +1

    Excellent tutorial again ! I cannot understand one point though: How to choose the frequency scaling value ? Yes, it is 20% for arduino, but what is the basis ? What if I have a another controller like say a microbit ? How about a raspberry pi ? Any response will be very much appreciated !

  • @perfectpakka8151
    @perfectpakka8151 3 ปีที่แล้ว

    Someone pls help me!
    Can I use ISL29125 as a optical receiver (or as an alternate to a Photodiode)?
    How much will be maximum distance so between the sensor and the subject so that it will be able to sense properly?

  • @taruntanwar8369
    @taruntanwar8369 2 ปีที่แล้ว

    Is it able to detect dust color?

  • @shaheerahmed4746
    @shaheerahmed4746 11 หลายเดือนก่อน

    can w make this exact circuit using arduino nano?

  • @littlesmallmook5406
    @littlesmallmook5406 2 ปีที่แล้ว

    10:16 What is the unit of those value?

  • @johnflores8810
    @johnflores8810 ปีที่แล้ว

    Can I make multiple color sensor in just one arduino board ?

  • @muhammadaqil2869
    @muhammadaqil2869 3 ปีที่แล้ว +1

    perfect tutor...would you plz make tut for HSL or HSV color sensing using ISL censors?

  • @henrikjensen3278
    @henrikjensen3278 4 ปีที่แล้ว +1

    I recently needed a color sensor and found one called TCS34725, it is also a digital sensor like the ISL29125, but has a 5V interface on the module and a white led. Because I needed the color I made a function to return the hue (from the color circle), it is much more useful when wanting to detect a specific color.
    To detect blueish I can use "if (hue>240-30 & hue

    • @cyabd8515
      @cyabd8515 2 ปีที่แล้ว

      Can you explain this more please, I'm also interested to use the Hues thanks.

  • @quadracycle4000
    @quadracycle4000 4 ปีที่แล้ว

    Could've used the plotter for those, no?

  • @farougshiyab
    @farougshiyab ปีที่แล้ว

    Hello...
    I have a project that needs a color recognition sensor with longer Detection distance(400 mm)

  • @ArifRahman-ex2vx
    @ArifRahman-ex2vx ปีที่แล้ว

    Sir, is it possible to make white colour censor scissor

  • @dotancohen
    @dotancohen 4 ปีที่แล้ว +2

    Hi Bill! At @20:15 there are four white LED lamps used for illumination. Instead of powering each one via a resistor, wouldn't it be better to power them two in serial with a smaller 100Ω resistor? The 100Ω will prevent a power surge when the LEDs are initially powered and have little resistance, and after that the circuit will use much less power.

  • @4STEVEJOY34
    @4STEVEJOY34 4 ปีที่แล้ว

    Have you done a video on using a "#-Channel Relay Module" with an Arduino? Working my way through all your videos. Thanks

  • @awaagrikh8331
    @awaagrikh8331 2 ปีที่แล้ว

    hi, can it detect color of liquid?

  • @Al_Maha_Alateef
    @Al_Maha_Alateef 13 วันที่ผ่านมา

    I want this dataset how to get it from you?

  • @basemaus3728
    @basemaus3728 4 ปีที่แล้ว

    I have hooked my tc3200 sensor up, just like you described it and used your code,
    i am receiving data from it, but the rgb values stay 0,0,0,
    also, the leds won't turn on.
    Could you or anyone give me some advice to fix it?
    because i don't know whats wrong

    • @Oh-ou4lp
      @Oh-ou4lp 3 ปีที่แล้ว

      Check that its wired right, if it is then led should light up mine had 2 out of 4 the other 2 were in backwords(thanks china)

  • @Abdelhamid_Helal
    @Abdelhamid_Helal 3 ปีที่แล้ว

    Why didn't you add this video in playlist? Sometimes , I don't find some videos in playlist.

  • @julienmina7276
    @julienmina7276 4 ปีที่แล้ว

    💎🌲🥇 perfect

  • @bahrilnugroho1474
    @bahrilnugroho1474 3 ปีที่แล้ว

    when i check the black colour , the value showed negative , what happen? please help , thankyou

  • @jump_on_it8381
    @jump_on_it8381 ปีที่แล้ว

    Hi!, I'm new to the arduino and am wondering if you could use analog pins instead of digital pins for the connecting of the colour sensor.

  • @byronwatkins2591
    @byronwatkins2591 4 ปีที่แล้ว +1

    If the delay is to allow the sensor to stabilize, why do you read the sensor BEFORE it stabilizes? I would think that select color, stabilize, and then measure would be the correct order.

  • @bahrilnugroho1474
    @bahrilnugroho1474 4 ปีที่แล้ว

    i get negative value for dark brown, i calibrated the sensor using dark roasting coffee bean and light roasting coffee bean , can you tell me the reasin why i got negative values? please i really appreciate if anyone can help me

  • @syedshozab3305
    @syedshozab3305 4 ปีที่แล้ว +1

    Can we calibrate the sensor for other than red,green an blue color?what changes would be required in the code?

  • @noZionism1
    @noZionism1 3 ปีที่แล้ว

    Hello,
    one question please, can I use ESP8266 instead Arduino uno controller? Which pins can be used for sda and scl?
    Thanks a lot!
    Nidal

  • @arjunps8349
    @arjunps8349 2 ปีที่แล้ว +1

    Why am I always getting FFFF from isl29121

  • @tinsp253
    @tinsp253 ปีที่แล้ว

    Hi, hope everything goes well. May I ask if this sensor able to sense the color of the water?

  • @hariharankrishnan7189
    @hariharankrishnan7189 2 ปีที่แล้ว

    Dear Sir! Thank you for the tutorial. I have a doubt. @21:19 How to test, whether my ISL29125 sensor hardware works fine or not? Is there any way to check it? Currently, I have Uno, TXB0108 Bi-directional Level Shifter and ISL29125 sensor wired up and I couldn't able to observe any readings on my Serial Monitor? Can you please help in troubleshooting the sensor? Thanks and Love from India...

  • @theronsosachavez2757
    @theronsosachavez2757 ปีที่แล้ว

    Is there a way to know the wave length of the light detected in nano meters once we have received the values of the sensor?

  • @wolfgangboettcher3126
    @wolfgangboettcher3126 4 ปีที่แล้ว

    Ok nicht vergessen den helper programmer

  • @nextwave5164
    @nextwave5164 3 ปีที่แล้ว

    RGB(0,0,0) = black RGB(255,255,255) = white. The output from functions confused me for a sec, then i thought .. return 255 - PW = more sense .. just me though ;)

  • @hazqier
    @hazqier 2 ปีที่แล้ว

    Is it normal for me to get values up in the hundreds?
    Regardless of the values, after calibration, the RBG values seems to be accurate. Thank you for the tutorial.

  • @poepflater
    @poepflater 3 ปีที่แล้ว

    all LEDs are photo diodes and can be used as inputs as well as outputs... Going to let you think about that for a second.

  • @user-oi2ny9jf8l
    @user-oi2ny9jf8l 3 ปีที่แล้ว

    有没有翻译官

  • @slakjawnotsayin5451
    @slakjawnotsayin5451 ปีที่แล้ว +1

    Darn, I was hoping the sensors wouldn't need a delay to stabilize, and would be able to pick up a colored light as it passes by the sensor quickly.

  • @marielysbrijaldo9237
    @marielysbrijaldo9237 2 ปีที่แล้ว

    Nice video but have a doubt. When you´re explaining the redPW, greenPW, bluePW functions i think you got wrong. You defined S2 & S3 as LOW (both) in redPW function which is cool, but you switched S2 & S3´values in greenPW and bluePW functions and I wonder why?
    I mean, as you explained before we have to set-up
    - for RED: S2(LOW) & S3 (LOW)
    - for GREEN: S2(L) & S3(H) *
    - for BLUE: S2(H) & S3(H) *
    In the GREEN and BLUE cases you coded it different. I don´t know if I´m explaining my doubt well.

  • @420Sumanta
    @420Sumanta 8 หลายเดือนก่อน

    I think the white LEDs have impurity and the code needs something called as "gamma correction" or "white balancing" to cancel out the influence of the blue tinted white LEDs.

  • @wolfgangboettcher3126
    @wolfgangboettcher3126 4 ปีที่แล้ว

    Ich weiß der Sensor ist in Ofen verbaut

  • @paulabraham2550
    @paulabraham2550 4 ปีที่แล้ว

    Using the constraints in this test program is not a good idea - you want to know if you are getting out of range values. For example the 0, 0, 0 values for black looks perfect but you cannot know that you're not masking huge negative values there and that the calibration is actually way out.
    You'd probably need it in the final application, though.

    • @kamii3783
      @kamii3783 3 ปีที่แล้ว

      So, how would you do it? it would be very helpful

  • @yuvigerstein
    @yuvigerstein 2 ปีที่แล้ว

    1.5x

  • @big_guy9604
    @big_guy9604 4 ปีที่แล้ว

    Not nearly as interesting as Ground Hog Day. Silly......