+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 2
    Points: 24, Level: 1

    Join Date
    Jul 2019
    Posts
    2
    Helped
    0 / 0
    Points
    24
    Level
    1

    Portable luxmeter (Arduino + TSL2561)



    I decided to make luxmeter, which has basic functions:
    1. measure lux from 0 to 188000 lux
    2. calculate watts/m2
    3. charging using USB cabel via TP4056 board

    Basic sensor is MAX44009, which measure lux. I use Arduino Pro Mini as microcontroller.
    Totally it cost cca 13 $. Case is homemade.
    Power consumption - 15 mA.

    for more info: https://www.instructables.com/id/Portable-Luxmeter/

    BOM:




    BOM:
    Arduino Pro Mini 5V
    Link: https://www.aliexpress.com/item/3290...7652c7f0a9951a

    MAX44009

    0.045 Lux to 188,000 Lux Range
    VCC = 1.7V to 3.6V
    ICC = 0.65µA Operating Current
    -40°C to +85°C Temperature Range
    Link
    https://www.aliexpress.com/item/3282...7652c7f0a9951a

    OLED display
    Link: https://www.aliexpress.com/item/3283...7652c7f0a9951a

    Diagonal Screen Size:0.96"

    Number of Pixels:128 x 64

    Color Depth:Monochrome (Yellow&Blue)

    Dimension:27.8 x27.3x 4.3 mm

    Working Voltage: 3.3~ 5V DC

    Power: 0.06W

    MaxViewing Angle: >160 Degree

    Duty:1/32Brightness ( cd/m2):150 (Typ) @ 5V

    Interface: I2C



    TP4056
    input 5V
    Link: https://www.aliexpress.com/item/3245...7652c7f0a9951a


    Li-Ion battery

    3 - 4.2 V
    Link: https://www.aliexpress.com/item/3280...7652c7f0a9951a

    18650 holder
    Link: https://www.aliexpress.com/item/3265...7652c7f0a9951a

    Switch jumper
    Link: https://www.aliexpress.com/item/3292...7652c7f0a9951a

    Dupont cable a pin headers
    Link: https://www.aliexpress.com/item/3288...7652c7f0a9951a

    pin headers
    Link: https://www.aliexpress.com/item/3269...7652c7f0a9951a


    Circuit:
    You need of course 5V Arduino to power it with Li-Ion battery (4,2 V!)

    [img] https://cdn.instructables.com/FYH/H0...webp&width=822 [/img]


    Code:
        // OLED display TWI address
        #define OLED_ADDR   0x3C
        Adafruit_SSD1306 display(-1); // restart display with reset button on arduino
    
        void setup()
    
        {
    
         Lux.Begin(0, 188000);
         display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
         display.clearDisplay();
         display.display();
    
         // display a line of text
          display.setTextSize(1);
          display.setTextColor(WHITE);
          display.setFont(&FreeSerif9pt7b);
          display.setCursor(1,15);
          display.print("MAX44009");
          display.display();
        }
    
        void loop()
    
        {
        lux=Lux.GetLux();  // get luxs
        watts =Lux.GetWpm();  // get watts/m2, only for SUN source
    
        display.fillRect(1, 20, 100, 100, BLACK); // create black rectangle on values position
        display.setCursor(1,40);
        display.print(lux);
        display.setCursor(80,40);
        display.print("lux");
        display.setCursor(1,60);
        display.print(watts);
        display.setCursor(80,60);
        display.print("W/m");
        display.setCursor(115,55);
        display.print("2");
        display.display();
        delay(1000);
        }
    Photos:








    Charging



    Night pollution?


    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 4
    Points: 6,209, Level: 18
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    1,197
    Helped
    180 / 180
    Points
    6,209
    Level
    18

    Re: Portable luxmeter (Arduino + TSL2561)

    Very nice.
    I personally found the OLED module very difficult to mount, and extremely delicate. Also getting those larger fonts is a real pain.

    Considering the small size of all these modules - I think the largest is your LiPo, you should try installing it in a smaller enclosure. Plastic ones are easier to work with. You don't really need that perf board.

    Also your light sensor you should install behind some protective glass maybe.

    What are the DIP switch for?
    Last edited by kripacharya; 9th July 2019 at 13:59. Reason: Stupid autocorrect

    •   AltAdvertisement

        
       

  3. #3
    Newbie level 2
    Points: 24, Level: 1

    Join Date
    Jul 2019
    Posts
    2
    Helped
    0 / 0
    Points
    24
    Level
    1

    Re: Portable luxmeter (Arduino + TSL2561)

    DIP switch if for turn on/turn off + charging on/off. Better should be desing own case, using 3D printer.
    My light sensor I dont protective, because it will be less accurate. Only when not measuring, for protective from dust.
    Do you like portable things?

    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 4
    Points: 6,209, Level: 18
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    1,197
    Helped
    180 / 180
    Points
    6,209
    Level
    18

    Re: Portable luxmeter (Arduino + TSL2561)

    DIP switch is a terrible selection for On/ Off control of anything other than occasional selection of optional features.

    Good glass will not make your light sensor less accurate. After all, you are measuring visible light. Any diminishing of lux can be compensated for by calibration & software.

    Next project you should make a colour meter.

--[[ ]]--