Forum Thread

Arduino Project Help

14,197 5,243 November 17, 2017 at 09:39 AM
I am building a project called ESPLux The Github is here https://github.com/zeroflow/ESPLux and the project and the reddit thread is https://www.reddit.com/r/flashlig...mperature/ This is my first Arduino project and I am a noob.

This is using WeMOS and a TSL2561 & MLX90614 sensors to measure temperature and light and log the values to a micro SD Card.

I am using Platform.io on Microsoft VSC on windows because this code with the required custom libraries don't build on the official Arduino SDK. I have the code successfully running but getting a TSL error preventing things from going further.
I believe I have my assembly correct and the project creator has agreed this.

Here are some assembly photos
https://i.imgur.com/JRvGUpZ.jpg
https://i.imgur.com/UxLuhWQ.jpg
https://i.imgur.com/nLMYoX5.jpg

The Error I get is "TSL Fail" which from what I understand means it can't communicate with the sensor. it was suggested I try a I2C Scanner program and see what happens so I did. The output in Platform.IO in MS VSC terminal assuming I am doing this right is below.

Executing task: platformio.exe device monitor <
--- Miniterm on COM4 9600,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- 0�~?�4�!����␔OCAR������␘!�␔�␘�� --- exit --- Terminal will be reused by tasks, press any key to close it.

I have read a little about how sensors connect on the same bus and need different addresses. Not sure if I have a conflict (seems unlikely) and not sure how to fix it if I do. At this point I would really like this thing working this weekend. I am willing to paypal/venmo you a drink or two if I can get some help to get this thing running.

27 Comments

1 2

Sign up for a Slickdeals account to remove this ad.

This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#2
Quote from LiquidRetro
:
I am building a project called ESPLux The Github is here https://github.com/zeroflow/ESPLux and the project and the reddit thread is https://www.reddit.com/r/flashlig...mperature/ This is my first Arduino project and I am a noob.

This is using WeMOS and a TSL2561 & MLX90614 sensors to measure temperature and light and log the values to a micro SD Card.

I am using Platform.io on Microsoft VSC on windows because this code with the required custom libraries don't build on the official Arduino SDK. I have the code successfully running but getting a TSL error preventing things from going further.
I believe I have my assembly correct and the project creator has agreed this.

Here are some assembly photos
https://i.imgur.com/JRvGUpZ.jpg
https://i.imgur.com/UxLuhWQ.jpg
https://i.imgur.com/nLMYoX5.jpg

The Error I get is "TSL Fail" which from what I understand means it can't communicate with the sensor. it was suggested I try a I2C Scanner program and see what happens so I did. The output in Platform.IO in MS VSC terminal assuming I am doing this right is below.

Executing task: platformio.exe device monitor <
--- Miniterm on COM4 9600,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- 0�~?�4�!����␔OCAR������␘!�␔�␘�� --- exit --- Terminal will be reused by tasks, press any key to close it.

I have read a little about how sensors connect on the same bus and need different addresses. Not sure if I have a conflict (seems unlikely) and not sure how to fix it if I do. At this point I would really like this thing working this weekend. I am willing to paypal/venmo you a drink or two if I can get some help to get this thing running.
I can probably help you with this sometime this weekend.

Stupid question, but, on the back side of the board you soldered the wires to did you actually connect the two sensors together?
Reply Helpful Comment? 0 0
Why do conservative politicians oppose conservation?
Have you ever stopped to think the long-term GOP immigration policy might be to make the United States of America a less desirable place to live than Mexico?

"If you tell a lie big enough and keep repeating it, people will eventually come to believe it" -Joseph Goebbels
This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2005
L10: Grand Master
14,197 Posts
5,243 Reputation
Original Poster
#3
Quote from jkee
:
I can probably help you with this sometime this weekend.

Stupid question, but, on the back side of the board you soldered the wires to did you actually connect the two sensors together?
Awesome, I would be super happy to get this running. No the traces are not bridged. I think I have a photo I'll have to loom
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#4
Quote from LiquidRetro
:
Awesome, I would be super happy to get this running. No the traces are not bridged. I think I have a photo I'll have to loom
Both sensors need to be connected together to VCC, GND, SCL, SDA. Only one of your sensors is connected based on what you said.

Which sensor is currently connected the TSL or MLX (in your pic the wires closest to the labels D1 and D2)?

