0
\$\begingroup\$

I've been tasked with modernizing the controls on an ancient cnc sewing machine. In order to access some of the controls in the quickest and simplest way I need to simulate button presses on the onboard programmer pcb. I have 12 buttons I need to access with an Arduino program that will convert embroidery gcode to appropriate button presses.

My current method is to solder leads over the NO buttons so I can close the circuits without losing the ability to use the buttons manually. The problem is that the voltage of those circuits is only 0.5VDC.

It's probably a simple answer and I'm overthinking it but how could I short over the buttons while somehow using the Arduino 5VDC outputs. I've went through a bunch of relay/transistor examples and I haven't quite found something that fits my needs with my limited understanding.

All in all, I'm hoping to switch a bunch of 0.5VDC with 5VDC at a fast rate (machine can do 400 stitches per minute), and still hold up for 8hr cycle times 5 days a week.

\$\endgroup\$
8
  • 2
    \$\begingroup\$ Pictures would be nice to see. I have a lot of questions that would be answered by seeing a picture or two. Is there a reason why you cannot consider the use of these tiny ampules? (Relatively small reed switches.) They are fairly easy to activate with an MCU. \$\endgroup\$
    – jonk
    Commented Jan 15, 2022 at 2:32
  • \$\begingroup\$ I guess I came a little unprepared as I have no pictures atm, but basically the machine has an onboard programmer with soldered buttons on a pcb that I don't wanna remove. I feel like with reed switches I'd have to swap them out, if I understand you correctly? \$\endgroup\$
    – Noah
    Commented Jan 15, 2022 at 2:38
  • 1
    \$\begingroup\$ No, I don't see any reason for swapping out anything. But that is also why I'd like to see a picture. The reed switches don't even have to be mounted at the PCB you don't want to remove. They could be mounted remotely and you just bring over the wires. The main point is that they work very well at the voltage difference you are talking about and they will be completely isolated from anything related to the MCU because the MCU won't be galvanically connected, if you are careful. Lovely task you have and I expect the results to be very satisfying. It's good work. :) \$\endgroup\$
    – jonk
    Commented Jan 15, 2022 at 2:40
  • 1
    \$\begingroup\$ Sweet, thanks for the help. I'll get some pictures monday and explore reed switches in the meantime. \$\endgroup\$
    – Noah
    Commented Jan 15, 2022 at 2:51
  • 3
    \$\begingroup\$ How did you determine the voltage is 0.5V? If you measured it with a multimeter, it could be lying to you if the keypad is multiplexed (likely). In which case the voltage levels might be more conventional. Pictures of the electronics that are connected to the keypad might give us some hints. Is there schematics etc for this machine online? \$\endgroup\$
    – Kartman
    Commented Jan 15, 2022 at 6:35

3 Answers 3

3
\$\begingroup\$

The multimeter in DC mode will average the voltage being measured if it is not DC. So, the 0.5V measurement could simply be due to the buttons being multiplexed, so the voltage across them is not constant but pulsed instead. You can check for this by setting the multimeter in frequency mode. If it does measure a frequency, then the buttons are multiplexed. You can also check how they're wired: if there are less traces going to the microcontroller than buttons, and if several traces go to several buttons, then they are multiplexed.

If it is multiplexed, you won't be able to just connect an arduino output to the buttons. This would be a bad idea anyway: if the arduino is powered and the machine is not, you don't want the arduino outputs to inject current into the machine's micro.

The 4066 analog switch solution will work in all cases (multiplexed or not) so it is the simplest. It also provides some form of isolation, not galvanic isolation but it will prevent the arduino from sending current into an unpowered machine.

74HC4066 is an easy to find 4-switch chip. Its internal resistance is about 50 ohms, that should work fine. Just wire one analog switch across each button. You need 3x about 50c chips for your 12 buttons, so it's not going to break the bank.

You must connect the sewing machine micro's ground with the arduino and analog switch ground. It's best to keep wiring short and tidy. Add a decoupling cap on the board with the 4066's.

Check the power supply for the sewing machine microcontroller. If it is lower than 5V, you're good to go. If it is higher than 5V (unlikely) then the analog switches should run from the higher voltage supply, with voltage translation. These switch chips can't handle voltage higher than their own power supply.

If you steal 5V power from the sewing machine to power your arduino, add a schottky diode to avoid powering the machine's microcontroller from the arduino's 5V, and make sure the power supply can deliver the required current.

Have you searched for an IO port on the machine? Serial perhaps... that could also be useful.

\$\endgroup\$
3
  • \$\begingroup\$ Lots of interesting information there, so thanks for the good read! The machine is from the 80s so I've only found basic manuals with nothing on the electronics. Also, it's all point to point programming stored on a floppy, so no serial ports or anything. What's annoying is that it has its own operating system so I can't read/write anything on the floppy on the computer either. I'm going to try the 4066s first since it seems quick and cheap. But I do have one question with regards to the decoupling cap, how do I know what size to use? \$\endgroup\$
    – Noah
    Commented Jan 16, 2022 at 2:09
  • 1
    \$\begingroup\$ Decoupling caps are usually whatever ceramic you've got in your bits box. Try 10 to 100nF. \$\endgroup\$
    – Ian Bland
    Commented Jan 16, 2022 at 4:23
  • \$\begingroup\$ Sweet, thanks for the help! \$\endgroup\$
    – Noah
    Commented Jan 17, 2022 at 4:37
2
\$\begingroup\$

Without going into this weird 0.5V control voltage (is this a diode drop or transistor base or something?) you could do it using 3 CD4066 analogue switches with the control inputs run from the Arduino and the analogue switch elements strapped across the switches. Presuming the switches don't pull some massive current that is. Have you measured the switch current?

\$\endgroup\$
2
  • \$\begingroup\$ Okay thanks. Honestly this machine is so old I'm having trouble tracing anything on the PCB. Since I only need the buttons I figured I could just start there and hopefully avoid the rest of the board. I can measure the switch current monday, as long as it's below the Arduino 40mA? max current would you assume that the CD4066 would still be good? \$\endgroup\$
    – Noah
    Commented Jan 15, 2022 at 2:32
  • 1
    \$\begingroup\$ The 4066 is rated for 10mA on the analogue switches. \$\endgroup\$
    – Ian Bland
    Commented Jan 15, 2022 at 3:28
0
\$\begingroup\$

IF the button are not multiplexed (it's quite likely they are multiplexed, as it would reduce the number of pins required on the microcontroler of the sewing machine).

And IF the buttons are normally open and connect the "output" to ground when closed (another thing that has to be checked).

THEN, there is a very simple solution : you directly connect an arduino pin to the "output" of each button (ie the side not connected permanently to ground). When you want to "push" the button, you put the pin in output mode and write à 0. When you want to put the button in "released" mode, then you put the pin as INPUT (high impedance), so that it has no effect on the pin (so by default the button is released, but you still can press the button manally if you want). Be carefull : NEVER write a 1, you would probably distroy your sawing machine.

NB : this solution corresponds only to one very specific use case (which yields a far simpler solution). In any other case, you will need either to use the general solution (relay, optocouplers, ...) or to tailor something to your specific case

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.