Processing 115VAC at a high and low limit switch to alert an Arduino Uno

Thread Starter

pchemist

Joined Oct 23, 2015
4
High! I have an old scanning spectrometer that goes from about 1900 to 9000 Angstroms. The scanning motor operates at 115VAC and can turn in either a forward or reverse direction. There are two switches, one at the low wave length end and one at the high wavelength end, which turn off the motor to keep it from ruining the mechanism. When the scanning motor moves from a higher wavelength to the lower shutoff point a red light turns on and the motor stops. When the scanning motor moves from the lower stop toward higher wavelengths the same red light turns off and remains off until the scanning motor reaches the upper switch. At that point, the red light turns on and the motor is turned off. I'm using an TSL2561 light sensor and I want to use the lower switching point as a timing reference (start my Arduino program to log the light intensity from the sensor). I would like to monitor these two switches by using two analog (or digital) inputs to my Arduino Uno. I realize that I need a debounce circuit to handle the switch either turning on or turning off (depending on the rotation of the scanning motor). My question is how can I provide a compatible voltage to the Arduino Uno so that I can detect the state of the two switches? I have attached a PDF file which contains a schematic of the scanning motor circuit. Any suggestions please!!!
 

Attachments

Thread Starter

pchemist

Joined Oct 23, 2015
4
You could either use the L.S's for each to operate a suitable small relay or use DPST limits.
Max.
Thank you, Sir, for your reply. I was hoping to use some sort of resistor and diode combination to drop the voltage down to around 12VDC, but I'm not sure this is a practical idea. I don't need a precise voltage, but I do need something compatible with a 74HC14 (to eliminate the switch bounce and feed to the Arduino). Perhaps your suggestion of a small relay (followed by a resistor-diode combination) would be best!?
 

MisterBill2

Joined Jan 23, 2018
5,216
Unfortunately using the limit switches directly will not work because there is line voltage on the switch terminal no matter which way the motor is turning. If you use a light sensor to watch the neon light in the published circuit you will have a signal well isolated and with no contact bounce. But it will have a square wave at each zero crossing of the AC mains voltage.
I do not see any light sensor in the published circuit , so it is not clear how that relates to the timing signal requirement.
 

Reloadron

Joined Jan 15, 2015
5,129
OK so would it be safe to say you want the Arduino to "know" when the DS1 red lamp is off? When DS1 is illuminated you are at a limit, when DS1 is extinguished you are in the window between upper and lower limits.

DS1 is just a 115 / 120 VAC lamp. There are opto couplers designed to detect line voltages like 120 / 240 VAC. There was just a thread on this topic, I found it, this is the thread. So I would add an opto-coupler across DS1. Several were suggested in the thread. Then the opto-coupler output to a DI (Digital In) on your Arduino. Any switch bounce can be taken care of in the code for the Arduino. That's how I would think about going about it.

Ron
 

MaxHeadRoom

Joined Jul 18, 2013
20,024
Perhaps your suggestion of a small relay (followed by a resistor-diode combination) would be best!?
If you use a DPST limit switches one SW could switch the motor the other side a input to the processor or a small logic level Mosfet to to Arduino input.
What is the current of the PSC motor?
Max.
 
Last edited:

Thread Starter

pchemist

Joined Oct 23, 2015
4
Unfortunately using the limit switches directly will not work because there is line voltage on the switch terminal no matter which way the motor is turning. If you use a light sensor to watch the neon light in the published circuit you will have a signal well isolated and with no contact bounce. But it will have a square wave at each zero crossing of the AC mains voltage.
I do not see any light sensor in the published circuit , so it is not clear how that relates to the timing signal requirement.
Unfortunately using the limit switches directly will not work because there is line voltage on the switch terminal no matter which way the motor is turning. If you use a light sensor to watch the neon light in the published circuit you will have a signal well isolated and with no contact bounce. But it will have a square wave at each zero crossing of the AC mains voltage.
I do not see any light sensor in the published circuit , so it is not clear how that relates to the timing signal requirement.
Thank you for your suggestions!
I'm using a TSL2591 as the light sensor and PLX-DAQ to record the run time (in milliseconds) and the intensity. The TSL2591 has really good sensitivity. I've run quite a few LEDs, LED Flashlights and Laser Pointers and the data looks pretty good!
 

Thread Starter

pchemist

Joined Oct 23, 2015
4
Unfortunately using the limit switches directly will not work because there is line voltage on the switch terminal no matter which way the motor is turning. If you use a light sensor to watch the neon light in the published circuit you will have a signal well isolated and with no contact bounce. But it will have a square wave at each zero crossing of the AC mains voltage.
I do not see any light sensor in the published circuit , so it is not clear how that relates to the timing signal requirement.
OK so would it be safe to say you want the Arduino to "know" when the DS1 red lamp is off? When DS1 is illuminated you are at a limit, when DS1 is extinguished you are in the window between upper and lower limits.

DS1 is just a 115 / 120 VAC lamp. There are opto couplers designed to detect line voltages like 120 / 240 VAC. There was just a thread on this topic, I found it, this is the thread. So I would add an opto-coupler across DS1. Several were suggested in the thread. Then the opto-coupler output to a DI (Digital In) on your Arduino. Any switch bounce can be taken care of in the code for the Arduino. That's how I would think about going about it.

Ron
Thank you, Ron! I was thinking about using an optocoupler, but I didn't think they could handle either the high voltage or the AC component. Your information makes me feel a lot more positive about that technique and I think the response time would be a lot faster than a relay. I could use two optocouplers, one for each switch, even though the starting point is the most important. I'll have to follow your suggestions and learn more about the high voltage optocouplers! Thank you, Sir!
OK so would it be safe to say you want the Arduino to "know" when the DS1 red lamp is off? When DS1 is illuminated you are at a limit, when DS1 is extinguished you are in the window between upper and lower limits.

DS1 is just a 115 / 120 VAC lamp. There are opto couplers designed to detect line voltages like 120 / 240 VAC. There was just a thread on this topic, I found it, this is the thread. So I would add an opto-coupler across DS1. Several were suggested in the thread. Then the opto-coupler output to a DI (Digital In) on your Arduino. Any switch bounce can be taken care of in the code for the Arduino. That's how I would think about going about it.

Ron
Thank you, Sir! I'll have to learn more about these high voltage optocouplers!
 
Just a thought:

Consider, that the scan might be better controlled by a stepper motor.
You generally have hard limit sensors at the end of travel, but these are not used for calibration.
ORG sensors are adjustable sensors that calibrate the position.

You might go to the low limit and then advance slowly until the org sensor is reached.
 

MisterBill2

Joined Jan 23, 2018
5,216
Just a thought:

Consider, that the scan might be better controlled by a stepper motor.
You generally have hard limit sensors at the end of travel, but these are not used for calibration.
ORG sensors are adjustable sensors that calibrate the position.

You might go to the low limit and then advance slowly until the org sensor is reached.
The system being discussed is an existing older unit that evidently is functioning fairly well, and changing to a stepper motor will certainly make the scan a bit jerky. So there is not any benefit that I see in a really major tear-up here. AND a stepper takes a power supply and a drive controller, so it is not a simple change.
 

MaxHeadRoom

Joined Jul 18, 2013
20,024
If using a micro or other means of semi conductor control, it is normally done by sensing all logic at the low level point, i.e. all inputs, sensors, L.S. etc input to the micro where all logic is carried out then just switch the motor via a logic level Mosfet and relay.
This is the way I would consider doing it first. ;)
Max.
 
Top