Donate Now Goal amount for this month: 100 USD, Received: 0 USD (0%)
Donate to support this site and ThinBASIC project development

Results 1 to 5 of 5

Thread: Arduino and ThinBasic

  1. #1

    Arduino and ThinBasic

    Well guys, I'm Back!

    But this time to let ya know what I will try to do as far as programming..

    Prob. Read voltages off of 9 batteries and save value to file. Do this every 30 mins or so until last battery becomes 6 volts or less. (starts 8.4 or more.)

    I will be using an Arduino board to select and read the batteries since it has plenty of digital out to drive relays and analog inputs for reading value of selected battery. Will run its own program naturally!
    I will use ThinBasic via serial to read the values save as int on the arduino board and write it to a file. File header will be timestamp. Data will be as B1=xxx V, B2=xxx...etc.

    Arduino communicates via the comport (mine is usb as comm4) and I think I can use the time on the computer instead of using a time RTC library in the arduino for time.

    So it will begin.. No to write it..

    ThinBasic here I come..

    Old

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    47
    Posts
    7,622
    Blog Entries
    2
    Rep Power
    10
    Great.

    Thanks a lot for letting us know.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    So far so good, just doing it by little baby steps..

    I have ThinBasic send a chr$ 34 to ardunio and have adrunio send back the same.. Just with it saying "I received :XX" in the console of ThinBasic. So you can establish a serial link via the USB to/from the computer and the board.

    Next step is to do a little A/D and read it.. back..

  4. #4
    i have used before a USB to serial adapter to connect the (usb --> serial) to a LED directly to flash on and off as demonstrated here http://www.thinbasic.com/community/s...erial-emulator
    my next project is to run a small motor on and off by triggering a small relay circuit. there must be some safety diodes to prevent kickback currents from damaging the computer.
    but i think using those arduino boards http://www.arduino.cc/ are better to connect computers to environment since it provides more safety to the computer itself.
    Last edited by zak; 12-04-2012 at 12:00.

  5. #5
    Yes, the more I play with this 2560 mega board, the more I see that it will do more of a control for the functions.. Current plan is to have 3 type of relays, Discharge, Charge and Sense.

    There will only be one sense since I will have all the charge relays connected to them. So for as many as batteries we like to test, we will need a discharge and a charge relay. and only 1 sense.

    I will use the digital pins to control all relays and use the ascii table to control those pins on the mega board. Well thats the plan.

    My next test is to have the mega board look at the serial code, link the code recvd to a pin and lite an led.. Since pin 13 has an led, that be the test. Then I will look at the analog pin and change the voltage and display that.

    All this will end up be written to a file..

    Date/Time

    Bat1 Volts
    Bat2 Volts
    etc
    Bat10 Volts

    Then to append

    Date/Time

    Bat1 Volts
    etc

    If the volts of a battery == or < 6 volts, disable discharge relay

    Well thats a plan... Anyways.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •