Show Posts
Pages: [1]
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Reading data from a text file on my computer on: October 16, 2012, 09:37:47 am
That is what I am trying to do. How do I get the PC to send the file to the Arduino over the USB port.
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Reading data from a text file on my computer on: October 16, 2012, 07:50:47 am
Quote
Is there a way to EASILY (I'm a noob) read this CSV file and stick the values into 4 (long) int variables
Read it where? On the Arduino or on the PC?

CSV is stored on the PC, I want to read it on the Ardunio.

Quote
Code:
for (int i = 19 ; i >=0 ; i--) {
   timeHistory[i] = timeHistory[i-1];
   sensor1History[i] = sensor1History[i-1]
   //....
}
Tell me exactly what happens when i is 0 on the last pass through this loop.

Oops, it should be i > 0. The (0) indices are filled in after the for loop.

Quote
Quote
It would be quite nice if it can be done in close to "real time".
You want to read historical data "real time"? How does that make sense?

Taking action at intervals, as determined by the difference between two timestamps is a different story.

Okay, I'll try this again. I am taking action in intervals based on the differences in timestamps and values in the sensor readings. What I would like to do is SIMULATE getting the data in real time if that makes sense.

The sample data in the CSV file was obtained from the Arduino and the sensors with about 1 reading every ms, but that was from a sketch that ONLY read the sensors and sent the comma delimited output to the Serial port. It didn't do anything else. Realistically, 1 reading every 10  - 30 ms would be fine once I put all the pieces together, the smaller the better obviously.

If I was to type in the historical data manually at the Serial Monitor the system would be getting about 1 reading for all 3 sensors per 1000 ms (if I type fast). I would not be able to judge if the system is working properly at that rate, since part of my code testing and fiddling is seeing how "instant" the response to the change in sensor readings is.

For example, 5 seconds into the CSV test file, the wheel was manually stopped for 3 seconds. So what I would like to see is 5 seconds after I start the sketch using the CSV file is for my light on Pin 13 to turn on for 3 seconds, then turn off.

Does that help?
3  Using Arduino / Interfacing w/ Software on the Computer / Reading data from a text file on my computer on: October 16, 2012, 01:06:43 am
I am working on troubleshooting the handling of sensor data on my project. Since connecting and disconnecting everything to correct my errors in logic, then try again, is a royal pain with this project (can't be done in my office), I've hooked up the sensors and outputted a bunch of data to a CSV file (copied and pasted from the Serial Monitor).

The CSV file looks like this:

0,695,730,774
1,695,724,776
2,692,724,774
3,692,720,774
4,687,720,772
5,687,710,772
....
64321,702 ,610,790

Column 1 is a time stamp (from a millis() call) and the other columns are the raw readings from 3 different sensors.

The data I receive from the sensors in a real scenario will be fairly consistent, but getting them to interact together properly and cause the "other stuff" will require a fair bit of fiddling, testing, cursing, and trying new stuff. I already have a good sense of what I need to do, but I know there will be a bunch of fiddling.

Is there a way to EASILY (I'm a noob) read this CSV file and stick the values into 4 (long) int variables

For example, at the end of the reading, this would be the values of each variable
long int currentTime = 64321
int currentSensor1 = 702
int currentSensor2 = 610
int currentSensor3 = 790

If I can get that, I can probably get started on the rest. I do not need to keep the entire history in the Arduino Uno - the current readings will be put into element 0 of a 20 element array like this which is about all the history I need:

Code:
for (int i = 19 ; i >=0 ; i--) {
   timeHistory[i] = timeHistory[i-1];
   sensor1History[i] = sensor1History[i-1]
   //....
}

timeHistory[0] = currentTime;
/....



It would be quite nice if it can be done in close to "real time". Sensor 1 will force an LED to blink whenever it gets over 740 during my testing (it's measuring the speed of a wheel) so I will be using that to get a visual sense of how the others are working.

Thanks.
4  Using Arduino / Project Guidance / Re: Getting Started: Sensors and Displays for a manual wheelchair on: September 18, 2012, 09:00:34 am
Radman : My daughter has been in and out of the chair for a few months while recovering from simultaneous injuries to BOTH ankles, so I am getting some insight from her on that. One of my clients is a non-profit that works with people with disabilities, so I get to interact a lot with their clients while I work on the computer system. Those are the main reasons I chose the topic, I have some previous inspiration and will get some technical advice from long term chair users. For some of them, this will be the first time they have ever been asked for advice.

Since this is a first year project, I don't want to get too complicated, and I doubt the materials will stay on the chair permanently. Once my daughter is fully recovered, we will likely pass the wheelchair on to someone else who needs it. GPS/Fitness would be cool, but as you say, likely a bit advanced.

Sail: You are right, that would be cool, but not really an Arduino project.
5  Using Arduino / Project Guidance / Re: Getting Started: Sensors and Displays for a manual wheelchair on: September 18, 2012, 06:32:38 am
Thanks Chagrin for the options. I just looked at the encoder, and while I don't understand everything right now, that will probably change in a few weeks once I learn a bit more about these kinds of things.

Angelo - thanks for explaining why the gyro won't work. Much appreciated. As for the turns, my plan is to have the user manually indicate a turn is coming up before the chair actually turns. Just like in a car, you (supposed to anyway) activate the turn signal prior to actually turning the wheel.

Depending on my time and materials, I might just make use of the turn detection to turn OFF the turn signal rather than just using a constant time. That method would be even more like a car with an automatic deactivation of the turn signal, but this will be a fine tuning of stuff that is already there.

Looks like the Pololu encoder can detect forwards and backwards motion as well. Once I learn a bit more, I will revisit the datasheet, as the price is certainly in my budget.

Feel free to keep the ideas coming. I'm likely going to learn more with this project than anything else I do.
6  Using Arduino / Project Guidance / Getting Started: Sensors and Displays for a manual wheelchair on: September 17, 2012, 10:41:16 pm
I am getting started with the Arduino by taking a "Making Gadgets" course in my return to University. For the final project, I will be creating an Arduinio controlled sensor and display system for a manual wheelchair.

At this moment I am looking for which sorts of sensors and parts I will be needing (and if you think this project is feasible for a beginner who is actively learning the basics in a formal class as I go).

We are using the UNO in the class, but it doesn't matter which Arduino we use for the project.

The target user would have paraplegia so leg/foot based controls cannot be used, and the hands need to be kept free to operate the chair. It must be a manual chair since I already have one that I can play around with. Sensors should not be placed anywhere on the hand rims since they are needed to propel the chair.

What I plan to have so far:

1. A display on the back of the chair that can show LEFT, RIGHT, BRAKE, and REVERSE signals (like on a car)

2. When not displaying anything from #1, it should be able to show a custom message (eg "Sit down for what you believe in") that the user can change. For now, I will likely use char arrays in the sketch, but will try use other interfaces to change the messages if I have time.

3. LEFT and RIGHT should be signaled by the user in some way, prior to the turn. My thought is a pair of pressure sensors (1 on each side) on the side of the chair that can be quickly  tapped to indicate a turn. The turn signal would turn off after 5 seconds automatically.

4. BRAKE should be automatically detected without input from the user. With a bit of coding work, it shouldn't trigger the display from normal variations in speed - only when the user is actively braking the chair.

5. REVERSE should also trigger automatically. I'm also thinking of adding a speaker to add an audible warning much like large trucks and buses.

Would this part work for measuring both speed changes and changes in direction (Clockwise vs Counterclockwise)?  If not, what should I be looking for?
http://content.solarbotics.com/products/datasheets/datasheet_idg500.pdf

One sensor that can do both is better than 2 sensors, each doing a different job, but I am open to using 2 sensors as well.

6. Finally, distance sensors that can sound a proximity alarm (or for rear facing sensors, also display a "You're standing too close" message on the display screen).

I would appreciate any advice on which parts to buy and what I should be looking for. I have a bit of a budget, but also don't want to buy $60 parts when a couple of $5 parts will do the same job.

Thanks.

Pages: [1]