Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: have a recurring event every x seconds on: April 29, 2012, 04:51:32 am
awesome, thanks to you too. I was worried I needed to have to deal with interrups and maybe rearrange my actual code, which has grown quite long now and cumbersome to mess with.
2  Using Arduino / Programming Questions / Re: have a recurring event every x seconds on: April 29, 2012, 04:26:35 am
Quote
what would be the best way to include a recurring event like the one shown above inside my code ?
In the same way as the 'blink without delay' example works. Implement a finite state machine. Google is your friend.
Thanks, you too.  smiley
3  Using Arduino / Programming Questions / have a recurring event every x seconds on: April 29, 2012, 04:20:10 am
Hi,

I'm building an Arduino Mega based tennis ball machine, and I want to control the ball rate frequency using a programming logic like this:

- every 3 seconds
-- if the ball is ready and if the motors are running then
---- shoot the ball

the Arduino program is already doing other things, like listening for incoming serial data from the tbm remote control, setting pins high or low, sending serial data out, etc.: what would be the best way to include a recurring event like the one shown above inside my code ?

thanks and best regards,

andrea
4  Using Arduino / Motors, Mechanics, and Power / Re: Help with a VW Golf power window motor on: April 13, 2012, 07:43:20 am
- If I let the direction wire touch the negative pole, the motor turns anticlockwise, as expected, but it doesn't alwasy stop when I disconnect the wire from the negative pole, sometimes it keeps running, sometimes it stops. When it keeps running, it will stop if I let the direction wire touch the 5 volts.

On a second thought, this behaviour might be the one-push-to-fully-close-window feature that some cars have, the driver holds the button shut for a little longer and the motor keeps running until the window fully closes or the driver hits the switch again.
5  Using Arduino / Motors, Mechanics, and Power / Help with a VW Golf power window motor on: April 13, 2012, 05:40:37 am
hi,

I'm playing with the power window circuit of a 1994 Volkswagen Golf III, to drive its 12v DC motor using my arduino mega.

The VW Golf high level wiring diagrams can be read here, on page 35, but I couldn't find the datasheet of both chips on the driver board (I know, useless picture, but it was the best I could get out of my cell phone)



The chips are:

- a Microchip "FHS03 00129" "6D56G" "LLNB9610"
- an unknown manufacturer's "9614VGC" "6 66 30"  "00080"

According to what I could understand from the wiring diagram here's how I connected the 12v battery, a 5v source that mimics what the arduino would eventually supply, and the board connector:



