Hi! I want to make a 4 channel touch sensor to work with bulbs but i don't find the coding online for it to work. Can domeone please help me?Picture is attached.
Touch sensor:https://a.aliexpress.com/_mr3pvju
Bredboard: Suq 1 Pcs New 400 Tie Points Solderless Pcb Breadboard Mini Universal Test Protoboard Diy Bread Board For Bus Test Circuit Board - Integrated Circuits - AliExpress
Have you already coded one of them successfully?
If so post the code for that part, along with circuit diagram.
edit and in any case, provide details (link or whatever) of the sensor/s.
really?!
first results form internet search:
TTP224 4-Channel Digital Touch Sensor Capacitive Touch Module and Raspberry Pi
Why not try its library? ![]()
hope that helps...
I opened ot but it dosent show the coding
I am a beginner so i dont know how to make a circuit diagram but i will send you the link to what 1 thing 1 have done.
int animationSpeed = 0;
void setup()
{
pinMode(13, OUTPUT);//This is red LED
pinMode(12, OUTPUT);//This is yellow LED
pinMode(11, OUTPUT);//This is green LED
}
void loop()
{
//animationSpeed = 400;
digitalWrite(13, HIGH);
delay(5000); // Wait for animationSpeed millisecond(s)
digitalWrite(13, LOW);
delay(0); // Wait for animationSpeed millisecond(s)
// digitalWrite(12, HIGH);
// delay(5000); // Wait for animationSpeed millisecond(s)
// digitalWrite(12, LOW);
// delay(5000); // Wait for animationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(5000); // Wait for animationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(500); // Wait for animationSpeed millisecond(s)
digitalWrite(12, HIGH);
delay(3000); // Wait for animationSpeed millisecond(s)
digitalWrite(12, LOW);
delay(0); // Wait for animationSpeed millisecond(s)
}
This is the coding that i did which was to connect small 5mm light bulbs to arduino uno.
Yep I see you have added it to the first post.
I'm wondering if it even needs coding, other than just monitoring its outputs? Looks to me like you just apply power and when you touch one of them its output will go high or low depending on which way round it works.
If I'm right, it's no different from monitoring a button. (But I say that without having done anything other than look at the pic.)
Actually, the lights on the touch sensor do turn on when i press ang of the touch sensors but i want to connect those 4 sensors to 4 5mm bulbs and that needs programming
I followed this video but when i try to open the link for the coding given in the description it shows some error so i am basically stuck.
if you try to download and open the library from the link I shareed?
there is an example code to output the key pressed on the touch sensor to serial monitor... TRY IT!
Sure, I will try.
So your question actually has nothing to do with the touch sensor itself. The output of the sensor changes when you touch it?
So what's the actual question, given that it seems you can treat its output just like that of 4 momentary buttons.
Yes, I want to control the 4 5mm lights with the 4 channel touch sensor.
So do a digitalRead() of each the Arduino pins to which you connect the 4x sensor outputs and act on whether it read high or low.
If you need to toggle the led, on with one touch and off with another touch, look at the state change detect example in the IDE.
As i mentioned earlier, i am a beginner and i dont know what you're trying to explain to me. Is there any way i can open the link of the youtube video that i montioned above?
It sounds like you should put this project aside for a couple of days, then get into the examples included with the Arduino IDE.
That will help you become familiar with the basics of writing a simple program.
Dosent work unfortunately. Showing many errors
Well it doesn't work for me either so I guess the site is stuffed.
But if you're at the very beginner stage, you need to work through some of the examples in the IDE. (edit: as lastchancename just said.) I'm pretty sure there's one that shows you how to read an input pin and change an output based on that read.
You'll be wanting something along the lines of this incomplete code which needs a setup() and loop() etc etc:
if (digitalRead(sensor1)== HIGH) //edit... fixed brackets
digtitalWrite(LED1, HIGH);
else
digtitalWrite(LED1, LOW);
Ok. Thanks a lot for the help!
this module need no library. The module has 4 output pins and 2 power input pins.
connect 4 outputs to digital pins of arduino(for example: 2). with simple
digitalRead(2)
can be read.
shown post above example can be written even shorter
digtitalWrite(LED1,digitalRead(2));


