Using Arduino in Industry (on Paper Guillotine Machine)




Steampunk artist, scientist, engineer


On this instruction i'll give some tricks how to use arduino (or other MK) in industry. What problems will appear and how I fix it.

I have order to fix broken PC on Wohlenberg cutting machine(on video you can see one of the first edition of my arduino). New original PC for this machine costs 3000+$.

What do my arduino do

1. Display size using internal high speed encoder (25imp/mm) and tft screen

2. Create 40 programs with 40 position for cutting

3. Fully control motors (in auto mode enable)

4. Next step position after cutting

5. Autocallibration in 15 steps (for machine in video, and operator controlled calibration call)

6. Fully configurable system for any cutting machine

7. Support 3 buttons and matrix keyboard (in new revision I added USB keyboard support)

8. Power filter

9. Debounce filters

10. And many other function

In the next steps i'll describe some problems and how i fix it.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Casing. How to Create Custom Case for Any Project

When you build your project in the same step you'll need casing for mounting.

I create drawing in CAD software. 3D model with all holes. I use usually 3-4mm acryl. 3d model export to dxf drowing than to laser cutting. Cutted model i fold to finished case like in photo

Step 2: Power Supply

Ihere is a realy big problem with power supply in industrial machines.

What I have

1. 36 V, 24 V (usually),15 V (yes i saw this), 12 V, 9 V, 5 V.

2. All voltages have a bounce. If you'll needed i can attach data from oscilograph

3. Internal power supply of machine dislike when you connect something strange

4. when you add external power supply 110-220V to 5v to arduino - your arduino will work terrible. in some cases voltage will fall to 4V!!!

How i fix it

1. I install my own industrial pulse power supply 380-220-100V ACto 24VDC or to 12VDC (30$+)

2. To my power supply i add 3A DC-DC converter and configure it to 5VDC out.

3. DC-DC i connect directly to ARDUINO. It means, i connect DC-DC out-negative to arduino ground, DC-DC out-positive to arduino +5V to the pins directly on board. In this case i'll have stabilized 5V for all my components.

Step 3: Incoming Signals Filtering

Also is another big problem that incoming signals in machines can be 36-24-12VDC on logical 1 with bounce. Using resistors or optocouples can help only partial. When signal changes, its state thousand times per second and it become a real problem. Thats why i constructed a filter.

I connect a signal wire to input channel, Machine ground and Machine +24(36,12,etc.).

To output channel i connect arduino.

In this case MK ground and Machine ground will be separated.

Note! - inverted logic

Step 4: Keyboard

After 3 month of working matrix keyboard became broken. I added support of usb keyboad to arduino.

Connect USB port:

1. USB positive-to arduino +5

2. USB negative - arduino ground

3. USB data+ - Arduino port 21 (or any port with interrupt)

4. USB data- - Arduino port 20 (or any port with interrupt)

Connect Keyboard to new USB port

Now download PS2Keyboard library from github or my fixed library from included files

Add to your sketch

#include PS2Keyboard.h (download this library)

void setup()



keyboard.begin(DataPin, IRQpin, PS2Keymap_US);



call this code inside encoder IRQ function

void encoder_irq()



