Skip to content

A bespoke system for connecting a retail scale to a POS terminal (RPi Pico + MicroPython, with a dash of FreeCAD and 3D printing).

License

Notifications You must be signed in to change notification settings

goncalomb/scale2pos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scale 2 POS (scale2pos)

The goal of this project is to connect a retail scale to a POS (point-of-sale) system using 2 Raspberry Pi Pico W.

The scale has an RS-232 port that is normally connected directly to the POS, but in this case it is connected to an RPi that reads the weight from the scale and transmits it to the other RPi (over Wi-Fi), the second RPi inputs the weight (and product code) on the POS. This removes the need for the scale and POS to be physically connected.

This is a very specific project to solve a very specific problem. I don't expect it to be useful to anyone as is, but it has some components that can be used on other projects:

  • mpy-ctrl.sh: a bash script to setup and manage any MicroPython project;
  • src/utils/: generic MicroPython utilities (net.py is a nice one);
  • 3D Models: project box models for 3D printing;

This was my first project in MicroPython and served as my introduction to the platform. —goncalomb

Images

Final device images (images/):

banner-0

banner-1

Requirements / Setup

"Client" RPi (scale):

  • Connects to the scale using RS-232;
  • Connects to the "server" using Wi-Fi;
  • Powered by 12V (shared with the scale, 2.1mm jack);
  • Has a buzzer for audio feedback;
  • Has a set of push buttons for different product codes;
  • Reads the weight from the scale and transmits it to the "server" (Web API), together with the product code as a barcode with embedded weight;

"Server" RPi (POS):

  • Connects to the POS using USB;
  • Acts as a USB keyboard;
  • Acts as a Wi-Fi access point and web server (HTTP);
  • Receives and emulates keyboard codes, the POS interprets these inputs as barcodes and registers the product;

Hardware

This is a non-exhaustive list, there is no custom PCB or schematic:

  • 2x Raspberry Pi Pico W;
  • 1x Waveshare Pico-2CH-RS232;
  • 2.1mm panel jacks, power switch, diode (1N4007), UBEC (5V/3A);
  • 3V buzzer (TMB12A03), transistor (2N3904), resistor (1k);
  • Yellow LED, resistor (1k);
  • Generic push buttons, wires, etc.;

You may have noticed in the images that I've connected the 3V buzzer to 5V! Oops, that was not intentional. According to the datasheet, 5V is the operating voltage limit for this buzzer. If it fails (I don't think it will), I'll change it to a 5V buzzer. —goncalomb

Software (MicroPython)

The code is shared between the "client" and "server", it is managed and installed using the custom mpy-ctrl.sh script. The variant is selected when pushing the code:

# setup environment and download dependencies
./mpy-ctrl.sh setup

# install the "client" variant (scale)
./mpy-ctrl.sh push client

# install the "server" variant (POS)
./mpy-ctrl.sh push server

# install the "serial-debug" variant (interactive serial debug console)
./mpy-ctrl.sh push serial-debug

3D Models (for 3D printing)

scale2pos

Project box models for 3D printing (models/). The "Pico Box" (in the middle) is for the "server" that connects with the POS. The big box is for the "client" that connects with the scale.

You may use these models for your own projects!

The "Pico Box" (also published on printables) is just a plain box that fits the Raspberry Pi Pico perfectly with no screws. The big box can used as a generic project box.

The parametric FreeCAD project is also available (models/scale2pos.FCStd). License: CC BY-SA 4.0.

I'm still learning FreeCAD, these are my first published models. —goncalomb

References

Reference documents (references/), most important:

License

3D Models

Creative Commons license: CC Attribution-ShareAlike 4.0.

Software

scale2pos is released under the terms of the MIT License. See LICENSE.txt for details.

About

A bespoke system for connecting a retail scale to a POS terminal (RPi Pico + MicroPython, with a dash of FreeCAD and 3D printing).

Topics

Resources

License

Stars

Watchers

Forks