Show Posts
Pages: [1] 2 3 ... 28
1  Using Arduino / General Electronics / Re: Piezo Horns for swim race starter - flyback diode ? on: Today at 11:40:18 am
Many Thanks Paul

The LM386 is probably 2 weeks away from being able to arrive here - and with our postal service, there is less than 20% chance that once ordered it will actually arrive.

Could any of the other components I have not be used instead ?

They are :
ULN2803 Darlington Driver 8 channel ICs
IRFZ44N 41A 55V N-channel MOSFET
SN754410NE quad half-H drivers
74HC595N shift registers.

Again, Thank You for your advice.

Regards
Dave
2  Using Arduino / General Electronics / Re: Piezo Horns for swim race starter - flyback diode ? on: Today at 08:17:24 am
Hint:  Just get an LM386.

Many Thanks for the feedback. Obtaining parts around here is a very long process, but I do have the following in my 'box of bits' :

ULN2803 Darlington Driver 8 channel ICs

IRFZ44N 41A 55V N-channel MOSFET

SN754410NE quad half-H drivers

74HC595N shift registers.

Can you please advise me which, if any, of these could be used to drive the 3 piezo horns, and any advice or diagrams of the best way to use them would be really appreciated.

I have little knowledge or understanding of these components, but my gut feeling is to use the PWM pin 12, connected to a 2N2222, to control the IRFZ44N MOSFET, which would power the piezo horns. My concern is that the horn, when given power ( 12VDC ) makes a single 'click' and only makes a tone when the Arduino Tone is used on the PWM output pin - this has worked with a single horn connected to the 2N2222. Is a mosfet capable of switching the power to the horn at the same speed as the 2N2222 ?

This is a kids charity project I am doing ( which makes it more important to me ) and I am starting to run out of time to get the rest of the project completed and could really use any assistance that you could offer to get these horns working reliably.

The rest of the system with the start timer, android tablet based internet web server, php script for event management and all the whistles and bells is all done - just the horns to complete now.

Regards, Dave
3  Using Arduino / General Electronics / Re: Piezo Horns for swim race starter - flyback diode ? on: Today at 01:20:57 am
No, but you can probably drive three transistors from an Arduino pin.
As always, though...we're missing schematic, etc.

Here's the diagram of the existing setup.
4  Using Arduino / General Electronics / Re: Piezo Horns for swim race starter - flyback diode ? on: August 21, 2014, 01:42:36 pm
It is not a wise idea to feed a piezo with pulsating DC. It may damage the piezo.

