Introduction: Make a Scanner Wireless

About: An electronics technologist that has passion for how technology can be used to make things happens.

This tutorial describes how to convert a usb scanner to wireless using a Raspberry Pi. Once setup, you will be able to scan documents, convert the scanned document to PDF, and then transfer the document wirelessly via WiFi to any computer in your home.

Best of all, your flatbed scanner doesn't need to be anywhere near your laptop or PC.

Items Required:

  • Raspberry Pi 3 Microcontroller (Purchase on Amazon)
  • USB Cable ( Use the cable you used to connect your scanner to your PC)
  • Raspberry Pi Power Adapter (Purchase on Amazon)
  • Ethernet cord
  • Home WiFi Network
  • USB Flatbed scanner

Ensure that your scanner is compatible, before starting this project.

Step 1: Get Your Pi Working in Headless Mode

Obviously, your Pi isn't wireless after following the steps in this video. Step 2 will go into detail on how to accomplish this.

Since your Pi is going to be plugged into a scanner, my guess is that you do not want a monitor, mouse, or keyboard plugged into the Pi when it's doing this task for you. If this is the case, you can use the above YouTube tutorial to setup a Raspberry Pi without a keyboard or mouse ever being plugged into it.

For notes and web-links I refer to in the video, see the below notes

To find the default gateway, in other-words known as your router’s IP address, type this command into the windows command prompt: ipconfig

To get putty for windows, go to this web address

http://www.putty.org

Default username and password for the PI

Username: pi

Password: raspberry

This is the command, I used at the SSH prompt to get the PI’s VNC settings:

sudo raspi-config

To download VNC viewer for Windows or Mac, go to
http://www.realvnc.com


Some alternative notes for macOS users

Find your local Default Gateway using a Macintosh computer:

To see how to activate VNC on the Macintosh, watch this video

Step 2: Connect Your Raspberry Pi to WiFi

If as of now, your Pi is connected via a wired ethernet connection to your router as shown in the main video from step 1, do as follows:

  1. Connect to Raspberry Pi via VNC as shown from the keyboard / mouse workaround video in step 1
  2. Connect to your wireless network as shown in the tutorial found at the below link

https://www.digikey.com/en/maker/blogs/raspberry-p...

Now that your Pi is connected to WiFi

  1. You can now unplug your Pi's ethernet and power cord
  2. Move your Pi to wherever your scanner is located
  3. Plug your Pi into power

Step 3: Make Usb Scanner Wireless

Important: Watch the embedded video for this section before continuing.

Below are the notes for the embedded video

Below are all websites and command prompt commands presented in this video

Determine if your scanner is compatible: http://www.sane-project.org/sane-supported-devices.html

To download the Fing app for your phone: https://www.fing.io/

This was the website, that I was looking at 3:08 into the video: http://blog.pi3g.com/tag/sane/

Commands that were used to install the SANE software

sudo su
aptitude update
aptitude install xinetd sane-utils

To run any of the commands between the dotted lines, you must be in the sane SANE space. To get to the SANE user space from the command prompt, input the below command:

sudo su

----------------------------------------------------------------------------

Setup the software once in the SANE user space:

RUN=yes
RUN_AS_USER=saned

To start the sane software:

/etc/init.d/saned start
su -s /bin/sh - saned

To get the manufacturer and the name of your scanner:

lsusb
scanimage -L

-------------------------------------------------------------------------

Allow the sane software to write to the Documents directory:

chmod 777 Documents

Below was the command that I used to scan the document:

scanimage -d 'pixma:04A91712_14799B' --resolution 300 -x 2550 -y 3300 > /home/pi/Documents/essayoutline.ppm

Remember: 'pixma:04A91712_14799B' was the name of the scanner that I was connected to.

Step 4: Convert Scanned Image to PDF

Follow the instructions in the below video to convert scanned image to PDF. For multipage PDF's see the below notes.

Important Notes

Below, are the commands that you must type into the terminal to install the imagemagick software:

sudo apt-get update
sudo apt-get install imagemagick

The convert command that produces a pdf document from an image file is as follows:

convert -density 300 /file path/filename -compress JPEG /file path/file name.pdf

Note: filename includes the image file extension

If you have more than 1 page (Below example is if you had two files)

convert -density 300 /file path/filename1  /file path/filename2 -compress JPEG /file path/file name.pdf

This was the line I entered from the video: (Keep in mind it was only one page)

convert -density 300 /home/pi/Documents/essayoutline.ppm -compress JPEG /home/pi/Documents/essayoutline.pdf

Step 5: Transfer the Scanned Documents From Raspberry Pi to Computer

Disclaimer: The video tutorials for both Windows and macOS were not made by me. These videos were exceptionally great, so I do not see the need to reinvent the work of others. I've pasted links to their YouTube channels, so please check them out.

For Windows:

I have only watched this video and have not actually done this myself. Their video was very clear and concise, so I have gone ahead and promoted it here for it's quality.

Credit for the above video: Brush Automation

https://www.youtube.com/channel/UCLecVrux63S6aYiE...

For macOS:

Alexander has created an awesome tutorial here. I did exactly as he described, and everything worked beautifully.

Credit for the video: Alexander Baran-Harper

https://www.youtube.com/channel/UC_aQTJgfrnCb8coP...

For iPhone and iPad

I've tested the software myself to ensure it works as advertised. Keep in mind that the software I am recommending for grabbing files from the Raspberry did cost $7.00 Canadian at the time this article was written.

If you want to use the iFiles 2 software, you will have to do as follows:

On your Raspberry Pi, install the netatalk software. Below are the commands that you will need to input at the Raspberry Pi's terminal to install the software.

sudo apt-get update

sudo apt-get install netatalk

If you so desire, you can download the iFiles 2 software here:

https://itunes.apple.com/ca/app/ifiles-2-file-mana...

See this video to see how to connect iFiles 2 to your Raspberry.

If you need to get your Raspberry's IP address, remember that you can use the fing app (See below link)

https://itunes.apple.com/ca/app/fing-network-scann...

Step 6: Automate Using Bash (Optional)

Using bash (shell) scripting we can automate the entire process of scanning a document with our scanner and then even convert it to a multipage pdf document.

For the bash code, goto my GitHub account

https://github.com/davehelmuth/Raspberry-Pi-Scanner/tree/master

Once you have the code found at the above link, you will have to paste it into a text file on your Pi. Watch the below video for further instruction

To run the script file:

  1. Double Click on it
  2. Click Execute in Terminal