- Now, when I connect the battery terminals only to the wires number 1 and 15, the motor is still, as expected (needs "enable" and "direction").
- When I let the direction wire (number 11) touch the USB port positive or negative pole, the motor is still as expected (needs "enable").
- Then I let the hotkey wire (black/yellow, number 7) touch the 5 volts from a computer usb port with common ground with the battery (something that sounds like "I turn the key on on the car"), the motor is still as expected (needs "direction").
- Now (it doesn't matter whether I keep the hotkey wire connected to 5v or not), if I let the direction wire touch the 5 volts positive pole the motor turns clockwise, and when I disconnect the direction wire the motor gets still, as expected.
- If I let the direction wire touch the negative pole, the motor turns anticlockwise, as expected, but it doesn't alwasy stop when I disconnect the wire from the negative pole, sometimes it keeps running, sometimes it stops. When it keeps running, it will stop if I let the direction wire touch the 5 volts.

Now I'd like to connect an arduino pin in place of the 5 volts usb cable, to feed the voltage needed to the direction wire (I just hope the motor will reliably stop from the anticlockwise position feeding it 5 volts for a short period of time), my question is: what it's best to do to protect the arduino in this scenario ? should I be using a diod to prevent current flowing backwards from the motor on the pin wire (it might be something the chips on the board are already there for, but since I can't get their datasheets I'll never know), or should I do something else ?

thanks and best regards,

andrea
6  Using Arduino / Motors, Mechanics, and Power / Re: newbie: how to count pwm pulses on: December 31, 2011, 07:10:24 pm
Thanks Darth Maker, I'll take a look at that library, it might help me with the fact that the steppers speed has dramatically slowed down now that I've added some DigitalRead (did I press left/right/up/down button ?) and if sentences (if I did then act accordingly) to the code loop().

I've added a most needed user interface to the project, which by the way is about building a tennis ball machine, reusing a broken HP ScanJet front panel for both lcd (standard hitachi with the "16x1 being 8x2 (or 40x2) thing" described here) and push buttons (lots o them), and here's where I am now:

http://s120.photobucket.com/albums/o181/andreacuozzo/My%20Awesome%20Tennis%20Training%20Instructor%20Assistant/?action=view&current=IMG_0265.mp4

The idea is to use three steppers for (1) left/right movement, throwing the ball on the forehand and backend, (2) up/down movement, throwing the ball higher and lower on the net, and (3) driving the "carousel" that filters a single ball out of the ball basket and sends it to the two main motors, 12v heat blowers from a car, running at some 2000 rpms in opposite direction, that compress the ball between their wheels (that is, between their fans that have been reinforced inside and outside to serve as wheels) and spit it out at (hopefully) high speed to the open court. The throwing element of the machine (basculating and rotating wooden case with throwing wheels inside) is almost ready to be tested on the tennis court, hopefully next week I'll know if the thing can work as expected.
7  Using Arduino / Motors, Mechanics, and Power / Re: newbie: how to count pwm pulses on: December 28, 2011, 01:29:07 pm
Thanks a lot! I've just tested your suggestion and It works like a charm, and it's way easier to control the motors speed playing with the delayMicroseconds. Thanks!

andrea
8  Using Arduino / Motors, Mechanics, and Power / newbie: how to count pwm pulses on: December 28, 2011, 10:50:02 am
Hi,

I've got a probably stupid question about steppers, it's my first time with motors so bear with me, here's where I'm at:

I've got a pcb with some stepper motors out of a printer external feeder module: it's got several Sanyo STK672-600 2-phase stepping motor driver chips on it, here's the chip datasheet:

http://bdent.com/v/vspfiles/downloadables/STK672-600.pdf

I've read it and thought it looked easy to solder some wires to the most important pins of the chip (actually I soldered to some convenient test holes in the pcb that were directly connected to the pins), and then I connected:

STK pin 12, clock, to arduino mega pwm pin 7
STK pin 13, cwb (direction), to arduino mega digital pin 22
STK pin 15, enable, to arduino mega digital pin 23

Setting clock (via analogWrite) and enable to high the motors run, setting cwb to low/high they change direction, very nice:

http://s120.photobucket.com/albums/o181/andreacuozzo/My%20Awesome%20Tennis%20Training%20Instructor%20Assistant/?action=view&current=IMG_0260.mp4

After a couple of tries I've understood that motor speed is linked to the pwm frequency, I've found that out by moving the STK clock wire from arduino pin 7 (lower frequency pin) to pin 4 (higher frequency pin) and the motors ran at double speed, now my question is: how do I tell the stepper motor to move an exact number of steps in any given direction ? the motors I'm going to use are Shinano 1.8 degree/step, so they'll take 200 steps to one complete revolution, one step should be one pulse (if I got it right), so is there a way for me to tell Arduino to send an exact number of pulses from the pwm pin to the clock pin on the Sanyo chip ? A forum search got me to this answer, if that's the way to go a link to an example of how to use the "Output Compare Match Interrupt Enable" would be great.

thanks,

andrea
9  Using Arduino / Networking, Protocols, and Devices / Re: Gps ngr-531 and arduino mega on: July 07, 2011, 02:27:06 pm
For a preliminary test to see if I could get nmea data out of it, on these small pins you can see in this blurry picture, glue was safer



safer, but not effective, in that the wires were not touching the pins anyway, as I've just found out. In fact now I'll have to go shopping for the smallest iron tip I can find, because the good news is I wasn't that wrong in my thinking: connecting tx to rxa and rx to txb as described in my earlier post, and the common ground you've suggested, got me the data:



this is with the gps receiver still looking for satellites, in the upper right is the VisualGPSXP (gps receiver windows utility) window displaying live data from the gps receiver via bluetooth, and in the lower right the same live data displayed on the arduino serial monitor, with me connecting the tx and rx wires from the arduino to the ngr-531 chip by hand.

thanks for your precious support, Paul

andrea



10  Using Arduino / Networking, Protocols, and Devices / Re: Gps ngr-531 and arduino mega on: July 07, 2011, 08:37:10 am
Thanks PaulS:

I've changed the code to use one of the hardware serial port (number 3) and a common ground between arduino and the gps: the code now loads with no problem (thanks), still no sign from the gps on the serial monitor (but I'm still in the office), I'll take it outside in a couple of hours and try again.

