0
\$\begingroup\$

I am trying to recreate the sort of microchips that are on printer cartridges so that I can make cartridges that can have their data programmed and read? I only need to store 8 bits, so I was thinking a microchip might be overkill. How can I get 8 bits of data from a cartridge that is plugged in?

I was also thinking of simply connecting power through a switch (0/1), representing the bits. This would be connected through a pull up resistor and so where the switch was closed, you would get some voltage reading.

Another design I thought of can differentiate 16 distinct currents based on 4 switches and 4 strategically chosen resistor values. The switch being open represents a zero. The current was equal to the bit value (ie. switches being closed in 1010 gave 10ma of current). How reliable then is current ADC and would it be easy to repeat this for several cartridge holders?

Anyways, these are the potential solutions I have been thinking of today. Let me know if you all can think of another solution for differentiating between cartridges when they are plugged in.

Excuse the many tags but the solution could potentially be in any of these categories.

Thank you!

\$\endgroup\$
  • \$\begingroup\$ what do you mean by microchip? \$\endgroup\$ – jsotola Jun 19 '18 at 23:56
  • \$\begingroup\$ You could get an actual microchip. Look for "serial EEPROMs". \$\endgroup\$ – user253751 Jun 20 '18 at 4:00
  • \$\begingroup\$ Single wire eeproms. \$\endgroup\$ – Jeroen3 Jun 20 '18 at 6:23
3
\$\begingroup\$

The simplest common solution similar in style to your ideas is to make a PCB with a number of contact pads and wiring them together in different patterns. You can then read out the wiring pattern by connecting each one to a GPIO pin on your host device (must have input with pullup or pulldown as an option) and driving one pin and reading the others.

(It would also work with a plug instead of a custom PCB; the choice depends on what the best mechanical interface for your cartridge is.)

If you use diodes instead of wires then you can have as many bits as pairwise combinations of contacts (so 8 bits requires only 5 contacts); if you want a simple parallel read scheme then you would use 9 contacts (1 "power supply" and 8 data lines).

In any of those cases you can build it with switches instead of hardwiring for testing purposes.


If you want to use fewer GPIO pins, store more data, or have it be writable electrically, then you would use some type of memory chip communicating over a serial interface, such as an I2C EEPROM. This is a common approach for "identify the attached peripheral" applications that want many bytes of data but do not need a microcontroller in the peripheral.


Another design I thought of can differentiate 16 distinct currents based on 4 switches and 4 strategically chosen resistor values.

Using resistances to communicate more bits over a single line can be done (there is a classic technique of multiplexing pushbuttons this way) but in your case it can be disrupted by unintended resistance in the cartridge connection. You could fix that in principle by using four-terminal sensing, also known as a Kelvin connection, but at that point it's probably easier to use multiple digital lines instead.

\$\endgroup\$
  • 1
    \$\begingroup\$ +1 It may seem silly to use only 8 bits out of 4096 or whatever, but you can buy an AT24C04 4K bit I2C SEEPROM in SOT-23-5 for pennies. \$\endgroup\$ – Spehro Pefhany Jun 20 '18 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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