Applied Sensors, Page 138, RAMDataLogger.bs2, I can't get it to work???

dhassalldhassall Posts: 6
edited 2004-09-08 - 19:47:43 in Learn with BlocklyProp
·I have been trying to get this to work all day long...
I get good Siemens measurements on the DEBUG
screen but when I readback the Logged data the
cnt value doesn't come out of the RAM Memory
correctly....Seems the Siemens value is too
large to be stored correctly.....·

One program mistake (Print mistake?)
the FOR statement on page 139 says FOR n=0 to 15 step 3
I think should be FOR n=0 to 17 for there to be 18 spots
for the 18 data units to be logged into RAM.

Also on Page 129 doesn't show the connection diagram for
the LCM555 timer chip on the test block.·

I am using Applied Sensors Manual version 1.3..

Am I doing something Wrong???· Or do I have bad information???

Thanks for your time.... I am really enjoying the course...

73.. Dave

·

Comments

  • Tracy AllenTracy Allen Posts: 6,475
    edited 2004-09-06 - 05:35:04
    dhassall said...
    IOne program mistake (Print mistake?)
    the FOR statement on page 139 says FOR n=0 to 15 step 3
    I think should be FOR n=0 to 17 for there to be 18 spots
    for the 18 data units to be logged into RAM.

    Also on Page 129 doesn't show the connection diagram for
    the LCM555 timer chip on the test block.
    I am using Applied Sensors Manual version 1.3..

    Right, it looks like the figure 5-4 on page 129 is inadvertently the same as figure 5-2 on page 122. Figure 5-4 should include the wiring for the LM555 so that it can be used to drive the conductivity sensor. Thank you for pointing that out.

    As to the FOR-NEXT loop, it is okay. The loop executes when n=0,3,6,9,12,15. That is six times, and each time through it reads data from memory at 3 locations, for a total of 18 locations. When n=15, it it reads temperature from loc. 15, light from loc 16 and conductivity from loc 17.
    dhassall said...
    I have been trying to get this to work all day long...
    I get good Siemens measurements on the DEBUG
    screen but when I readback the Logged data the
    cnt value doesn't come out of the RAM Memory
    correctly....Seems the Siemens value is too
    large to be stored correctly.....

    The data is stored as one byte, so if your conductivity reading exceeds 255E-7, (less than ~40 kohms), the logged values would look funny. Did you run the calibration procedure ealier in the chapter 5?. You might have to make an adjustment to the units if your water is more conductive.
    Are the temperature and light readings coming out okay from the data log?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dhassalldhassall Posts: 6
    edited 2004-09-06 - 18:48:02
    Dear Tracy Allen,
    Thank you for your reply.· I went bank into chapter 5 to the Calibrate555.bs2
    program and rechecked my calibration. It was only slightly different from my
    initial run. But I think the problem is my tap water conductance.·
    My tapwater reads as follows:
    ·· 8484 E-7 Siemens and a resistance of 1000 ohms.
    My Arrowhead bottled water reads as follows:
    ···15113 E-7 Siemens and a resistance of 600 ohms.

    I went back to the RAMDataLogger.bs2 program and then put in some scaling
    calculations for the large Siemens values.· In the Long_Click: subroutine, I
    modified the DEBUG display line to read as follows:
    ·· DEBUG DEC TC, TAB, DEC, light, TAB, DEC cnt*100, CR

    In the Get_Data: subroutine I modified the log(ptr) = cnt line to read:
    ··· log(ptr) = cnt/100
    This divides the 8484/100 giving me a 84 to log in RAM.
    I loose some granularity of the reading but now the RAM has a value that is
    under 255 to log.· There are probably many other ways to do it but in my
    NEWBIE state this one made the most logical sense to me.

    The Temperature readings come out of the RAM correctly , the Light meter readings sometimes come out minus one count from what was on the
    logged readings DEBUG screen.·· Not sure why this is happening but I am
    MUCH happier with my readings now than before.

    Now on to Chapter 6 and the "Great Water Pump Experiment"... I hope I don't
    drown.····

    73.. Dave

    ·
  • Tracy AllenTracy Allen Posts: 6,475
    edited 2004-09-07 - 15:02:12
    Have fun with chapter 6, then!

    Good job on scaling the conductivity reading x100 (or x50) to make it fit in one byte. Of course it would be better to attach more memory to the Stamp and store it as words instead of bytes!

    For reference, I'm attaching a B&W version of what figure 5-4 should be.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    417 x 400 - 32K
  • Aristides AlvarezAristides Alvarez Posts: 470
    edited 2004-09-07 - 20:06:10
    Hello Dave.

    Thank you for letting us know about Figure 5.4!
    We'll fix this on the revision 1.4.
    ·
    I'm attaching the Figure below.
    As Tracy pointed out, we had the figure to be placed there but we used Figure 5.2 instead.
    ·
    Please let us know if you find any other problem or typo in the book, so we can fix it for the next revision.

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Saludos,
    Aristides Alvarez
    Education Manager
    aalvarez@parallax.com
    Parallax, Inc. www.parallax.com
    California, USA
    394 x 327 - 35K
  • dhassalldhassall Posts: 6
    edited 2004-09-07 - 22:45:24
    Hello Tracy and Aristides,

    Thanks for the view of the 555 pictorial on the test block.. I didn't have any problem putting the circuit in from the schematic but also went ahead to chapter six and on page 154 there was a view of it all installed so I used it·· to check myself.· It never hurts to double check everything as the block is really very busy.· I went on to chapter six and tried to do the "great water pump" experiment but it didn't go well.· Not sure what the problem is but I can't get the pump to turn on and off with the stamp signal (High 3) (Low 3)....for some weird reason the transistor switch doesn't want to control the pump.· All it want to do is turn on but not off.... I don't have my electronics workbench with me as I am in my Camper in Northern New Mexico but I did check the transistor with my ohm meter and it checked good.· I got so frustrated that I rebuilt the Pump ON/OFF circuit on my "Home Made Board of Education" where I didn't have to use the battery supply like on the "homework" board.· It didn't work there either...I substitued another transistor (2N3904) and tried it again and still no go...

    One thing that wasn't real clear in the Applied Sensors manual is a detail of the (ZTX 104 9A) transistor.· By looking at the figure 6-5 it isn't real clear which way you plug the bugger in the board. One side is painted with the numbers on it and the other side the numbers are engraved on the black side.· Maybe a little inset drawing of this transistor on figure 6-5 may eliminate it being connected up backwards..( I may have done that myself... Not sure)...

    An alternate would be to use a small SPST 5 volt realy in this control circuit. ... It would be a lot more reliable and probably eliminate a lot of confussion in hooking this circuit up and probably be a lot more reliable.· Your the·· guys that do the courses and using relays sometimes isn't the most High Tech thing to use but in an application like this it would sure simplify the process and the basic stamp commands and logic·would be exactly the same as it is....

    The rest of my chapter six went well and I have really enjoyed the course.· I took it and the What's a Microcontroller· to reaquaint myself with basic stamps and I think that your new inovations with the "Homework" board· is a real step forward.· I had taken a Basic Stamp I course about three years ago at the local Community College and that gave me the background I really needed to get started. A friend wants me to help him build some Soil Moisture monitoring sets for his project.· Like most Envioromental Scientists... He has no money for his project on the Jicarilla Apache Indian Reservation.· So we are building from scratch.· I have visited Tracy Allen's site and others on the internet and think that if we are prudent , crafty, and use our Creative Talents, we can get this accomplished.·· Thanks for a great course and a cool little piece of Microprocessor.· I am really enjoying both.



    73.. Dave
  • Aristides AlvarezAristides Alvarez Posts: 470
    edited 2004-09-08 - 02:33:30
    Hi Dave.

    I'd like to know a little more about the circuit you built.
    The electric pump is a 3 Volts one and maybe that explains why the complexity in the circuit.
    If you used the HomeWork Board you'll need to provide external (regulated) 5 Volts to the transistor.
    It's very important to tie grounds together when using split power supplies.
    Without conecting the grounds together, there's no common reference for both circuits.

    If you used your "own" Board of Education and if it have a big voltage regulator (~1Amp) you could use the other circuit mentioned in the book, feeding everything from the same power supply and conecting the transistor to Vdd (not a 9 V battery because it cannot provide the power required for this circuit).

    Let us know more about your circuit so we can keep troubleshooting it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Saludos,
    Aristides Alvarez
    Education Manager
    aalvarez@parallax.com
    Parallax, Inc. www.parallax.com
    California, USA
  • Tracy AllenTracy Allen Posts: 6,475
    edited 2004-09-08 - 15:46:31
    The circuit is not all that complicated. The transistor is hooked up as an "emitter follower". That is fine for driving the 3 volt pump from the 5 volt power supply on the BOE. Since the pump does take a considerable current, as Aristides pointed out, there is a possibilty that bad ground or power connections are causing the Stamp to misbehave.

    I have attached a diagram of the transistor, showing the outline and the writing on the white side. I agree, the chapter needs a good diagram of the transistor pinout. The attached diagram is the ztx1051, but it has the same pinout at the ztx1049A. That transistor is used because it has a very high current rating for that size of package, as well as very high gain. So a small current from the Stamp into the transistor base will control the much larger pump current.

    Relays in general cannot be driven directly from Stamp pins, so that is not an option to drive the pump. Relays too take more current than the Stamp pin can safely provide, so it is customary to use a transistor there too.


    Please try the pump circuit again, and let us know what you find. Be sure the circuit is hooked up right as an emitter follower using the diagram. The collector goes directly to +5 volts, the emitter goes to the 10 ohm, 1 watt resistor and then to the pump red wire, and the transistor base goes to a stamp pin via a 100 ohm resistor.

    Oh, be sure to check the pump itself, by connecting it through the 10 ohm, 1 watt resistor to +5 volts.

    ztx1051.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 9/8/2004 7:03:52 PM GMT
    67 x 79 - 317B
  • dhassalldhassall Posts: 6
    edited 2004-09-08 - 16:34:25
    Dear Tracy and Aristides,

    Thank you for· your replies.· I have read both of them and I appreciate your comments.·

    When I built the pump ON/Off circuit on my other Stamp board that is very similar to the Parallax Board of education it was to use the 1 amp 5 volt supply.· But the circuit worked the same as it did on my "homework" board.· The pump would come on as soon as it got a High 3 command but wouldn't shut off when P3 went low.· I think now that my high current transistor is appearing shorted but when I disconnected the pump and put a led with a 470 ohm resistor on the emiter lead, the Led would go off and on with the commands· coming from the stamp.· Since the only test instruments I brought with me is a digital multimeter, I have suspended further troubleshooting until I get back home.· (in about two weeks) where I have a full test bench setup to analyze what has gone afoul.· when on the "homework board I was only using two flashlight D cells in series as the power supply (The reason I only used two was that was all I had and the local Indian trading post was closed) for the pump it did pump water but it may have caused too much current draw through the transistor and wiped it out.· I have spare transistors and other parts at home but I am on vacation right now and can't get to them.·I am sure that I had the circuit hooked up correctly on both·my Homework board and my Board of education.· The only question was the pinout of the high Beta transistor...

    For some reason the attachment that·Tracy sent me in his message for the pinout of the transistor didnot come out like the one on the block concections for the 555.... when I put my pointer on it it doesn't highlight???··and I can't seem to get it to·come up to·view it or copy it to my desktop....Not sure what I am doing wrong????··

    Thanks for the help.... Give me a couple of weeks and I will get back home·and put this back together and figure out what went wrong....



    73... Dave
  • dhassalldhassall Posts: 6
    edited 2004-09-08 - 16:41:55
    Dear Tracy and Aristies,

    Here is the "QuickieLab" that I built and use for my "board of education".... It was put out by the American QRP Amateur Radio Club as a kit. It can be viewed at the following URL:
    http://www.njqrp.org/quickielab/index.html The kits have all been sold but it is a really nice
    test bed for a lot of projects, once you learn how to program the basic stamp.

    73.. Dave
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-08 - 16:48:42
    Has anyone noticed?· This is the third post (Tracy's) where the attached pictures are not linked or viewable...



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • Tracy AllenTracy Allen Posts: 6,475
    edited 2004-09-08 - 19:12:16
    Yes, I don't know why the image does not appear. The attachments manager said that it was there, and I just went back and tried it again (from a different computer), but same result. So, I put the diagram on my web site and referenced it this way:
    ztx1051.gif


    Dave, that is strange that the transistor will not turn off when the pump is connected and the pin connected to the base is brought low. It should be possible to troubleshoot this with a digital multimeter.

    -- What happens to the voltage on pin p3? Does it go low as it should?

    -- What happens if you connect the base of the transistor directly (via the 100 ohm resistor) to Vdd and then directly to Vss. ? Does it turn on and off?

    -- Is the program otherwise operating normally when the pump fails to turn off, that is, without resetting or doing other strange stuff?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dhassalldhassall Posts: 6
    edited 2004-09-08 - 19:47:43
    Dear Tracy,

    I had the transistor in correctly on both boards. It may be that my transistor is defective from the get go..... The P3 output from the basic stamp 2 "homework" board and the Other board both go on and off as monitored by a Led that I connected up through a 470 ohm
    resistor on both the base and emitter of the transistor. when the program puts a high 3 on the line the led lights and goes out on the low 3..... the led on the emitter is dim all the time saying that the transistor is conducting but large voltage drop and the pump is running pumping water...... when the input from P3 goes low the led goes out.... but the pump keeps
    running (can't determine if it is slower or not...seems to be the same speed)...LED is still
    dim... when I unplug the ground for the motor batteries... then the emitter led gets bright as it is the only load but also goes on and off with P3 signal...As I see it... the only way this can
    happen is the transistor has a emitter to collector short....that is the only way that I can see
    those indications....When I remove the motor ground... the emitter base junction is passing the P3 high/low signal on to the emitter's LED indicator. Not sure how the transistor got whacked unless me not using three 1.5 volt batteries for the motor power supply when using the "Homework" board cause it to draw too much current and took the transistor out on the
    first try.... After that it just didn't work anymore no matter what board I put it in or what power supply I used. But I suspect that is where it all went wrong. Since my Snail mailbox and my fine electronics workbench with all my test equipment is 400 miles away from me right now, I am forced to sit back and relax and work on my Soil Moisture sensor designs and wait until I get home from vacation in a couple of weeks. Then maybe I can resume
    the troubleshooting and analyze what really went wrong. My "homework" board checks out OK and my other experimenters board checks out ok....so it almost has to be the "Super Beta" transistor that has gone south....

    I didn't try connecting the transistor directly (via the 10 ohm resistor ) to Vdd and Vss..and see what happens...The program other wise operating normally when the pump fails to
    turn off, that is the P3 terminal does go high and then low as it is commanded. ..I went back to your last reply and I think I have answerd all you questions.....
    Thanks for the help Tracy.... If I get some time this evening, I will put it together on my
    big board and check it again...

    73.. Dave
Sign In or Register to comment.