no kidding on the glue, the other option available at the moment was solder, that would have meant destroy the little chip right away.

andrea
11  Using Arduino / Networking, Protocols, and Devices / Gps ngr-531 and arduino mega on: July 07, 2011, 07:22:52 am
Hi,

I've got a small bluetooth gps receiver based on the ngr-531 chip, that I'd like to connect to my arduino mega to receive nmea data. I'm a total newbie on electronics in general so forgive the silliness of my questions. First, I've found the ngr-531 chip specs here:

http://www.scribd.com/doc/51133835/gps-navius

and thought that pin 7 and 8 (TXA and RXA), on page 8/15 of the manual, had to be interesting: I've carefully hot glued two wires on these pins and put them into my arduino mega pin 0 and 1 (RX and TX), then I've opened the NewSoftSerialTest sketch, modified the second line

NewSoftSerial mySerial(2,3);

into

NewSoftSerial mySerial(0,1);

and modified all baud rates to 9600, and finally I've loaded the code into the arduino. The gps receiver gets power out of its own battery (3,7v Nokia battery) while the arduino is powered by my laptop usb port, so the tx and rx wires are the only connection between them.

Once the code gets loaded, the serial monitor shows the code greeting message "Goodnight moon!", and nothing else. I've made a couple of tests, swapping the wires and playing with the baud rates, but still nothing comes out of the gps receiver (which is supposedly good for it's the one I use from time to time with my nokia n70 tomtom). Here are my questions:

- am I making things too simple by thinking that just hooking the gps chip TXA and RXA to arduino's RX and TX would do the trick ?
- do I need to connect the arduino and gps receiver grounds together ? (actually it was one of my tests, but when I did that I got a sync error from the arduino software when loading the code)
- do a gps receiver usually send out serial messages while trying (and not succeding) to get a satellite link ? I'm asking this because all the tests have been done in a office room, with no clear path to the sky, and the receiver had probably not been able to get a satellite link.

Thanks,

andrea
12  Forum 2005-2010 (read only) / Italiano / Re: Richiesta consiglio su primo acquisto di Arduino on: September 25, 2009, 02:20:23 pm
ciao,

il venditore è questo e contattato via mail per informazioni (domanda specifica "di quale modello si tratta") mi ha risposto che il modello è quello della foto.

saluti

andrea
13  Forum 2005-2010 (read only) / Italiano / Re: Richiesta consiglio su primo acquisto di Arduino on: September 25, 2009, 01:59:51 pm
Grazie mille Federico,

il venditore mi ha indicato quella foto come esattamente rispondente al modello che lui vende, quindi dotato (ora che me lo hai indicato me ne accorgo) di ATMEGA8: grazie per avermi indicato le differenze.

saluti

andrea
14  Forum 2005-2010 (read only) / Italiano / Richiesta consiglio su primo acquisto di Arduino on: September 25, 2009, 01:10:37 pm
Salve a tutti,

è il mio primo post su questo forum, dunque mi presento: sono Andrea da Genova. Da neofita dell'elettronica che si inizia a divertire con qualche piccolo circuito, ho deciso di dotarmi di una Arduino, ed ho visto un venditore nella mia citta' che vende l'Arduino che si vede a questo link a 18 euro:

120.photobucket.com/albums/o181/andreacuozzo/arduino.jpg

Potreste consigliarmi se sia un buon acquisto, oppure se si tratti di un modello un po' desueto che non vale il piccolo risparmio rispetto alla Arduino 2009 ? Ho cercato di identificare quel modello nella pagina del sito che presenta tutte le schede ma, probabilmente per mia inettitudine, non ne ho trovata una uguale identica, non foss'altro per il sito tedesco riportato sulla scheda.

grazie e cordiali saluti

andrea
Pages: [1]