The code initializes the TSL sensor first. If it isn't the sensor that's connected it will obviously throw an error. If the TSL sensor is connected then the code is set to use the wrong address for the TSL sensor. The address or the TSL2561 is set by its pin 2 which can either be tied to ground, vcc, or floating (each sets a different address). https://cdn-shop.adafruit.com/dat...SL2561.pdf
Looking at some photos of cheap boards for this (opposite side of board than shown in your pic), it looks like the default state is probably floating and your sensor board probably has the option to use a solder bridge to tie it high or low.

The code you're using defaults to the address for a floating pin 2 (Line 24 main.cpp). If needed change FLOAT to LOW or HIGH.

Bottom line: actually connect both sensors and I bet it will work Applause
Reply Helpful Comment? 0 0
Last edited by jkee November 17, 2017 at 10:09 PM.
This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2005
L10: Grand Master
14,197 Posts
5,243 Reputation
Original Poster
#5
Quote from jkee
:
Both sensors need to be connected together to VCC, GND, SCL, SDA. Only one of your sensors is connected based on what you said.

Which sensor is currently connected the TSL or MLX (in your pic the wires closest to the labels D1 and D2)?

The code initializes the TSL sensor first. If it isn't the sensor that's connected it will obviously throw an error. If the TSL sensor is connected then the code is set to use the wrong address for the TSL sensor. The address or the TSL2561 is set by its pin 2 which can either be tied to ground, vcc, or floating (each sets a different address). https://cdn-shop.adafruit.com/dat...SL2561.pdf
Looking at some photos of cheap boards for this (opposite side of board than shown in your pic), it looks like the default state is probably floating and your sensor board probably has the option to use a solder bridge to tie it high or low.

The code you're using defaults to the address for a floating pin 2 (Line 24 main.cpp). If needed change FLOAT to LOW or HIGH.

Bottom line: actually connect both sensors and I bet it will work Applause
Thank you so much! I just toned this out and the second sensor is in fact not connected. I will have to fix this. My switch is connected so that the break in the circuit is between the top and bottom pin, not the left to right. Is that correct?
Reply Helpful Comment? 0 0
Vague questions receive vague answers . . . . . .
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#6
Quote from LiquidRetro
:
Thank you so much! I just toned this out and the second sensor is in fact not connected. I will have to fix this. My switch is connected so that the break in the circuit is between the top and bottom pin, not the left to right. Is that correct?
Just use a resistance or continuity meter to check the switch, or more specifically the pins it's supposed to be connected to, push the switch as required. I can't really tell without seeing the other side of the board, but I'd wager you didn't connect it either... Your meter can also tell you which sides of the switch to connect.

The prototyping space in the center & bottom of that board isn't connected to anything, it's basically just space to mount components and make connections. The button needs to be connected between D4 and GND, use some wire.
Reply Helpful Comment? 0 0
Last edited by jkee November 18, 2017 at 08:48 AM.
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#7
If I were soldering this, I probably would have stripped one set of wires longer and used the extra wire to help make the connection between the sensors. You can fix it by making a solder bridge between them but it may be a little easier/cleaner to use a little wire as that will give the solder a place to go.

I suggest you do a google image search for electronics perfboard prototype for a little inspiration (follow the links and look at both sides of the board). Perfboard is a little easier to do some of this stuff on as it has no solder mask (think non-stick coating that resists solder)
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#8
One of the better soldering tutorials on the internet can be found here:
http://store.curiousinventor.com/..._To_Solder
its broken into quite a few parts and is pretty long and thorough.

Remember solder flows towards the heat
Reply Helpful Comment? 0 0
Last edited by jkee November 18, 2017 at 09:17 AM.

Sign up for a Slickdeals account to remove this ad.

This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2005
L10: Grand Master
14,197 Posts
5,243 Reputation
Original Poster
#9
Quote from jkee
:
If I were soldering this, I probably would have stripped one set of wires longer and used the extra wire to help make the connection between the sensors. You can fix it by making a solder bridge between them but it may be a little easier/cleaner to use a little wire as that will give the solder a place to go.

