Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 2 months ago.
KL25Z and TSL2561 problem
Hello, I'm a French student, so please excuse my English. I am working on a robot with the KL25Z and the Arduino Motor Shield v3 and two motors 7.2V I also have some sensors like the SRF02 and the TSL2561, both of them are working with i2C.
TSL2561 is a digital light sensors which receive a value according to the light. https://www.sparkfun.com/products/12055
I have a problem with the TSL2561, it is working when my motors are off, I can receive the good value and a good precision but when I turned them on, after 5 - 10 sec they only receive the data "0". I looked the SDA and SCL channel with a oscilloscope, and when the shutdown happend, there are no long things on SDA and SCL.
I have tried differents libraries, tried to unplug the others component and the TSL2561 still doesn't work when I turn on my motors. The time before the sensors shutdown is variable, sometimes it instantly shutdown and sometimes it need 1 minutes.
My addresses are good, I solder the pullup jumper on one sensors, I tried to change the SDA and SCL pin with PTE0, PTE1 to PTC9 and PTC8. But I have no clue about what is going on.
Please fell free to share your opinions and propose solutions.
NB : I'm using the USB to power the KL25Z and the batteries to power sensors and motors. I tried to powered sensors with USB, still not working. Update : I discovered that it happens only when my motors is running (especially the left one) that the i2c is freezing. For instance if I block my wheel with my hand while my motors is turn on, it works (so it should not be a problem with the current) but if I drop the wheel for one second I can see on my logic analyser that there are nothing anymore on the SDA and SCL. NB : When I do the same with the SRF02 which is also a component working with i2c, I haven't this problem. Do you think it could be a problem due to a noise of the motors ? And if it is, how can I solve this problem ?
Update2 : I've just tried with an others sensors, the ISL29125 https://www.sparkfun.com/products/12829 and I've got exactly the same problem that with the TSL2561, so I think the problem isn't from the sensors. Or maybe it is because those sensors are power with 3,3 V. Please, help me, I'm getting clueless about what I need to do to fix it.
5 years, 2 months ago.
Have you checked the supply voltage, it could be that the motors are either causing the voltage to drop too low for the TSL2561 or that they are causing too much interference on the power supply.