Fab Academy 2018 - Thierry Dassé

Bin project

Electronic device

My board has to measure wheight of each bin , compute and allow user to know results.
I like my device to be low cost better than hi tech. So, I decided to use :

ATtiny85 and then ATtiny44

As, I was not sure that I can use LCD display on ATTtiny and wich microcontroller I will decide to use, I started to work on breadboard to prototype my electronic device.
I first try with an ATtiny85 and put just a led and resistor on pin 0.

I first searched how to connect Arduino uno directly to ATtiny85 pins on a breadboard without ISP pin header. Result is :
ATtiny85

To verify, I can upload and make my ATTiny do something, I upload a blink program on board below and verified it blinked.
blink on ATtiny85 blink on ATtiny85

Then, I wanted te check if I can use I2C LCD display with ATtiny85. I tried using two librairies :
I2c library for ATTtiny 85 : TinyWireM
and LiquidCrystal library found on http://playground.arduino.cc/Code/USIi2c

I made a simple program to check if I can write a single word on the LCD display but enven compilation didn't return any error, I couldn't see anything on the LCD display. I searched on several forum if someone had the same problem, and after hours, I found another library to drive LCD display I downloaded on https://github.com/platisd/ATtiny85-LCD-library
With this new library, I was able to print characters on the display but when I tried words, I could only see the last character at the first origin as if character position didn't increment automatically.
To solve this second problem, I made a small function to write a string on the LCD display :

void printAt(char *s,int col,int row) {
  int i = 0;
  while (s[i] != 0) {
    lcd.setCursor(col+i,row);
    lcd.print(s[i]);
    i++;
  }
}

After this modification, LCD display worked fine when I uploaded the program but failed when I turned the power off and on again. I tried several times and each time, I see the same. To solve it, I added a delay in the setup function before lcd.begin and all worked perfectly. I think this bug is because LCD controller need time when turned on before receiving start command.

lcd display on ATtiny45/85 Program example on ATtiny45/85

As I wanted to connect several weigh system and a rotary encoder to my board, ATtiny85 hadn't enough pins to connect all. I tried same librairies on ATTiny44 and it also worked well.
So, I'll make my board with ATTiny44, a rotary encoder to choose menu on LCD display and five weigh sensor.

sources:
http://www.instructables.com/id/Using-an-I2C-LCD-on-Attiny85/
https://arduino.stackexchange.com/questions/29546/attiny85-i2c-lcd

Main board design

I designed my board on Kicad. I have chosen a 3.5mm jack connector for power supply, 4 header pins to connect external rotary encoder, LCD display and 3 header pins for each potentiometer included in weigh system.

main board schematic 3.5mm Jack power supply footprint main board PCB solding main board main board

Kicad source files : bin.zip