Show Posts
Pages: 1 ... 328 329 [330] 331 332 ... 844
4936  Using Arduino / Project Guidance / Re: usb shield connectivity to printer on: August 31, 2013, 08:08:42 am
No.

What are you trying to achieve? Replacing a straight forward USB cable with an Arduino and USB host shield does not give any obvious benefit, and to work at all would take massively more work than you are implying. Depending what your end goal is, there may be better ways to achieve it.
4937  Using Arduino / Project Guidance / Re: My attempt at bio inspired robotics on: August 31, 2013, 08:05:15 am
Since you don't seem to have any questions, this thread would probably be more appropriate in the Exhibition / Gallery section of the forum.
4938  Using Arduino / Project Guidance / Re: sending AT commands to receive sms on: August 31, 2013, 08:03:12 am
Any advice /suggestions as to where the problem might lie?

Somewhere in your code, I would guess.

Which we can't see.
4939  Using Arduino / Programming Questions / Re: PWM pump speed control on: August 30, 2013, 08:23:52 pm
You need to implement a feedback algorithm to determine the pump speed required to achieve your target temperature difference. Essentially, you code would:
  • Read the temperatures and calculate the current temperature difference.
  • Compare the actual difference against your target difference to calculate the error
  • Calculate the pump speed required to reduce the error
  • Run the pump at the calculated speed

The algorithm would run repeatedly. The most complex part is 'Calculate the pump speed required to reduce the error'. If your system is simple and fairly consistent and stable then you might be able to get away with a simple proportional control, but if you have significant lag and inertia you will probably find that a PID feedback algorithm gives better results. There is a PID library for Arduino but using it is non-trivial so I suggest you give the simple proportional feedback algorithm a try first.
4940  Using Arduino / Project Guidance / Re: Make the Serial.print(); sen the info to a application on: August 30, 2013, 08:13:23 pm
Serial.print sends the data to the Arduino's hardware serial port. If your Arduino has the conventional USB setup, and the USB port is connected to a PC, and the Arduino USB drivers are installed on the PC, then when the Arduino connects it will create a virtual serial port on the PC which a PC application can open and read to receive the data printed by your sketch. What application you use, and (if it's one you write for yourself) how you write it and what it does with the data is entirely up to you.
4941  Using Arduino / Programming Questions / Re: finding the correct readings for mapping on: August 30, 2013, 01:24:57 pm
I am using a flex sensor hooked up to a arduino fios and i cant seem to find the correct reding for the function.

Sorry, I don't understand the question. What do you mean by "correct reading"?
4942  Using Arduino / Programming Questions / Re: Can anyone tell me what is the connection with the android in this arduino code on: August 30, 2013, 11:38:13 am
Well, it seems to be using a MeetAndroid library and creates an instance of class MeetAndroid (presumably defined in that library) but doesn't do anything with the object other than instantiate it. So if there is a connection, I would guess that is where it is implemented. But I wouldn't assume there is a connection since the sketch does not appear to do anything with the object.
4943  Using Arduino / Project Guidance / Re: Resolution question - 12 bit servo, 8 bit Arduino Ethernet on: August 30, 2013, 11:28:00 am
In my experience some servos just jitter anyway due to particular combinations of load, backlash, electrical noise etc even when they are driven from conventional RC receiver hardware (which I assume produces consistently accurate timing). May be that is all you are seeing. But I remember reading a thread here recently which implied that the Servo library did not produce very consistent pulse timing and if so that could be exacerbating the problem. I suggest doing a search for terms like servo pulse timing accuracy over the past few months and see if you can track down the thread. If I remember correctly, the problem was resolved in one case by using a different Servo library implementation.
4944  Using Arduino / Project Guidance / Re: Pedestrian Detection on: August 30, 2013, 11:23:13 am
It's all feasible as long as you do the image processing on a PC, and it seems quite a few people have used OpenCV to solve that type of problem. There are some very small PCs available, such as an RPi, which should have enough power to do this sort of thing. An Arduino would be a sensible way to interface between the PC and the servos.

