Show Posts
Pages: 1 ... 100 101 [102] 103 104 ... 114
1516  Using Arduino / Sensors / Re: Poor performance of IR LED on: March 04, 2012, 12:55:29 am
Hi,
   Are you using the setup inside or outside, is there a lot of natural light around, maybe coming in through a window, if so try a shade around the camera sensor - without a shade my lap timer does not work at all, with a small matt black cardboard tube around the sensor it works flawlessly.

   Also try driving the LED with more current, I am driving mine with 100ma - obviously not directly from an Arduino PIN. You mention that you are sending a signal, I assume that this is a 38Khz coded signal of some sort in which case the LED is off a lot of the time and can be driven harder.

   To get a wider angle from a single LED, reflect it off something, try a quick experiment like pointing the LED up and reflecting if off your hand towards the camera, you will get a much wider viewing angle - a sheet of white paper or aluminium foil in a small housing for your transmitter will do the same but much more efficiently.

    I am using IR Emitters and Detectors for an RC Car lap timing project here -

http://rcarduino.blogspot.com/2012/03/punk-consoles-and-ir-transmitters-555.html

    EDIT: If you off load generating the 38Khz IR signal to a 555 timer, you can drive the LED harder and use a potentiometer to tune the frequency which will both help with range.

Duane B

rcarduino.blogspot.com

   




   

   
1517  Using Arduino / Sensors / Re: Suggestions on IR communication on: March 03, 2012, 01:04:50 pm
Hi,
   To tell which channel a pulse is for I would suggest an approach similar to radio based RC Systems. They use a fixed frame which contains all of the channels as consecutive pulse widths. If you use the servo library you can cheat a bit and get it to do most of the work for you.

The servo library automatically generates pulses using a 20ms frame, the pulses for each channel within the frame are between 1 and 2ms long.



See here for background -

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

The problem is that the Arduino Servo library doesn't quite do this in exactly the same way as an RC transmitter, but by using one dummy servo we can fake it so that its close to an RC Transmitter signal and will allow us to get two channels in and out of the signal.

Heres how -

1) Create a throttle servo and attach it to a throttle pin
2) Create a dummy servo and attach it to an unused pin
3) Create a steering servo and attach it to a steering pin

We use the dummy servo to create a 1.5 ms  space in the signal between the throttle and steering pulses.

Note: 1.5ms is the default pulse width we could change it.

In our receiver code we can work on the basis that -

1) If we haven't seen a pulse for over 10ms the pulse we are looking at now is the throttle
2) If we saw a pulse less than 2ms ago, that was the throttle and the current pulse is the steering.

The dummy servo is not used, but because of the way the Arduino Servo Library is written, we need this to create a gap between the end of the throttle and the start of the steering pulses within our single IR Channel.

You will need a small circuit to allow the throttle and the steering pins to activate your IR Emitter, or you can cheat and do a quick test with two IR Emitters if you have them - just for testing ;-)

Some IR Detectors have rules about the types and sequences of pulses that they will process, if that is the case with yours I am sure we can work around it.

Duane B

rcarduino.blogspot.com
   
1518  Using Arduino / Project Guidance / Re: Slotcar speed controller with display and electronic memory project on: March 03, 2012, 10:24:55 am
Hi Backbone,

Looking at all the sections of your code that are commented out, it looks like you should start using versions.  Strip out all the commented out code and save your project as SCSC_V1. If you add another feature, make it version 2 and so on. If you get to version 7 and something doesn't work its great to have six earlier versions that do to fall back on.

I do this all the time and it saves so much time.

Duane B.

rcarduino.blogspot.com



1519  Using Arduino / Programming Questions / Re: Precompiler directives - is there a case statement? on: March 03, 2012, 05:57:27 am
Hi,
   There are just if, elif, else and endif. If you look through the source code for the Arduino libraries you will see how these are used for a similar purpose to yours - they are sometimes used in combination to deal with the different Arduino processors (ATMega8,168,328 etc) and different clock speeds.

If you look in Servo.cpp you will see what appear to be nested directives - something I didn't know was possible until seeing it now !

Duane B

rcarduino.blogspot.com



1520  Using Arduino / Project Guidance / Re: Slotcar speed controller with display and electronic memory project on: March 03, 2012, 05:28:19 am
Hi,

Thats standard behaviour for an UNO, to reset on serial connection. I am sure there arensimple work arounds if you search for 'UNO disable auto reset'

Duane B

rcarduino.blogspot.com
1521  Using Arduino / General Electronics / Re: Dont Waste Your Time on: March 02, 2012, 01:59:39 pm
Hi,

I will get the wife to pick some up when she is in Europe next month, I am also desperate for heat shrink small enough for component wires. In Dubai you can buy the parts to start anything whatever your interests are, you just can't buy the parts you need to finish it.

There is a metaphore for The city as a whole in there somewhere.

Duane B

rcarduino.blogspot.com