I suggest you do a google image search for electronics perfboard prototype for a little inspiration (follow the links and look at both sides of the board). Perfboard is a little easier to do some of this stuff on as it has no solder mask (think non-stick coating that resists solder)
I'll right I'll see if I can unsolder the board and make some changes. Thanks I'll report back
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#10
Quote from LiquidRetro
:
I'll right I'll see if I can unsolder the board and make some changes. Thanks I'll report back
No need to fully desolder, though a little solder wick could come in handy. Just add more solder + a few wires
Reply Helpful Comment? 0 0
Last edited by jkee November 18, 2017 at 10:00 AM.
This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2005
L10: Grand Master
14,197 Posts
5,243 Reputation
Original Poster
#11
Quote from jkee
:
No need to fully desolder, though a little solder wick could come in handy. Just add more solder + a few wires
Ya I suppose I could bodge it. I might have the switch going the wrong way. I'll have to tone it out and see
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#12
Quote from LiquidRetro
:
Ya I suppose I could bodge it. I might have the switch going the wrong way. I'll have to tone it out and see
I think the switch position is fine, I just don't think you used wires or solder to actually connect it to anything electrically. I can see that you didn't connect anything to D4. Ideally you might use solder wick and/or a solder sucker to cleanup 2 of the holes for the switch enough to stuff a bread board wire into two of the holes. If you don't go to that level of effort you can probably just use a little solder wick and then tack the wires from the bottom side.

A sketch from mspaint of what you need to connect is attached
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2005
L10: Grand Master
14,197 Posts
5,243 Reputation
Original Poster
#13
Quote from jkee
:
I think the switch position is fine, I just don't think you used wires or solder to actually connect it to anything electrically. I can see that you didn't connect anything to D4. Ideally you might use solder wick and/or a solder sucker to cleanup 2 of the holes for the switch enough to stuff a bread board wire into two of the holes. If you don't go to that level of effort you can probably just use a little solder wick and then tack the wires from the bottom side.

A sketch from mspaint of what you need to connect is attached
Well it's ugly but electrically it's all connected. Still getting the TSL Error though so here is some pictures of what I did and the front side of the sensor.

https://i.imgur.com/QeafsiC.jpg
https://i.imgur.com/V1ZsNiP.jpg

Sensor https://i.imgur.com/MSqjXlL.jpg
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Dec 2008
L10: Grand Master
6,009 Posts
2,383 Reputation
#14
Quote from LiquidRetro
:
Well it's ugly but electrically it's all connected. Still getting the TSL Error though so here is some pictures of what I did and the front side of the sensor.

https://i.imgur.com/QeafsiC.jpg
https://i.imgur.com/V1ZsNiP.jpg

Sensor https://i.imgur.com/MSqjXlL.jpg
It's certainly ugly vomit hug
Probably makes you wish you weren't posting such high quality photos.

Can you unplug that proto shield and post a picture of the backside?

What kind of soldering iron or station and what type of solder did you use?

What kind of multimeter do you have and how are you checking continuity?

You should probably measure the resistance between your connections, set your meter to it's lowest resistance range. It would be a good idea to also measure the voltage you're getting at each sensor.

What other electronics project type boards do you have lying around? What other diagnostic tools? Any chance you've got an oscilloscope or usb logic analyzer? USB to serial adapter? RS-232 to 3.3v or 5v level shifter?

I'll preface this by saying I haven't chased it all the way through the code, but one thing I'd probably try is temporarily commenting out line 73 [while (1) delay(100);] and probably line 84 in main.cpp. This will break things, but might get you beyond the TSL fail to see if other things are working. If this doesn't work and just throws a bunch of errors at you don't waste much time on it.
Reply Helpful Comment? 0 0
This comment has been rated as unhelpful by Slickdeals users
Joined Aug 2008
L99: Slicker than Ice
6,450 Posts
1,767 Reputation
#15
do you have any images of the back side of the switch? I typically solder those across a pair of diagonal pins, I think you may need to do that (but check it with a multimeter or something first), and the make sure you connect something like a pull up/down resistor so that you don't just leave the pin floating either
Reply Helpful Comment? 0 0
Page 1 of 2
1 2
Join the Conversation
Add a Comment
 
Copyright 1999 - 2018. Slickdeals, LLC. All Rights Reserved. Copyright / Infringement Policy  •  Privacy Policy  •  Terms of Service  •  Acceptable Use Policy (Rules)  •  Interest-Based Ads
Link Copied to Clipboard