char USB_key()
{key_filterred=NO_KEY; if (keyboard.available()) { int c =; switch (c) { case 48: return '0'; break; case 46: return '#'; break; // . cancel case 13: return '*'; break;//enter case 49: return '1'; break; case 50: return '2'; break; case 51: return '3'; break; case 52: return '4'; break; case 53: return '5'; break; case 54: return '6'; break; case 55: return '7'; break; case 56: return '8'; break; case 57: return '9'; break; case 43: return '+'; break;//+ case 45: return '-'; break;//- case 127: return 'R'; break;//back space case 42: return 'e'; break;//** case 47: return 'd'; break;// / //- case 118: return 'B'; break;//Button1 cancel case 117: return 'A'; break; case 116: return 'D'; break; case 115: return 'C'; break; case 119: return 'n'; break;//num }

Step 5: Encoder

Power encoder from arduino (usually it will be 5V encoder).

Info lines from encoder connect to filter.

Call encoder using interupt!!! when youll use timer you'll miss steps.

Connecting encoder directly to arduino - you'll miss or get extrastep when motors working. Long wires and electrical noise... I spend many nights and test ideas but... only this is a good solution. Encoder-filter-microcontroller

If someone will ask about encoder code or its connection - i'll add this part

upd 30.08.2016 added encoder source

void setup ()



pinMode(encoder0PinA, INPUT);

digitalWrite(encoder0PinA, HIGH); // turn on pullup resistor

pinMode(encoder0PinB, INPUT);

digitalWrite(encoder0PinB, HIGH); // turn on pullup resistor

attachInterrupt(0, doEncoder, RISING); // encoder pin on interrupt 0 - pin 2


void doEncoder()

unsigned long now = micros();

unsigned long interval = now - lastPulseTime;

if (interval > 5)

if (digitalRead(encoder0PinB) == HIGH) { // found a low-to-high on channel A

if (digitalRead(encoder0PinA) == LOW) { // check channel B to see which way // encoder is turning

encoder0Pos = encoder0Pos + 1; // CCW

} else {

encoder0Pos = encoder0Pos - 1; // CW



else // found a high-to-low on channel A


if (digitalRead(encoder0PinA) == LOW) { // check channel B to see which way // encoder is turning encoder0Pos = encoder0Pos - 1; // CW

} else {

encoder0Pos = encoder0Pos + 1; // CCW




Step 6: Finally

Out signals are the simplest task. You can use relay module....

Finally using this tricks i build more than 10 machines for different tasks

Thanks for reading

Raspberry Pi Contest 2016

Participated in the
Raspberry Pi Contest 2016

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    13 Discussions


    3 years ago


    I used a XCC1406pr01k type encoder, the system not miss much, so I used the library <digitalWriteFast.h>. it works very well even with two interruptions.

    I need more detail on the filter (Step 3: Incoming signals filtering)

    and position control for the automatic mode

    1 reply

    Reply 3 years ago

    Attached image of filter.

    algorythm of machine start.

    1. power on

    2. press button on screen like "calibrate"

    on machine side

    1. move backgauge from user to end of table

    1.1 on the end of table are 2 buttons(stopbuttons)

    1.1.1 first button change speed of backgauge from high to low

    1.1.2 second button stop moove

    1.2. both buttons connected directly to machine circuit. you can not control it, but you can get impulse from it(probably)

    1.2.1 i have no pulse from this buttons. i checked time and pulse from encoder

    2. if move-from-user is on AND no pulse from encoder => max point. move from max point to user slow

    3. when you'll get pulse from checkpoint - calibrate ok

    3.1 on moment when you'll get checkpoint pulse - start to calculate pulses(or mm or inch)


    3 years ago

    I work almost on the same project.

    I am about to connect the encoder to Arduino, the comtage are conducted in very well.

    As soon as the engine start Arduino begins calculated anyhow

    so I need more detail on step 5.

    thank you in advance

    2 replies

    Reply 3 years ago

    upd. added encoder source code


    Probably problem that you not using the filter.
    Simplest way:
    1. Change interrupt occure (rasing, falling, etc)
    2. Add to info lines small capacitor
    3. Interrupt without timers
    4. Read only one interrupt from channel a/b not both
    5. 1imp/rotation channel use without interrupt...

    I'll check all steps and add some source code for interrupt part

    Tecwyn Twmffat

    3 years ago

    ..... But a buck type conversion would be more energy efficient as I am running off a solar charged battery?

    4 replies

    Just remembered that one man last year patented dc-dc for 1.5V AAA battery.

    His dc-dc will give stabilized 1.5Vout on 1.5-0.2V in. When battery fully discharge - just insert new battery.

    UPD3. One science team in Lviv Polytechnical University contract for China solar panels with efficiency 40+%. Check on alibaba and ebay bags with solar panels

    I'm thinking of using one of these:

    TracoPower TEN 20-2411WIN 20W DC-DC Converter 9 - 36V DC In 5V DC 4000

    but seems quite expensive at $60 ??


    I'm thinking of using one of these:

    TracoPower TEN 20-2411WIN 20W DC-DC Converter 9 - 36V DC In 5V DC 4000

    but seems quite expensive at $60 ??

    Tecwyn Twmffat

    3 years ago

    Nice! DC to DC power conversion is a good tip. Need to use this in my current project.

    1 reply

    Ttake 110VADC with 3-6A and than DC-DC. In that case all your add-in modules will have anought power.

    I connected to one stepper 2 mega boards, 20Relay modules, LCD and TFT modules and I did not notice the loss of voltage.