element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Summer of Sensors Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Summer of Sensors Design Challenge
  • More
  • Cancel
Summer of Sensors Design Challenge
Blog VEML3328 Last-Minute Entry: Blog #4 Program and Experimenting
  • Blog
  • Forum
  • Documents
  • Design Challenge
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Summer of Sensors Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: misaz
  • Date Created: 17 Nov 2022 10:50 PM Date Created
  • Views 726 views
  • Likes 4 likes
  • Comments 0 comments
  • veml3328
  • Summer of Sensors Design Challenge
  • summer of sensors
  • Exploration Station
Related
Recommended

VEML3328 Last-Minute Entry: Blog #4 Program and Experimenting

misaz
misaz
17 Nov 2022
VEML3328 Last-Minute Entry: Blog #4 Program and Experimenting

Hello everyone. I welcome you to forth from five blog about VEML3328. This blog I wrote as my last-minute entry to the Summer of Sensors Competition in category Exploration stations. It is forth of five blogs. I decided to start and complete this project today. I started approx. 6 hours before deadline and now I have half hour to post last two blogs.

Project

As I mentioned in previous blog, I decided to use STM32G0 microcontroller for interfacing with VEML3328 color sensor. For project I used very cool STM32G0 MCU in SOIC8 package with only 8 pins (with subtraction powering pins, SWD pins and reset pins it decreases even more).

Working with this MCU in STM32CubeIDE looks as follows. Pretty funny. :D

image

To this project I implemented library mentioned in previous blog post. For displaying data, I used I2C OLED display (which in fact I also received as part of my recent Project14 competition reward). I write application which configures sensor according to my parameters and then display outputs for every channel (Red, Green, Blue, Clear and IfraRed) using progress bars on the display. Most of the time I spend with getting display working. Work with sensor was quite a seamless. Good part is that I did not noticed any bug when working with my VEML3328 library written in hurry approx. 4 hours ago and it worked out of the box. I think it is because I have written several libraries.

Connection

Both display and sensor are connected using shared I2C bus. On breadboard it looks as follows.

image

First output

First output you can see on previous picture. It is captured by iPhone with flashlight enabled. As you can see except IR progress bar all shows some non-zero values. Flashlight is naturaly white color, so it contains all segments (R, G, B). From output we can see that sensor is more sensitive on green channel rather than on red and blue. Similarly values on Clear are very high because Clear channel is sensitive to all colors. These findings correspond with datasheet. Datasheet mention following sensitivities for channels.

image

Testing DIY colour filter

For further experiments I use red antistatic foam and flashlight at the back side of it. As you can see sensor now sensed much more red color which make sense, because it is backlighted by red light.

image

With this setup I tested changing several parameters.

Digital Gain

The first parameter is digital gaing or DG. In datasheet it is referred as DG and it never explain what DG abbreviation means, but I think it is some kind of digital gain. Possible values are x1, x2 and x4. I tried x4 and measured values was really higher but not four times. I gues about 2 to 3 times. Maybe there were slightly difference by caused by position of the light.

image

Analog gain

Second parameter which I tried was enabling analog gain also. Possible values are x1/2, x1, x2, x4. I tested it with configuration that both analog and digital gains were set to 4. Output very soon reached maximum possible value (65535 because resolution sensor is 16-bit).

image

As you can see sensor can with good configuration fully utilize its scale.

With both gains at maximum values became instable and there were lot of noise (which was visible on slow display).

Integration Time

Then I disabled both gains and instead adjusted changing integration time. Possible values are 50ms, 100ms, 200ms and 400ms. I tested 200ms. Values were higher than in case od default 50ms, but less sensitive to noise.

image

Disabling unused channels

Last experimenting was feature allowing disabling some channels. After enabled this feature I was receiving only G, C and IR values from the sensor exactly as expected.

image

This is all. I have no time, so I go post this blog. In this blog you have seen my project and some outputs from the sensor. In last blog I will summarize my work.

Next blog: VEML3328 Last-Minute Entry: Blog #5 Summary

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube