ATtiyn + potentiometer + LCD Display

Hey guys!!!

Please, do you have any suggestions as to how the (reading value) of the potentiometer could be displayed on the LCD (without I2C) with an ATtiny (without Arduino)? I'm not getting it from the circuit and the code below (photos).
I woud like to do its work on the Tinkercad.

You do not have enough pins on the ATtiny to drive an LCD, if you reject the I2C option.

Thank yoy Mike. The problen is: Tinkercad simulator does not have I2C, becouse this I am trying to do without I2C. :sob: :sob:

  1. Take a tip from Lance and his imaginary girlfriend. Just have an imaginary Tiny with more legs e.g. Tiny84.

  2. An 16x2 LCD needs 6 pins. The Tiny85 has 5 GPIO + Reset pin. Program for 6 GPIO. Then blow the RSTDISBL fuse and write your Death Warrant.

(1) seems to be the wiser choice.

David.

1 Like

Hi David, I liked your analogy with girlfriend, but my only option is Tiny85. Is it impossible to solve my problem with the Tiny 85?
Thank you your answer.

Use option (2). It just means that you can never use the Tiny85 in another project.

1 Like

Thank you David.

As this is just a simulation then you haven’t got a real problem, but a virtual one. That is the problem with simulators, they are limited. Unless some one has set you an assignment that can’t be done I don’t see why you want to do this?

Can you not just use a bit banaging I2C library in your software?

1 Like

Even if you manage to squeeze 6 GPIO pins out of the ATtiny85 to drive the LCD, how are you going to read the potentiometer to display it's value on the screen? That will require a 7th pin.

You can probably find an I2C library for the ATTINY85 for a software implementation of I2C.
You can possibly use a shift register to drive the LCD but then be prepared for a deep dive into the HD44780's datasheet. (This is the controller on that LCD ).

I would be very interested to see how exactly this assignment of yours has been formulated to see what scope there is for ingenuity.

1 Like

Another way to do this is with a shift register to give you up to eight outputs from two pins. But I don’t know if your emulator can cope with a shift register.

1 Like

Lance and his imaginary girlfriend https://twitter.com/harryenfield6/status/1093231104977448961?lang=en

If you are not allowed an imaginary Tiny84 you could have an imaginary I2C backpack. Or an imaginary 74HC195 shift register backpack. Or several bits of imaginary electronics.

I can't think of any way to drive a regular HD44780 16x2 display with less than 6 GPIO pins. i.e. use Reset pin for GPIO.
When the HD44780 is inactive you could connect one of the GPIO pins to read the potentiometer.

However the potentiometer circuit might be upset during the active cycles of the LCD.

You would need some imaginary resistors if you attempt to share a GPIO pin's functionality.

Simulation of imaginary components is very dependent on whether the Simulator is a real program or whether it is imaginary too. "Tinkercad" does not sound very "real".

David.

1 Like

It is possible to drive a hd44780 LCD using only 1 Arduino pin with some clever circuitry.

There are few Arduino libraries out there that supported this, including NewLIquidCrystal.
In the NewLiquidCrystal library the LiquidCrystal_SR1W.h header file for the LiquidCrystal_SR1W i/o class describes the needed h/w circuit in an ascii art diagram.

There is also the option of using and lcd with an async serial backpack which would also only need a single Arduino pin.

--- bill

1 Like

There are many ways to skin a cat.

  1. I2C backpack
  2. SPI backpack
  3. UART backpack
  4. OneWire backpack
  5. pin-sharing for a GPIO/Analog pin
  6. single-wire shift register trick in Bill's link
    ...

All of them require external chips or external resistors, capacitors.

As far as I know, Proteus Simulator can simulate an I2C backpack. However I don't have a Proteus licence.

So it all comes down to what the rules are for external components. And "Tinkercad" capability.

Regarding software. Several Arduino libraries handle I2C backpacks seamlessly. The more esoteric options require some investigation. (2) is straightforward. The others have no recognised "standard Arduino LCD" protocol.

David.

1 Like

I think #3 (uart based backpack for LCD) is pretty straight forward as well and is simpler/easier than a SPI backpack as no library is needed.
There is also the 2 wire control using a shift register with a resistor and a diode.
It is pretty straight forward and there are quite a few libraries out there for it.

--- bill

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.