I have 8 model trains. Each model train runs on its own track with its own mains power. I want to create a touch sensor for each each such that power turns on to train only when the sensor is being touched.
Preferably its is robust enough to work every day all day for several years without daily setup.
That sounds like a great little project, perhaps @Stephen or @Graham can help with a way forward
There are a couple ways that you can control your trains through capacitive touch. You will probably need a micro-controller to sense the capacitive touch, and have the micro-controller trigger some relays to turn your trains power on and off. Depending on your level of programming proficiency, you could either use a traditional
Arduino board and a capacitive touch shield such as this one:
Or you could use something like the Adafruit Circuit Playground Express that has capacitive touch sensitive pads built in. There are only 7 pads on the Circuit Playground though, so you could only control 4 trains with a single controller. The big advantage is that you could program it with MakeCode which is much easier than Arduino. Plus we have tutorials on how to use the capacitive touch feature of the Circuit Playground Express:
and if you want to program using CircuitPython:
I hope that helps! Please share your completed project with us when you have finished it!
Thank you for the info and links. I will read through the tutorials.
I have used a Bare Conductive Touch Board in the past. What I don’t understand is how to get the signal from a touch board to switch power on and off to the 8 trains. What would I need between the touch board and the trains?
The capacitive touch item would be connected to a microcontroller of some sort. The Circuit Playground Express, the Bare Conductor and many others are microcontrollers with capacitive touch built in. You need to then write a program on the microcontroller that detects the touch, and have the microcontroller activate an external relay. A relay is an electrically activated switch. The microcontroller will be able to send enough voltage to close the relay and power the trains.
I hope that helps!
A big help