This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1230E6PM: TM4C123G

Part Number: TM4C1230E6PM
Other Parts Discussed in Thread: ENERGIA, CC3100

Hi folks,

I am having difficulties in the following task: reading data from a light sensor.

I am working on a TM4C microcontroller and the light sensor is a Grove light sensor that came along with the Grove starter kit.

Problem 1 : workshop 14 of C-series covers light sensors but from the senshub booster pack

Problem 2: the manual that came along with the Grove pack covers reading from alight sensor but on energia and for TM1637 while I am using CCS and TM4C123. Here any insight on how to modify the code will be appreciated

Problem 3: I need to read data from a second light sensor, where to I connect (cables) the new light sensor, i.e. do I need a new Grove kit or any unused port will work?

PS:

1) I was using the workshops as a basis so I never used the grove kit before (for example, in TM4C I could use portD01 and portE45 for 2 light sensor but I do not know how the mapping works for the grove board)

2) I am new to TM4C but learning quickly

3) All available ressources: TM4c123G, LAUNCHXL-CC2620, Grove Starter kit, Educational BoosterPack MKII (this one has light sensors so it can be used as replacement for the grove), Touch LCD BoosterPack, CC3100 BoosterPack

Any help is welcome

Please feel free to notify me if any tag is missing or if it is the wrong forum section

Cheers

  • Marwan,

    I am not familiar to what is a Grove kit. Maybe you should describe better what type of sensor is it: analog output? spi? uart? on/off?

    TM4Cs have lots of ports, analog inputs, etc. It will be relatively easy to use many sensors at the same time.

    Regards

    Bruno

  • Hi Bruno,
    The grove kit is a board that you connect on top of the TM4C. I did a bit of digging on the grove light sensoor and found the description below:
    "The Grove - Light Sensor module incorporates a Light Dependent Resistor (LDR). Typically, the
    resistance of the LDR or Photoresistor will decrease when the ambient light intensity increases.
    This means that the output signal from this module will be HIGH in bright light, and LOW in the
    dark." (from link below)

    Can you please check this link: www.mouser.com/.../Seeed_101020022.pdf part 4.2. It contains also the code that came with the grove manual from light sensors (I was referring to it in my previous post)

    I am familiar with the different ports of TM4C and using different sensors (using senshub), it is just that I need guidance on how to map the ports with the different plugs available on the Grove board.

    Best,
    Marwan
  • Marwan,
    While I won't be able to check the datasheet so soon, I might be able to give you further advice:
    LDR works just fine with GPIO's. They are not designed for light measurement, rather for telling dark from bright. A GPIO configured as input will work just fine. You can also try to use your input pins as analog input to try to evaluate intensity, but there won't be too much of a linear or repetitive behavior.
    Being the ON/OFF feature enough for you, you need to look at the pinout for your sensor board, and see which pin brings the signal from the sensor - and map accordingly on your MCU. So basically, the answer lies on the GROVE BOARD DOCUMENTATION.
    To use more sensors, you will need to verify that there are actually sensors on different physical positions - otherwise, you will need to route cables to other available GPIO's. But you will easily find LDR's (and actual light sensors) available as individual pieces, and you can later create your own circuit for that with no need for a specific "sensor booster board".
    Regards
    Bruno

  • Bruno,

    I checked the manual of the Grove for possible mapping before posting the problem but it only has the mapping with MSP430. But you are right the mapping should be available so I will check online sources/ documentations.

    PS: I will verify your answer after checking the online documentation

    Thanks
    Marwan