Basic Stamp 2 Math
WD8MBE
Posts: 8
I am using a LT-1298 and Basic Stamp 2 to read voltages. I am getting data from the LT-1298 and need to convert it. The formula I am trying to use is AD=AD*5000/4095. I should get 2589.74 which is actually 2.589 volts. However, using this formula and displaying AD with Debug I get 13.
Can someone tell me what I am doing wrong? The 5000 is 5 volt reference.
SHIFTIN Din,CLK,MSBPOST,[AD\12]
Now lets say AD = 2121 (2121*5000)/4095=2589.74 But Debug Terminal displays 13.
I am new to this and need help.
Thanks,
Tom
Can someone tell me what I am doing wrong? The 5000 is 5 volt reference.
SHIFTIN Din,CLK,MSBPOST,[AD\12]
Now lets say AD = 2121 (2121*5000)/4095=2589.74 But Debug Terminal displays 13.
I am new to this and need help.
Thanks,
Tom
Comments
http://www.emesystems.com/BS2index.htm
result = 2121 */ 3125
which gives 25891 as the result displays 2.589
Another method using **:
The plan is to put a BS2, XBee setup connected to my solar/wind generator battery bank. Using the LT-1298 to monitor voltages and having information sent to the house receiving on another XBee and displaying the voltage data on my PC. Plus graphing and logging the data. Monitoring the performance of my battery bank.
My test setup is as follows: I am using a steady 12vdc source feeding into a voltage divider (12vdc "in" with 4vdc "out") plus a zener diode to make sure the LT-1298 does not get move then 5vdc. Course the LT-1298 does the A?D and the BS2 the math and send the data thru the XBee.
I somewhat understand the formulas given, except some of the numbers posted. Tracy, you 3125 and 14464. I have no clue where these numbers come from. I am just trying to understand all the formulas and come up with a solid solution for the math and giving me a good representation of the voltages read by the LT-1298.
As a further note: My battery bank presently consists of (4) 6vdc deep cycle batteries. Parallel/series configuration for 12vdc out. Maybe I should set the equipment up to read each battery voltage? Would not take much to add another LT-1298.
Anyway, my overall goal is to be able to read the battery bank voltages in the house on my PC. Any help assistance or advice is greatly appreciated.
Tom