# Adding instruments

You can make a significant contribution to PyMeasure by adding a new instrument to the `pymeasure.instruments` package. Even adding an instrument with a few features can help get the ball rolling, since its likely that others are interested in the same instrument.

Before getting started, become familiar with the contributing work-flow for PyMeasure, which steps through the process of adding a new feature (like an instrument) to the development version of the source code.

Pymeasure instruments communicate with the devices via transfer of bytes or ASCII characters encoded as bytes. For ease of use, we have property creators to easily create python properties. Similarly, we have creators to easily implement channels. Finally, for a smoother implementation process and better maintenance, we have tests.

The following sections will describe how to lay out your instrument code.

- File structure
  - Updating the init file
  - Add test files
  - Adding documentation
- Instrument file
- Your instrument’s user interface
  - Common instrument types
  - Managing status codes or other indicator values
- Defining default connection settings
  - Single interface
  - Multiple interfaces
- Writing properties
  - The property factories
  - Restricting values with validators
  - Mapping values
  - Boolean properties
  - Processing of set values
  - Processing of return values
  - Checking the instrument for errors
  - Using multiple values
  - Dynamic properties
- Instruments with similar features
  - Instrument family with different parameter values
  - Instruments with similar command syntax
- Instruments with channels
  - Adding a channel with `ChannelCreator`
  - Adding multiple channels with `MultiChannelCreator`
  - Advanced channel management
- Advanced communication protocols
  - Instrument’s inner workings
  - Adding a device address and adding delay
  - Bytes communication
- Writing tests
  - Protocol tests
  - Device tests
- Solutions for implementation challenges
  - General issues
  - Communication protocol issues
  - Channels