0

Trinket m0 with veml6075
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket m0 with veml6075

by Kidkill on Wed May 08, 2019 8:33 pm

Hello,

When I hook these 2 up together with i2c I get nothing out of the serial monitor. I've tried adding 10k or 4.7k resistors to 3.3v but still nothing, the sensor works fine with a nano. Any ideas?
Thanks.
Attachments
20190508_182455.jpg
20190508_182455.jpg (292.53 KiB) Viewed 264 times

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit_support_mike on Thu May 09, 2019 4:04 am

The Trinket M0 does need external pull-up resistors for I2C, but all the connections in the photo above look good.

Try swapping your jumpers one by one and see if that has any effect. Sometimes you'll get one with a wire broken inside the insulation, which makes a circuit fail even though it looks okay.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket m0 with veml6075

by Kidkill on Thu May 09, 2019 7:10 pm

Checked the jumpers, they're fine. I tried a different sensor (tsl2561) no problems with that one, like I said, same hookups on a nano work fine, I even tried a different trinket m0, still not a peep from the serial monitor, not even an error.

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit_support_mike on Fri May 10, 2019 12:00 am

That places the symptoms firmly in "that shouldn't happen" territory: I2C works with other devices on the Trinket M0, and the VEML6075 works when connected to a different microcontroller.

Post the exact code you're using (between CODE tags please), even if it's just the standard example code from the library.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket m0 with veml6075

by Kidkill on Fri May 10, 2019 12:26 am

Code: Select all | TOGGLE FULL SIZE
/*!
 * @file veml6075_simple.ino
 *
 * A basic test of the sensor with default settings
 *
 * Designed specifically to work with the VEML6075 sensor from Adafruit
 * ----> https://www.adafruit.com/products/3964
 *
 * These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
 * to interface with the breakout.
 *
 * Adafruit invests time and resources providing this open source code,
 * please support Adafruit and open-source hardware by purchasing
 * products from Adafruit!
 *
 * Written by Limor Fried/Ladyada for Adafruit Industries. 
 *
 * MIT license, all text here must be included in any redistribution.
 *
 */
 
#include <Wire.h>
#include "Adafruit_VEML6075.h"

Adafruit_VEML6075 uv = Adafruit_VEML6075();

void setup() {
  Serial.begin(115200);
  Serial.println("VEML6075 Simple Test");
  if (! uv.begin()) {
    Serial.println("Failed to communicate with VEML6075 sensor, check wiring?");
  }
  Serial.println("Found VEML6075 sensor");
}


void loop() {
  Serial.print("UV Index reading: "); Serial.println(uv.readUVI());
  delay(1000);
}


After digging around a bit, I came across this; viewtopic.php?f=8&t=144946&p=715729&hilit=veml6075#p715729 , Do you think this is likely the same problem?

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit_support_mike on Fri May 10, 2019 12:37 am

It's possible, but that issue would have been opened in December. Our programmers usually manage to fix things faster than that.

Try running a basic I2C address scanner and see if that detects the chip:

https://github.com/todbot/arduino-i2c-s ... canner.ino

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket m0 with veml6075

by Kidkill on Fri May 10, 2019 10:50 pm

I tried to run that but I get an error;
Arduino: 1.8.9 (Mac OS X), Board: "Adafruit Trinket M0"

Build options changed, rebuilding all
I2CScanner:10:74: error: utility/twi.h: No such file or directory
#include "utility/twi.h" // from Wire library, so we can do bus scanning
^
compilation terminated.
exit status 1
utility/twi.h: No such file or directory
Invalid library found in /Users/mein/Documents/Arduino/libraries/Adafruit_Arduino_Boards-master: no headers files (.h) found in /Users/mein/Documents/Arduino/libraries/Adafruit_Arduino_Boards-master
Invalid library found in /Users/mein/Documents/Arduino/libraries/Adafruit_Arduino_Boards-master: no headers files (.h) found in /Users/mein/Documents/Arduino/libraries/Adafruit_Arduino_Boards-master

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit_support_mike on Sat May 11, 2019 3:03 am

Sorry.. old link.

This one is a library, and the scanner example compiles for the Trinket M0:

https://www.arduinolibraries.info/libra ... -c-scanner

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket m0 with veml6075

by Kidkill on Sat May 11, 2019 10:35 am

--- Scan started ---
I2C device found at address 0x10 !
--- Scan finished ---

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit_support_mike on Mon May 13, 2019 1:05 am

Thank you. That shows address recognition, which makes me more suspicious of the code. Let me check with the folks who handle that.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket m0 with veml6075

by rcwilcox on Mon May 13, 2019 7:19 am

You might try powering the veml6075 with the 3.3v output from the trinket. Even though it says the veml converts down to 3.3v the pinout page states:

To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V

rcwilcox
 
Posts: 33
Joined: Thu Jun 06, 2013 4:33 pm

Re: Trinket m0 with veml6075

by Kidkill on Mon May 13, 2019 9:09 am

I tried that too.

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Re: Trinket m0 with veml6075

by adafruit2 on Mon May 13, 2019 12:30 pm

kid, are you using the library manager or downloading directly from github the latest?

adafruit2
Site Admin
 
Posts: 18492
Joined: Fri Mar 11, 2005 7:36 pm

Re: Trinket m0 with veml6075

by adafruit_support_carter on Mon May 13, 2019 2:34 pm

I was able to recreate this using the 1.0.0 version installed via Library Manager. There's been some pretty substantial changes to the library since 1.0.0 and those have just been pushed in a 2.0.0 release. Once that release becomes available through Library Manager, try updating to that and see if it helps. It seemed to clear things up for me.

You'll also need to install this library:
https://github.com/adafruit/Adafruit_BusIO

adafruit_support_carter
 
Posts: 12039
Joined: Tue Nov 29, 2016 2:45 pm

Re: Trinket m0 with veml6075

by Kidkill on Mon May 13, 2019 6:27 pm

Installed the new library and all is working great! Thank you guys!!

Kidkill
 
Posts: 26
Joined: Mon Mar 18, 2019 7:21 pm

Please be positive and constructive with your questions and comments.