Hello I am having troubles with level shifting SCK and SDA from 1.5v to 5v, not sure if Im doing right. (I will include .jpg)
Has anyone some Arduino code and suggestions on how to connect Digital Dial Indicator Gauge to Arduino.
I tried to connect:
SDA & SCL from gauge to Arduino SDA & SCL, and
SDA & SCL from gauge to Arduino digital 4 & 2(0 interrupt).
Why are you connecting SDA and SCL to pins 2 and 4? --->> I tried to connect to SDA and SCL, but in the code Im using CLOCK is connected to interrupt on pin 2, and digital pin 4 for data.
Why are you not supplying power to the device? --->> The device is using 1.5V battery.
Why are you using a LM339? That's a "Low-power quad voltage comparator", not an I2C level shifter. --->> Im never did level shifting
Why are you not connecting Gnd from the gauge to the LM339? --->> Where should I connect GND?, I tried to GND on Arduino??
For I2C level shifting this circuit from Philips is awesome: App note AN10441.pdf and an97055.pdf. I built one last weekend and it's working well. Two 5 cent mosfets, 4 resistors, done. I used 2N7002P mosfets, 3.3K pull-ups on the 3.3V side and 4.7K pull-ups on the 5V side.
mlinka:
Why are you using a LM339? That's a "Low-power quad voltage comparator", not an I2C level shifter.
--->> Im never did level shifting
So you reached into the box and just pulled out a chip, is that it?
[/quote]
Im Trying to use everything that I have.
I thought if I connect let say CLOCK signal (1.5V) to Voltage comparator Non-inverting Input1 (pin5), and connect GND to Inverting input1(pin4), VCC= to 5V, and Vcc- to GND -->
--> I thought that Output 1 should be Vcc+(5V) (for 1) and GND (for 0) of CLOCK signal, or?????
One more question.
Can I connect Clock and Data from digital dial indicator to 2 Analog pins, and make a sketch to check when the voltage is let say above 1V to be logic 1, and below 1V to be logic 0?? And then put 2 digital pins HIGH or LOW depending of the Analog inputs of CLOCK and DATA of the indicator Gauge?, and connect thoose pins to interrupt pin for reading CLOCK and another digital pin for reading DATA? Or would that be too slow???
If even possible...
Thanks for help :)
Im going craaazzyyyyyy already.....