Electronics > Beginners
Interfacing a 4 voltage level digital signal and an Arduino
Chemist_Guy:
For a little project I'm working on I'm trying to hack a cheap scale to interface it with an Arduino. My thought was open it up, probe the pins which go to the LCD and determine the signals which could be fed into the digital pins. It's a chip on board, so no hope finding a part number. I've been able to locate the pins and figure out the encoding scheme, however the signal is a bit weird. Instead of pulsing at 0 V and 5 V, it's going at 0, 1, 2, and 3 V. (It runs off 2 AA batteries, hence the 3 V max). Look at the graph to get a feel for what it being output. It's putting out four bits at 0 and 2 V, then inverting them between 1 and 3 V. There is also a second line putting out another 4 bits and together they give the 7 bits needed for the 7 segment LCD, plus one bit that is always 0.
At this point I was wondering, what is this encoding scheme called and more importantly how would you go about getting this signal to be readable into the Arduino digital input pins. Ideally it would be a single chip, but I'm trying to keep this as non-Rube Goldberg as possible.
Thank you for your help!
langwadt:
I suspect you will find another signal that toggles at 1/3 data rate, when that is high invert your data
oPossum:
That is typical multiplexed LCD drive - nothing unusual. The datasheet for an LCD controller or MCU with integrated LCD controller will have some info on how it all works.
Another possible approach would be to use a strain gauge amplifier to directly read the strain gauge. The HX711 is a popular low cost chip that you could eXperiment with.
floobydust:
Refer to the ATmega328P datasheets for logic input thresholds. It's around 2.7V for a "1".
edit: I believe OP is showing the LCD drive signals? It would be much easier to get a HX711 shield/board and use that.
T3sl4co1l:
So you need to read an arbitrary analog level, as a digital signal? An analog-to-digital converter, you might say?
The simplest case is a 1-bit ADC, otherwise known as a comparator. (Digital input pins count too -- all real signals are analog, after all -- but they have terrible accuracy so aren't practical to abuse in this way.)
You might use a couple of comparators to determine which state it's in, and read it into the AVR* as say 2-5 parallel bits (depending on how much encoding you want to do, and how much cleverness you bring to bear). Could also be sequential, say if you have a counter advancing the threshold -- assuming the bit times are reliable, so you have plenty of opportunity to check against multiple thresholds.
Or you can use the ADC proper, if you have enough channels and sample rate. The AVR has a 8/10 bit converter, more than adequate here. Conversion takes something like 0.1ms so if the axis in your plot is ms, that's more than enough. Internal mux has 8 channels, or you can add an external (analog switch / mux-demux) to expand to even more.
That should be easy enough in Arduino-land. Some abuse could be done, like overclocking the ADC to squeeze out more samples at far less accuracy, but likely not so easy to do, and probably not necessary.
Note that the signals are repetitive, so you have multiple chances to read the display, even if you're only checking say one logic level per scan, or every other bit, or something. It's unlikely the display data is being updated very quickly (but it would be interesting to find it is).
*Assuming whatever original Arduino board, I guess.
Tim
Navigation
[0] Message Index
[#] Next page
Go to full version