Goal amount for this month: 100 USD, Received: 200 USD (200%)
Donate to support this site and ThinBASIC project development
- Rep Power
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..
Thanks a lot for letting us know.
- Rep Power
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..
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.
- Rep Power
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..
Then to append
If the volts of a battery == or < 6 volts, disable discharge relay
Well thats a plan... Anyways.