12C scanner, identifies one device but not other three

total newbie here. having no luck getting i2C scanner to show me the address of three (of my four total) i2c devices. i2c scanner does find and give me the address of my 20x4 LCD, but won't give me an i2c address of (any of my three) robotdyn TTP229 16-key capacitive touch modules. instead, in serial monitor, i keep getting the dreaded 'no i2c devices found' dialog. been trying & retrying various things, rebooting etc for about ten days now, but never can get an i2c address for any (of the three) robotdyn modules.

ideas, things tried so far, and questions:

  1. SOFTWARE DEFECT in my =particular= copy of, or version OF 'i2c scanner' code? unlikely - I've tried numerous versions found online, made no diff :-(. but 'board info' gives me serial numbers for each of the three modules, so?

  1. does the i2c device ITSELF need to have a "library" (aka some 'code'), running ON IT in order to be 'seen' =BY= i2c scanner?
    (robotdyn 16-key TTP-229 modules). seems unlikely, but ?

  2. wiring defect? eg: jumper leads installed on a wrong pin, or two? tried swapping SDA & SCL leads, made no diff :frowning:
    doubt I made a wiring error; I've checked it numerous times ...

  3. wiring defect? eg: in one (of the four, brand new, carefully installed) jumper leads? eg: like no continuity? unlikely, see last comment@bottom of #6, below.

  4. wrong VOLTAGE? (robotdyn specs say these are 3.3 to 5.5 volt modules) tried both voltages, made no diff

  5. maybe all three robotdyn modules =themselves= are defective? so try 2nd & 3rd of same module, and/or also try my 2004 LCD, maybe...later TRIED ALL THREE of my TTP229L modules - all three yield the dreaded 'no i2C device found' dialog. HOWEVER, after that, and running same code, jumper leads, etc i2c scanner DOES 'see' my 20X4 LCD, and DOES give me =ITS= i2C address ...

  6. lack of pullup resistors? 4.7Kohm? pair?need to use? if use, one or a pair? I'm totally unclear on this, can't find the word 'pullup' in my code anywhere, so remains unclear if it 'defaults to' =using= the arduinos on-board pullups, or not...

in the tontech TTP229 pdf, top of page 8, pullups are 'mentioned' in last line of paragraph one. but unclear what that means, or what to do/baffled...

this is the entire Tontek TTP229 PDF:

moving on, and leaving all above as described, next tried 'the breadboard & resistors thing', using two 4K7 resistors, which still made NO DIFF, aka 'no i2C devices found'.