1522  Using Arduino / General Electronics / Re: Dont Waste Your Time on: March 02, 2012, 12:57:43 pm
Hi,
   While there is certainly a lot of electolyte rich sweat in the Dubai heat, these strip boards are just plain bad quality. On some the copper strips visibly wander and on some the pin spacing changes, the worst do both ! I try to pick the best, but as there never seems to be any new stock my selection is getting worse and worse :-(

Duane B.

rcarduino.blogspot.com

1523  Using Arduino / Programming Questions / Re: Sending data directly to Excel on: March 02, 2012, 12:52:22 pm
Hi,
   While it looks like people have suggested successful approaches for getting data into excel, have you looked at using processing ?

   Its a visuallisation orientated programming language that talks very easily with Arduino. Have a look here -

   http://processing.org/

   You could create great graphics and animations fairly easily, have a look at some of the examples, I especially like the transforms for 2d and 3D work - not that I have done any, it just looks like a neat approach.

Duane B

rcarduino.blogspot.com
1524  Using Arduino / Project Guidance / Re: Radio Shack IR emitter/detector pair test on: March 02, 2012, 12:45:08 pm
Hi,

   Its good that you have something up and running, for your next project you can move anything that you want to do once only such as your print your intro into the setup function, its there to do one time setup and anything else you want to happen once before loop starts. I often do something similar to you and have my sketches send the sketch name and version to serial, put this into setup and you can take the if statement and extra variables out of loop, you can move setting the LED High into setup as well.

I don't know how interested you are in the programming side of things, it looks as if you might be interested because you are doing some very good things, I like that you have long readable variable names minVal, maxVal, oldVal instead of n,m,x,y etc. Its also really good that you are using define statements for your fixed values. If you had a look through loop you could find some lines of code that could be moved, for instance if its not a new value its not a new min or max value either so you could move these two tests inside the first test for a new value.

Its not essential, but it makes code easier to manage as you get onto bigger projects.

Duane B

rcarduino.blogspot.com



1525  Using Arduino / Project Guidance / Re: Basic Project on: March 02, 2012, 12:08:11 pm
Hi,
   Some of the online Arduino resellers have downloadable experimenter guides and online tutorials for intermediate projects, also checkout the playground section here.

Duane B

rcarduino.blogspot.com
1526  Using Arduino / Project Guidance / Re: Help buying Arduino Board on: March 02, 2012, 12:05:39 pm
Hi,

This is really good advice - 'get an Uno and save your money to buy sensors and other hardware' - the Uno is cool but on its own there really isn't very much to do, but follow wildbills advice and get a load of inputs and outputs and who knows what you will end up building.

Duane B

rcarduino.blogspot.com
1527  Using Arduino / Sensors / Re: Suggestions on IR communication on: March 02, 2012, 08:21:01 am
Hi,
   The 38 at the end of the part number tells you the frequency that the receiver expects, so in this case its 38Khz.

   You can use code to generate the 38Khz, but the 555 timer is such a fundamental chip to so many projects that you might as well figure out how to use one, it will also allow you to drive your IR Transmitter with much more power than an Arduino PIN, this will increase your range and reliability.

    Something quick to try is to build a 38Khz circuit with the 555 Timer, then use your Arduino to drive a servo signal which will enable/disable the 555 timer using the reset pin. On the receiver side, you 'might' be able to drive a servo with just a 5v power supply and the IR Receiver.

    If you want to get away from the requirement for a 38Khz signal, you can try an infra red detector instead of a receiver, but its so easy to generate the 38Khz signal with a timer (Arduino or 555) and it makes for a much more reliable system.

    Here is a quick update on one of my own projects where I am using an infrared detector the same as yours to detect my RC Car lapping. The RC Car has a simple 555 timer circuit (no arduino) outputting a 1 millisecond pulse of 38Khz IR signal.

http://rcarduino.blogspot.com/2012/03/punk-consoles-and-ir-transmitters-555.html

    One limitation of this is that if I want to use the system in bright sunlight I need to enclose the detector in a shade, this is no problem for me as I need the detection zone to be very tight anyway but If you plan on using your control system outside, IR might not be practical for you. If you decide not to go this way, build a 555 punk console, I have been dying to but haven't found the time.

If do you want to take the IR route, I would suggest that you do so in stages, and as a first stage I would suggest that you build the battery driven detector circuit from the Lady Ada link and build a 555 IR circuit. If you can activate the LED in the detector circuit with your 555 circuit, the next step would be to connect the 555 to the Arduino, let us know when you are ready to do that, you will need to add some decoupling capacitors first but we can get into that when we need to. After the decoupling capacitors it should all be simple enough.

EDIT: I have a nagging idea that its would possible to build the entire transmitter and receiver from a few timers, I have never tried it, but logically I can see how it could work.

Duane B

rcarduino.blogspot.com
1528  Using Arduino / General Electronics / Re: Dont Waste Your Time on: March 02, 2012, 07:30:08 am
Hi,
   Thats something I hadn't though of, I had a track appear to crumble away on a circuit recently, from what you say it was possibly another unseen short.

Here it is after bridging -



Duane B

rcarduino.blogspot.com
1529  Using Arduino / Project Guidance / Re: Help buying Arduino Board on: March 02, 2012, 07:04:13 am
Hi,
   This is a good example of what I mean by fitting projects to what you have, you can use shift registers (look up 74595) to massively expand Arduino outputs. You can chain a few of these chips together to get 8,16,24,32 etc etc outputs from three or four Arduino pins - with a little coding.

Duane B

rcarduino.blogspot.com
1530  Using Arduino / Project Guidance / Re: Help buying Arduino Board on: March 02, 2012, 05:39:17 am
Hi,
   Are there other boards more powerful than an UNO ? Yes, but with a UNO and a set of component kits to build more Arduinos you can do something really clever like have distributed Arduinos managing different functions of your projects, you can also make any of your projects permanent just by leaving a component Arduino in them at a cost of less than 10 dollars. The best part is that if in the course of doing something very clever you damage an Arduino you still have ten more.

It is all just my opinion, but I haven't been limited by an UNO yet, it might be that I am just not that imaginative or that I enjoy the occasional challenge of making a project fit what I have.

   Duane B

rcarduino.blogspot.com
Pages: 1 ... 100 101 [102] 103 104 ... 114