The idea of an automatic sentry gun has been around for some time and various people have got them working very well - a laptop seems to be a common platform for the image processing part of the problem but I would have thought that very little of the solution would be platform-specific and you might well be able to find an open source solution that could be ported to whatever PC you wanted if you search for terms like turret, sentry.
4945  Using Arduino / Project Guidance / Re: Rx unique byte to turn on specific LED patterns on: August 30, 2013, 11:16:18 am
If the number of LEDs you're controlling is eight or less, you could just control them directly by associating each bit in the incoming data byte with a single LED. That removes the need to do any mapping or lookup from the incoming data byte to the LED states - the incoming data gives you the state directly. Then it's just a matter of testing whether there is serial data available, reading the incoming serial byte, using a for loop to process each bit in the byte, using bitRead() to extract the bit value from the byte and digitalWrite to write that bit value to the corresponding LED output pin. If you hold your LED pin numbers in an array and use the bit number as the array index, the whole thing would only need half a dozen lines of code.
4946  Using Arduino / Programming Questions / Re: help with code (battery tab spot welder) on: August 30, 2013, 10:20:03 am
If you only want one timed pulse output each time a switch is closed, have you considered just using a 555 hardware timer? It would be much simpler and cheaper to implement and probably a lot more robust than putting a microcontroller in such a noisy environment.
4947  Using Arduino / Programming Questions / Re: Motor smoother speed changes on: August 29, 2013, 12:42:34 pm
But in case it does, will the code be something like this?

Unlikely. The range of possible return values from analogRead() is 0 .. 1023. What values you actually get in your case will depend on the external hardware you're connecting, and you need to know what range of return values correspond to the range of joystick positions. Then you need to decide how you want to relate the motor speed to those positions.

In your original code, you just tested the position against four fixed ranges and had a fixed speed for each range, so the motor ran at one of four speeds. This doesn't give a smooth progression and I assume this is why it isn't working smoothly. I suggest that instead of using four fixed speeds, you use the joystick position to calculate a proportional speed. The map() function would be an easy way to do that.

Code:
int joystickPosition = analogRead(JOYSTICK_PIN);
int motorSpeed = map(joystickPosition, JOYSTICK_MIN, JOYSTICK_MAX, MOTOR_MIN, MOTOR_MAX);
analogWrite(MOTOR_SPEED_PIN, motorSpeed);

JOYSTICK_MIN and JOYSTICK_MAX are two constants you would define which record the analogRead() values corresponding to the extreme positions of the joystick.
MOTOR_MIN and MOTOR_MAX are two constants you would define which record the motor speed you want at those extreme positions, probably 0 and 255.
4948  Using Arduino / Project Guidance / Re: VEHICLE TRACKING WITH ACCIDENT DETECTION on: August 29, 2013, 12:28:51 pm
Thinking about this, wouldn't a plain old smartphone be a better platform for this project? That would give you a GPS location, video and still capability, accelerometer, network connectivity, user-friendly development environment and much, much more runtime resources available to you.
4949  Using Arduino / Project Guidance / Re: Hyperbaric on: August 29, 2013, 12:25:15 pm
You're sucking air out of a sealed chamber - presumably with a person inside it.

To me this has "safety critical" written all over it and I'd be extremely cautious about modifying the chamber at all, but I'd be especially cautious about using a DIY hardware and firmware solution to control a safety-critical part of the chamber. What's the worst that could happen if your controller has a logic fault or hardware fault and does the wrong thing at the wrong time?
4950  Using Arduino / Programming Questions / Re: Major Lag when adding Sensor programming to loop???? on: August 29, 2013, 07:13:23 am
data is sent every draw cycle of the Processing sketch. I hope that answered your question...

Sigh.

No, it doesn't. I have no idea how frequently your Processing sketch performs draw cycles. How many commands do you expect to receive per second?

If they are only limited by the speed of the serial connection then this is a bad idea because the serial buffers at both sides of the link will add latency. You need to control the transmission frequency so that the serial link does not ever get congested, and then design your sketch to ensure that it can always process the incoming messages when they arrive at this frequency.
Pages: 1 ... 328 329 [330] 331 332 ... 844