Is ' pulsating DC ' and the arduino samples ( like http://arduino.cc/en/reference/tone ) not the same thing ?
5  Using Arduino / General Electronics / Re: Piezo Horns for swim race starter - flyback diode ? on: August 21, 2014, 09:23:27 am
1000 ohm impedance divided by 3 is 330 ohms, not unreasonable but at 7 kHz instead of 1 kHz, that is one-seventh or 50 ohms so you could be looking at a current draw of a quarter amp, depending on the other details following:

My main power supply is 12VDC 2A. Apart from the horns, the only other components are the Arduino itself, and a 3.3V reg for the ethernet module.

The piezo driver is a capacitor, of itself it will not generate a back EMF unless it resonates.  You have not specified the pull-up resistor value.  OTOH, to drive it correctly it should have an inductor across it, which will generate a back EMF however that is exactly how you properly drive piezo "screamers".  The whole situation becomes much more complex.

Output pin 12 has a 1K resistor to the transistor, and a 100K pull-down to ground.
The negative pin of the horn that connects to the transistor, also has a 550ohm pull-up resistor to the 12V line.

I hope you are not feeding 9V into Vcc.

Sorry, that should have said 'the Vin' pin of the Mega, which as far as I understand, does not require 5V regulated power.
6  Using Arduino / General Electronics / Piezo Horns for swim race starter - flyback diode ? on: August 21, 2014, 08:16:19 am
I have a piezo horn that I will be using to sound the start of swim events.

I can not locate a datasheet, except for this info :
Impedance  1000 ohm @ 1 kHz
Voltage Nominal  15 V
Voltage Peak  35 V
Frequence Response  3 kHz - 30 kHz
Sensitivity  1W,1m   92 dB

I am using a PWM tone of around 7 kHz.
The piezo horn is connected with a constant 12VDC to the positive pin, and the negative horn pin connected to a 2N2222 or 2N3904 NPN transistor.
The piezo negative pin has a pull-up which I found was needed to 'reset' the horn between pulses from the transistor.
The transistor is driven with a series resistor from pin 12 of a Mega 2560.
The horn is currently working and I am satisfied with the sound and volume.

But since we are likely to have 400 parents shouting for their kids, I want to add another 2 horns so they can be positioned behind the starting line - don't want any parents complaining their kids couldn't hear the start horn.

So my questions are :

1. Should I be able to drive 3 horns from the same transistor ?

2. should I add diodes ( 1N4004 ? ) across the terminals of each horn ( like I need to do for relay coils ) ?

The 12VDC that feeds the horns is also connected to an 9V linear voltage regulator that is used to power the Arduino ( Gnd and Vcc pins ).

7  Using Arduino / Project Guidance / Re: Project too complicated ? on: June 22, 2014, 04:01:39 pm
My thought is "bugger the Arduino, protect the swimmers".
But hey! That's just my POV, as a swimmer.

Are you saying the cabling is safer when connected direct to the Arduino and using the internal pull-up resistors, or when using the 5V powered optocouplers ?

Since both systems are using 5V, would there be any difference ?

And YES, protecting the swimmers is of utmost importance. One of the kids is my own, and he has one heck of a bad a$$ mommy.
8  Using Arduino / Project Guidance / Re: Project too complicated ? on: June 21, 2014, 12:39:03 am
Thinking outside the box. Garden hose, when used normally, keeps water in. Run your cable through a new length of (dry) hose (use talc to make it slide through easier) to keep water out. Seal the ends of the hose with silicon sealant and keep them out of the water to keep your cable dry.

Herny_Best

Thanks for the idea about the hosepipe. Will also help to stop damage to the cable if someone accidentally stands on it, and will also prevent kinks.

I don't understand your need for optocouplers. One side of your switches will be ground, the other side will have a voltage on it, whether you use optocouplers or not.

OK. So the one side of the button / switch will be permanently connected to Ground, and the 'open' side will have a pull-up resistor. My thinking on the optocouplers was to use them to protect the Arduino.

But from your comment, it looks like Ground is Ground, so I can easily use a 5V supply for the optocouplers and the ground to the finish line and back.

Appreciate the input.
9  Using Arduino / Project Guidance / Re: Project too complicated ? on: June 20, 2014, 04:39:58 pm
run a simple cat cable to the other end with 5V and ground, 6 buttons to each wire.

Thanks shooter.

Sounds like the same as I was thinking, except I was planning to run the Vcc to the optocouplers, and then only the ground needs to go down the cat5e to the finish end for the buttons to return when pressed / circuit closed.

On that point, would there be any difference in the quality / strength of the Ground signal that has to go from the start, to the finish, and back again ( when a button is pressed ), a round distance ' there and back ' of about 90 meters ( 280 ft ), when selecting a 5V supply compared to a 12V supply.

5V supplies are laying around all over my office as discarded cell phone chargers, etc.  The first one I just picked up is 5VDC 0.7A.

The optocouplers ( SFH615A ), if I am reading correctly, have a forward voltage of 1.25V 60mA, so should easily be able to power 12 optocouplers from one of these.


10  Using Arduino / Project Guidance / Re: Project too complicated ? on: June 20, 2014, 06:40:18 am
Time measurement will be much easier with a single Arduino. It is not that easy to synchronize time between two devices.

...R

Thanks Robin2

Although the time calculation is not super serious if we lose a fraction of a second while communicating the start time between arduinos, I am concerned about the increased possibility of errors and faults with every additional device and comms line in the system.

Looks like the single Arduino is currently the preferred choice. Any advice on the pull-up resistors and optocouplers ?
11  Using Arduino / Project Guidance / Re: Project too complicated ? on: June 20, 2014, 06:37:40 am
Quote
The start is triggered by an Arduino which activates the start siren, tracks the start time millis, as well as uploads data to the PC using ethernet.
If the arduino only sounds a siren for start and logs the time and does not need to detect early jumpers off the start line then why not put the arduino at the finish end and maybe just run a cable for the siren to the other end if needed.

Thanks Riva

I had considered that, but the mains power is at the start line end of the pool, as is the PC and router. My thinking was the single Arduino at the start end, and only ground carrying cable along the ground to the finish line for the timer buttons. Sounds much safer than having to run power to the arduino at the finish ( either AC Mains or 12VDC ) and then still having to run a network cable all the way back to the router and PC at the start end.

12  Using Arduino / Project Guidance / Project too complicated ? on: June 20, 2014, 02:45:28 am
We are all 'outside the box' thinkers, but which side of the box are you looking from ?

I am busy with a swim pool timer project for the local kids club bi-annual gala.
We are not using the costly touch pads, but rather simply push buttons to end each timed event.

The project consists of a web based event management system run on a local PC using xampp as the server.
Swimmers are captured, record times stored in the database, lane allocations and multiple heats scheduled, etc, etc.
The web side is just about completed and busy with testing.

The start is triggered by an Arduino which activates the start siren, tracks the start time millis, as well as uploads data to the PC using ethernet.

Each of the 6 lanes has 2 timer buttons at the finish end.

Question : from the 2 possible options below, which would you consider to be the most reliable :

Both option require the laying of an ethernet cable from one end of the pool to the other. Wireless / RF is not an option at the moment due to cost and availability.


option 1 :
----------
2 Arduinos, 1 at each end of the pool ( distance 45 meters / 140 ft ), both connected to an ethernet router ( PC also connected to router ) , with the 'starter' unit telling the 'finish' unit the millis ( A ) when the event was started, as well as the millis ( B ) when the data is sent to the 'finish' unit ( so the finish unit can receive the data, calculate that the start time was ' CurrentMillis - ( B - A ) ' ) and then wait for the input pin for each lane to be pressed ( LOW ) and calculate the actual swim time. Then upload the finished times to the PC over ethernet.

Is this too complicated / complex ?
A mountain out of a mole-hill ?
Using the second Arduino where it is not needed ?
Too many steps making system failure more possible ?

option 2 :
----------
Run 2 lengths of cat5e cable from the finish back to the start, and have only 1 Arduino at the start end, connected to the router to upload data to the PC. Floating Lines in the cat5e cable would need to be pulled HIGH, and the press of each button would Ground the line back to the input pin.

Of the 8 core in each cat5e cable, 2 can be ground, and the other 6 to each of the 6 lane buttons. Running 2 cables means that we have 2 sets of ground lines, and each of the 2 buttons for each lane are connected back to the Arduino on different cables - so if one cable is damaged, we only lose 1 button on each lane, and still have the second button for timing.

My thought is that this option does not require me to run any power to the other end of the pool, as the lines for the buttons are all Ground lines. Sounds safer to me.

If this is the more simple and reliable option, would you :

1. Use a separate 12VDC power supply ( at the Starter end ) for the Ground signal and return inputs that has to go the 140ft ( and back to the start unit ), and connect the ground signals from the buttons to optocouplers ( to trigger the input pins on the arduino ) ?

2. What size pull-up resistors should I be looking at on the floating return lines while the button is 'open' ?
Does length of the cable affect this resistor size ?

Any other factors that you can think of that would / could affect the viability of these options ?

Maybe I am looking at the options with blinkers on, so all input greatly appreciated.
13  Using Arduino / Networking, Protocols, and Devices / Re: ENC28J60 modules conflicting on: June 19, 2014, 03:42:36 am
Hi PaulS

Thinking about your comment on the size of the char :


Code:
char XXbuffer[200]; /* local buffer into which strings are encoded and from which they're output'd */
sprintf (XXbuffer, "U1txStart=1&U1millis=%ld&U1txEnd=1", millis());
It's worth taking your shoes off, if you need to, and count the number of characters you really need in the array. 200 is far too many. You don't have the resources to waste.


would it not be better to use a String that will expand as more data is added to it ?

I have seen code online that includes this :
Code:
String txData =""; // This is the Data that will be sent to the PHP page. It will have variable names and data in it.

txData = "DataToSend1=" + (String ( '__some integer or long value__' )) + "&DataToSend2=" + (String ( '__some integer or long value__' ));

client.print(txData);    // send the String to the php script

and if so, would it make any difference to the resources after the data is sent to the php script, if the String was reset, say with :
Code:
String txData ="";
14  Using Arduino / Networking, Protocols, and Devices / Re: ENC28J60 modules conflicting < solved > on: June 18, 2014, 04:58:04 pm
Finally with some pointers and direction from the guru's, I have a working solution that appears stable after 2 hours of testing.

My mistake was to assume that, because I was running xampp on my PC as a web server so that I could host php files on my PC and have the Arduinos interact with the PC based data, that the IP address of the xampp web server ( in my case 192.168.1.100 ) should be used as the Gateway and DNS server when setting the UIPEthernet.begin

I changed these to the IP address of the router ( 192.168.1.254 ) and guess what -- worked !   I can't believe I didn't think of trying that earlier.  It was only after an earlier reply from PaulS, that I stripped the code down to the bare minimum, and went so far as to remove the code that he mentioned was wasting space / resources. The problem still existed, but at least I was dealing with a lot less code to try and find the cause in.

Once I had each of the Arduinos communicating with the PC individually, I connected them both to the ethernet hub, and found out something else :

In the code :
I had to change .print to .println at the end before the delay, and
I also had to add the ' User-Agent' line, otherwise it just would not transmit.

Code:
client.print("GET /test/RXard.php?");
client.println(XXbuffer);
client.println("HTTP/1.1");
client.println("Host: http://192.168.1.100");
                                client.println("User-Agent: arduino-ethernet");
client.println("Connection: close");
client.println();
delay(250);
client.stop();

I still have to re-examine the code that extracts the keys and values from the incoming http data ( as PaulS suggested ), but in case anyone else can make use of this, the working code that I have at the moment is in the attachment.
15  Using Arduino / Networking, Protocols, and Devices / Re: ENC28J60 modules conflicting on: June 18, 2014, 09:34:49 am
Hi PaulS

Thanks for the detailed reply and the length that you have gone to in your reply. I say this in the most sincere way and must add that your input on the forum, together with the other highly experienced members, is so greatly appreciated and valued by those of us still trying to learn what you have already forgotten.

Looking at your reply, the points you mentioned don't seem to have relevance to the ethernet problem, unless you are saying that they would cause a memory problem that would break the sketch ?

Either way, your points are taken, and I will spend some time trying to better understand the code and how to make it more 'friendly'.

Your last point about the GET command : OK, so it may not be the 'usual way' ( and I am still to find the correct way to do this ), but my question is that if this code is working some of the time, it would appear to work as it is in the sketch, what could be causing the sketch to break ?
Pages: [1] 2 3 ... 28