again tried two (of the 3 total) robotdyn modules, no luck, no diff, yields same dreaded dialog.

  1. what is the 'default state' of the pullup resistors on the arduino uno board?
    (they're supposedly controllable by software). is/are it/they enabled? disabled? i got no clue ...

  2. bonus question: in the IDE, how do i make the line numbers SHOW in my code?

thanks very much for pointing out thing(s) i missed, did wrong, etc. specifics "in massive detail, suitable for the near brain-dead" much appreciated, guys :slight_smile:

There seems to be something weird with the RoboDyn TTP229 modules.
Any normal manufacturer makes a I2C device that can be seen with a I2C Scanner, but not every manufacturer is normal :confused:

Thank you for the photos. You can use the "Insert a link" button to make a link.
Robodyn TTP229 module: https://robotdyn.com/16-keys-capacitive-touch-ttp229-i2c-module.html.
They also show a schematic.

Question zero: Should I have asked for help sooner ?
Answer: Yes :wink:

  1. Software problem ? Very unlikely, <1%
  2. Code to make it visible ? Could be, but not with a normal manufacturer. Some manufacturers make chips that are not according to the I2C standard.
  3. Wiring ? Your wiring is okay, but the cable is not. SDA and SCL next to each other in a flat ribbon cable causes crosstalk between SDA and SCL. Nothing can be done in software to reduce crosstalk. Can you split the wires ?
  4. Bad wires ? This happens sometimes with cheap jumper leads. Check all your wires.
  5. Voltage ? The TTP229 is for 3.3V and for 5V, so it works with every Arduino board.
  6. Modules defective ? It is possible that a whole series is defective and still is sold on Amazon/Ebay/Aliexpress. Robodyn should not do that.
  7. Pullup resistors ? Now you poke your finger in the wound. There is something wrong with the schematic.
  8. Default pullup ? Normally a single 4k7 pullup is good. Often every module has 10k pullup. The sink current should not exceed 3 mA.
  9. Line numbers ? File / Preferences / Show line numbers.

Do you have a multimeter ? Can you check the TTP229 module ?
According to the schematic, they have pulldown resistors for SDA and SCL of 4k7 ! Can you check the "472" components if one side is connected to GND or VCC. The other side is connected to the SDA and SCL pin.
Schematic is right: then the resistors are wrong (pulldown is wrong), can you remove them ?
Schematic is wrong: they are normal pullup resistors, we can calculate the sink current.

Total sink current: The Arduino Uno has internal pullup resistors of about 50k, but no pullup resistors on the board. I'm guessing 10k pullup for the display. And three modules of 4k7 pullup (when the schematic is wrong and they are pullup).
5V / (50k // 10k // 4k7 // 4k7 // 4k7) = 3.8 mA (calculation).
That is too much. You can remove all those 4k7 resistors of all the TTP229 modules.

In real life it can be more than 3 mA. But in theory it is too much. That means that if the schematic is wrong (and they are normal pullup resistors) then there is probably another problem.

According to the datasheet, the TTP229 gives an ACK after it recognizes its I2C address.
Can you connect just one TTP229 module to the I2C bus, when trying to make it work ? Try to remove the "472" components and see what happens. Some pullup is needed, so you might need to add 10k or 4k7 pullup resistors to 5V.

If nothing helps, you could try to contact Robodyn and give a link to this thread.

thank you for your kind reply, Koepel, very much appreciated :slight_smile:

i should start by saying "it's all even a bit more complicated than I let on, initially", because:

these (problematic) modules are sold as being TTP229 modules, however the only data sheets i can =find= for them reference them as being TTP229-LSF chips, and, to add insult to injury, the numbers =on= the actual chips, near as I can tell, are TTP229-L, and aren't 'really' either of the earlier-mentioned chip numbers here. wether that =matters= to my problem (or to our discussion), again i HAVE NO CLUE.

also, earlier on, roughly a week or more ago, i tried contacting robotdyn asking wether these modules had 'fixed' or 'changeable' i2C addresses. after sending three inquiries, i finally did receive one reply, which said, in part (paraphrased here, but closely) "our TTP229 modules have fixed i2C addresses, I BELIEVE". the 'i believe' part of their reply wasn't exactly awe-inspiring ... :-/

went back to robotdyn site, tried their 'realtime chat', asked a simple question, got a chat reply window IN RUSSIAN (which I don't speak), and to that sent another question, thinking 'no big deal, this'll switch over to an english reply in a few seconds, hopefully', waited, but that didn't happen. so, kind of another 'dead end' there ...

today, so far: dismantled the 'breadboard/resistors' rig, seperated all the formerly 'banded together' test leads, checked continuity of all wires (all test good). rewired all back to original config (no external resistors), then figured 'this could get REAL lengthy - i should have a way to differentiate ONE of their boards from another', so decided to get 'board info' on all =three= boards, one at a time, quitting/closing the arduino app entirely prior to each test.

while doing that i discovered first TWO tested had same =exact= serial number, then looked at other numbers 'board info' gave (VID and PID, whatever those mean) only to ultimately discover all THREE of these robotdyn TTP229 boards gave me the exact SAME info in all respects: same =exact= serial number, same VID number, =AND= same PID number... i was going to attach cardboard tags to each of 'em, label 'em board A, B, and C, and on each tag their respective serial numbers, but now that seems pointless :frowning:

all THREE 'board info' yields this exact same:
serial number 952303039303514050F1
vid 2341
pid 0043

was trying to find out what your mention of "check the 472 components" means, so I studied the pdf more ... found no mention of '472 anything' BUT did find out, at very bottom, last page, this pdf is revision ONE, dated 2010 (ten yrs ago) and, apparently, never updated or revised ...

far as on-board DEsoldering and removing tiny components goes, at 72 yrs old with shakey hands "I might be the wrong guy" for that. meanwhile, I continue to reread & study your helpful reply.

thanks again, Koepel,
dave

Does this look like a pull-up or a pull-down?

aaa.png

aaa.png

not sure what/where is the source of your image. or if you're addressing me, or Koepel. but, if its me, maybe consider i just started trying to read/comprehend schematics a few days ago, and spare me additional quizzes on stuff i already find profoundly baffling, @72 I'm not gonna have all the answers overnight. maybe consider just telling me?
thanks,
dave

my "best guess" is the TWO resistors are pulldowns, but not drawn in the normal manner... <?>

That's the schematic from robodyn's website. If that is true, SDA and SCL are being pulled down via the two resistors connected to ground. This is not normal. I2C always need pull-ups.

The serial number and vid pid are from the Arduino Uno. Sometimes the serial number is not even reliable. I think it is more a gimmick. It is only the Arduino Uno, it does not show what is connected to the Arduino Uno.

The text on a chip is often shorted and sometimes almost not recognizable.
There are many counterfeit chips (more than you think), but so far I see no indication that you have counterfeit TTP229 chips.

When you look at a TTP229 module, there are small black smd components with the text "472". They are resistors of a "4", a "7" with "2" zeros. That is "4700" and that is the resistors of 4k7.
472.png

In Europe they use a flat horizontal line as ground-symbol and a rectangle box as a resistor and the multiple lines for earth-ground.
In the US they use triangles or multiple lines for ground and those zig-zag things as a resistor.

The question is: are they pullup resistors to VCC or are they pulldown resistors to GND ?

When you heat up such a resistor with a solder blob that heats the whole resistor, then it falls off the board in one second.
You have to consider them as bad modules anyway.

If that is not possible, try other modules, from an other brand. What is your project ? Some Arduino boards have touch-inputs.
Many modules/schematics are copied, so if someone makes a mistake, then others might have the same module with the same mistake.

Sorry that you got into this :frowning: I hope you are not disappointed in Arduino. Something is wrong and it is not your fault. Perhaps getting rid of those modules is the best you can do.
When starting with Arduino it is better to spend a little more money and buy from reliable sellers as Adafruit, Sparkfun, Pololu.
At Adafruit, they think about what they are doing, they design and test their own modules, they have very good tutorials, they answer most questions on their forum.
They have a lot of tutorials for led strips. So if you want to have some fun, you can try this: Adafruit NeoPixel Digital RGB LED Strip - Black 30 LED [BLACK] : ID 1460 : $84.75 : Adafruit Industries, Unique & fun DIY electronics and kits.
They have also capacitive touch modules, for example Adafruit 12-Key Capacitive Touch Sensor Breakout - MPR121 [STEMMA QT] : ID 1982 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits and CAP1188 - 8-Key Capacitive Touch Sensor Breakout - I2C or SPI : ID 1602 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits.

472.png

thanks much again, Koepel. when i 1st started posting here, there was a bunch of tiny icons, amongst them were

  • quote back text
  • enter image url
  • enter url
  • enter a table
  • enter a list
    plus roughly 18 more. i tried one or two, then =all= those icons, for unknown reasons, disappeared entirely, and I've snooped around everywhere, trying to relocate 'em, trying to find a 'setting' or something to turn 'em back "on", to no avail...
    generally, most forum softwares have their maker 'brand' names at page bottoms, or on the home page, somewhere, and had i found that, would have googled for answer to 'where have my icons gone?' or how to turn back on, but ...
    <woe is me ... >

thanks again, Koepel, & hzrnbgy. so far this AM, have online chatted with, AND sent 3 emails TO robotdyn re these modules, and in all instances mentioned this thread and gave them link TO this thread. maybe they'll chime in here, and simplify my life :slight_smile:
your (much appreciated) replies DO deserve a more in-depth reply from me, to follow shortly. meanwhile, as I best understand it currently, my simplest, next 'best step' would be to DEsolder and remove both 'mystery resistors' I've labeled A and B, in this pic

then try i2C scanner again? obviously :wink: I'd do it on jut =one= board, then run i2c scanner on that one :slight_smile: and "hope for the best" ...
THANKS you guys :slight_smile:
dave

more in-depth reply to, and quoting Koepel, post #6, above:

The serial number and vid pid are from the Arduino Uno.

I stand corrected, thanks!

The question is: are they pullup resistors to VCC or are they pulldown resistors to GND ?

well, whatever they are, your guess is certainly FAR BETTER than mine :slight_smile:

When you heat up such a resistor with a solder blob that heats the whole resistor, then it falls off the board in one second. You have to consider them as bad modules anyway.

well, I hope if I'm gonna destroy a module in the process, i only destroy one, first, before desoldering on the other two 'might be still good, if I'm lucky' boards :wink:

then again, there's a small chance robotdyn will contribute to this thread, and save the day ... perhaps ... maybe ...

If that is not possible, try other modules, from an other brand.

haven't had any luck finding other 16-key captouch modules, but do know i 'could' possibly accomplish it with 2 or more 'less keys' modules PER lock, but figured this would be simpler (little did i know...)

What is your project ?

want to make 2 working deadbolt locks, non-internet connected, one for shop one for house. each with 16-key capacitive keypad (hence these modules), 120 voltAC solenoid, solid state relay (for solenoid) and arduino uno R3. already have two of each item, except SSR's (have five), and, of course, the three 'problematic' TTP229 modules. the (big laminated) solenoids will only retract the deadbolt; light springs will make it "auto close" or "fail secure". have highly obscure mechanical override designed/partially built, should power fail. locks will also be on (freestanding, seperate) timers, only operable certain hours.

Some Arduino boards have touch-inputs. Many modules/schematics are copied, so if someone makes a mistake, then others might have the same module with the same mistake.

can find, really, NO mention of anyone actually using these same modules; maybe everyone just ends up 'trashcanning' 'em?

end part 1

part 2 of 2 to Koepek begins, hand coding all this...my 'buttons are missing' :-/

Sorry that you got into this I hope you are not disappointed in Arduino.

I'm certainly NOT disappointed in arduino, but =quite= 'unhappy with' these tontech TTP229 modules - getting them operational seems FAR more mystical, and complex, more of a =struggle= than it should be...

Something is wrong and it is not your fault. Perhaps getting rid of those modules is the best you can do.

well, I'm nearing that stage...

When starting with Arduino it is
better to spend a little more money and buy from reliable sellers as Adafruit, Sparkfun, Pololu.

lesson learned, "the hard way" sir ... and thanks again, for your excellent info :slight_smile:

At Adafruit, they think about what they are doing, they design and test their own modules, they have very good tutorials, they answer most questions on their forum.

yes, i agree, but learned most of that shortly =after= getting these modules, unfortunately :frowning:

They have also capacitive touch modules, for example Adafruit 12-Key Capacitive Touch Sensor Breakout - MPR121 [STEMMA QT] : ID 1982 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits and CAP1188 - 8-Key Capacitive Touch Sensor Breakout - I2C or SPI : ID 1602 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits

I'm considering that, but their modules aren't, far as I know, 16-key capable in -one- module. but...still...i might have to go down that road, maybe use 2 modules per lock ... mulling it over.

thanks again Koepel :slight_smile:
very much,
dave

well, whatever they are, your guess is certainly FAR BETTER than mine :slight_smile:

You shouldn't guess you should measure it! Use a simple multimeter. One side of these 472 resistors is connected either to Vcc or to GND. Measure and report results!

ok, pylon!

arduino disconnected from power, both resistors still soldered on, measuring ohms. calling small pointy end of capital letter A resistor 'top' here, letter B 'top' just below the M in word 'Module' (printed on the circuit board).

top of resistor A to vcc pin = 4.64Kohms
bottom of resistor A to vcc pin 1.3 ohms

top of resistor A to gnd pin = open/no reading
bottom of resistor A to gnd pin = open/no reading
=== === === === === === === ===
top of resistor B to vcc pin = 4.7Kohms
bottom of resistor B to vcc pin = 1.5 ohms

top of resistor B to gnd pin = open/no reading
bottom of resistor B to gnd pin = open/no reading

where am I now, other than 'cluelessville', i mean?

thanks pylon,
dave

where am I now, other than 'cluelessville', i mean?

That means the two resistors are actually pull-ups and the schematics on the robotdyn site are wrong.

But that TTP229-LSM chip has a fixed I2C address, so you cannot have more than one of these devices on one bus. If you need to have multiple of them, you have to split up the bus by using an I2C multiplexer.

my entire i2C bus would have two devices on it, total:
first device: one 16-key captouch keypad module (of my three) 'problematic' TTP229 modules,
= and =
second device being my one 20x4 LCD (its address is 0x27)

I'm still unclear as to how to obtain i2C address of a robotdyn TTP229 module, and, in order to accomplish that: wether or not I should desolder/remove the two resistors (marked A & B in earlier pic).
thanks :slight_smile:

also unclear, but might not matter anyway, wether or not the i2C address of my LCD is fixed or 'user electable' ...

So I bought a Robodyn TTP229 module :stuck_out_tongue:
Connected it to a Arduino Uno and the I2C Scanner could not find it :sob:
Then I tried a small test-sketch and it worked 8)

I took my test-sketch from tinytronics.nl and changed it into this:

// Original sketch taken from the tinytronics.nl website.
// Changed a lot.

#include <Wire.h>

void setup() 
{
  Serial.begin(9600);
  Serial.println("Starting...");
  Wire.begin();
}

void loop() 
{
  int n = Wire.requestFrom(0x57, 2);
  if( n == 2)
  {
    uint16_t key_data = Wire.read() << 8;
    key_data |= Wire.read();
    print_key_states(key_data);
  }
  else
  {
    Serial.println("TTP229 not found");
  }
  delay(200);
}

void print_key_states(uint16_t data)
{
  for(int bit_nr = 15; bit_nr >= 0; bit_nr--)
  {
    Serial.print( bitRead( data, bit_nr) == 1 ? "1" : "0"); 
  }
  Serial.println();
}

The I2C Scanner uses a 'write' command to test for an acknowledge from a I2C device. The TTP229 simply ignores that, but it does acknowledge a 'read' command, because that is the only thing it knows.

While this problem was going on, I have not read about that.
We should have found somewhere that it does not respond to the I2C Scanner. The manufacturer took a shortcut when designing this chip.
It is in the datasheet "... so the TTP229-LSF only accepts the read operation that R/W bit is "1". If it is "0", the TTP229-LSF will not respond the write operation".

@i_m_wrong, Sorry, shame on me :-[ But I'm glad it is solved now.
The TTP229 responds only to a Wire.requestFrom(). It's pullup resistors are okay. The total pullup is okay when only one TTP229 module is used.

Every module or chip connected to the I2C bus should have different I2C addresses.
Since the 28-pin TTP229LSF has only one I2C address, you can not use two of them.

If you want more than one of those modules, then there are good solutions:

  1. Multiplexer.
  2. Software I2C library, for example SoftwareWire.
  3. Library that has minimalistic I2C-alike pin-toggle code to use the modules on any pins. I like this solution the most. Let me know if I should try to find and test such a library. The SCL pin can often be shared, then you would need 4 pins for three modules.

hello Koepel :slight_smile:
tried your new revised code, no clue what i was really supposed to see. i assume it's your revised version of 'i2C scanner', tried it, was sort of expecting some kind of 'address report' saying something like 'i2C device found at address Ox34', or something similar...

pix here are:

  1. overall wiring shot (exact same as 1st time around), and

  1. serial monitor view: saw multiple lines of zero's printed out very quickly, and

  1. opened serial plotter (no clue why, but did anyway :slight_smile: saw horizontal centerline expanding rightward from 0/0 position at medium speed...

but, then again, maybe this is all exactly what I was =supposed= to be seeing <?>. i did count 'zeros per row' and found 16, so might be some 'hidden mystical symbolism' in there <?> also looked at your code, (awesome stuff, admittedly 99% beyond my comprehension) and did find an i2C address IN your code (0x57), so maybe ALL 3 of these modules of mine* bear that same address, and these results just =confirm= that fact <?>

*or, possibly 'worldwide', too, for all i know. i tried 2 of my three today...same result..

well, yeah, i'm clueless, I can only offer 'best guesses'...

thanks again, sir

The test-sketch shows the inputs, all 16 inputs.
0 : not active
1 : active
Try to touch a input pin, or use a metal screwdriver or so for better contact. Use the serial monitor of course, not the serial plotter.

When the TTP229 is not connected, then you will see "TTP229 not found" instead of the 1's and 0's.

The TTP229 initializes itself after power-up and takes in account the metal that is attached to the inputs. Therefor you should not touch an input when turning power on.

The 28-pin TTP229 can only have I2C address 0x57, nothing else. Therefor you can use only one on the I2C bus. Please reread my previous post for solutions to use more TTP229 modules.

thanks again, Koepel. will try add'l steps you've outlined shortly.

meanwhile: one thing for sure, I'm no marco reps

well, OKEY DOKEY, Koepel