Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
HATE TROLL TIM
Dec 14, 2006

MiNDRiVE posted:

Yeah I guess they would smell like a wire but these reviews make me wonder...

Just read what that guy says

But whatever i'll pick up a 100 pack and sniff them until I pass out.

I wondered about that as well. Several people talk about it in reviews, actually. I ended up not buying that product.

Instead, I got these: http://www.amazon.com/gp/product/B007MRQC1K/ + http://www.amazon.com/gp/product/B005TZJ0AM/ (From seller wosang_pro.)

They did have a bit of a gasoline smell to them, but it was nothing overwhelming and it certainly didn't wear off on my hands or anything. I simply took the bundles of wire, rinsed them off under warm water and soaked them in a bowl of isopropyl alcohol overnight. Then you just unbundle them and lay them on a towel to dry for a few hours. Smell completely gone! To be honest, if I didn't know to smell the wires in the first place, I most likely would have never noticed.

It's some sort of shipping preservative that is put on electronic components (PCBs, bare wire, etc.) to prevent it from rusting while it sits in an unsealed container on a ship in the middle of the ocean.

So, I can vouch for the bundles I linked above, just make sure you buy them from wosang_pro.

Adbot
ADBOT LOVES YOU

Acid Reflux
Oct 18, 2004

I'll second the "wosang_pro"-purchased jumpers. Mine had a very slight odor when I first opened the bag but it dissipated very quickly. I wouldn't idly nibble on any of them out of boredom, but they're probably as good as or better than any other cheap Chinese jumpers.

Mega Fone
Apr 27, 2007

I paint my fingernails with gloss varnish so I can feel like a pretty girl. :3:
Does anybody have any recommendations for starter kits to get in the UK?

I'm thinking about getting this one

Looking around each website does their own set so I don't really know which one I should go for as I don't have anything specific in mind and just want to create cool things.

huhu
Feb 24, 2006

Mega Fone posted:

Does anybody have any recommendations for starter kits to get in the UK?

I'm thinking about getting this one

Looking around each website does their own set so I don't really know which one I should go for as I don't have anything specific in mind and just want to create cool things.
I got this starter kit and personally didn't like it. My reasoning is that it comes with a book of "projects" to work on and all you really do is copy the code, wiring schematic, and then you're done. It doesn't really go in depth with much of anything. I would suggest two routes to go from here. The first is to find a basic project you'd like to work on and finding the required components and then purchasing those and using http://arduino.cc/en/Reference/HomePage and other online references to work towards completing the project. The second route would be to substitute out the book that come with that package and get something like http://www.amazon.com/30-Arduino-Projects-Evil-Genius/dp/007174133X/ref=sr_1_1?ie=UTF8&qid=1365366684&sr=8-1&keywords=30+arduino which I got. The book goes into decent detail about everything. After the first ten or so projects I learned enough to branch out and start making my own stuff without following a guide. If you decide to build your own starter kit I'd be happy to help, I just assembled one for my friend.

And a question of my own... I just ordered this wall wart: https://www.sparkfun.com/products/9442 and it lasted all of 30 minutes before dying on me. I've just finished assembling the hardware for my newest project and all I needed was the power supply to get started coding. I've just emailed Sparkfun to try and get a replacement but I'm wondering if I should be investing more in a power supply?

Edit: Updated the first post. Would like your feedback/input. Will add more later.

huhu fucked around with this message at 00:43 on Apr 8, 2013

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I have a Duemilanove/168 and seem to be having an issue with an interplay between the serial port and Timer0.

I'm trying to set up a watchdog timer that counts down over the course of ~1 second, disables the unit via setting a boolean to false if the watchdog gets to zero, or keeps the unit enabled by resetting the watchdog counter if a 'heartbeat' command is detected. The idea is that the control PC will send heartbeat commands periodically to keep the unit enabled during normal operation, but if communication is lost for any reason the Arduino-controlled system should shut itself down.

The problem I'm seeing is that whenever I open or close the serial port from the control computer the watchdog timer gets reset even when no heartbeat command (or data of any other kind) is sent. This is mysterious since calling HeartBeatCommand() should be the only way to reset the watchdog, and as far as I can tell (by making that command turn on the on-board LED) it's never getting called. It's as if just opening/closing the serial port resets heartbeatWatchdogCounter to 0xFF, and the output pin (pin2) goes high for ~1 second.

Any ideas as to what could be going on? My only guess is that something in the Arduino's serial com system is messing with my ISR for that timer, but that still wouldn't explain why the watchdog counter gets reset.

semi-edit: While composing this post I decided that initializing heartbeatWatchdogCounter to zero was better than initializing to 0xFF, and that one change seems to have fixed the spurious resets caused by opening/closing the serial port on the control PC. I can't understand how that would matter, but it's some kind of clue at least.

C++ code:
// varables
const int HEARTBEAT_PIN = 2;
byte heartbeatWatchdogCounter = 0xFF;
boolean heartbeatEnable = false;

// call this when a heartbeat command is sent from the control computer to reset watchdog counter
// and echo back the command ('H')
void HeartBeatCommand()
{
  heartbeatWatchdogCounter = 0xFF;
  Serial.println(HEARTBEAT_COMMAND);
}

// interrupt service routine for Timer0, this fires about 200 times per second.
ISR(TIMER0_COMPA_vect)
{
  if(heartbeatWatchdogCounter>0) {--heartbeatWatchdogCounter; }
  heartbeatEnable = (heartbeatWatchdogCounter>0);
  digitalWrite(HEARTBEAT_PIN, heartbeatEnable);
}

Bad Munki
Nov 4, 2008

We're all mad here.


I'd suggest posting either the entire program, or even better, an entire simplified program that demonstrates the problem. We can't see under what conditions you're calling HeartBeatCommand, for instance, or what kind of setup you have, or really anything else. The functions you chose to share look okay, so the problem is likely elsewhere or due to some interaction between the shared code and the not-shared code.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
Fair enough. The simplified code below seems to reproduce the problem, opening or closing the Arduino IDE serial monitor window (ctrl+shift+M) opens the serial port and appears to reset the watchdog timer and makes pin2 high for ~1 second.

It also appears to reproduce the issue where initializing heartbeatWatchdogCounter to 0x00 makes the serial port problem go away, while initializing it to 0xFF brings the serial port problem back. This is using the Arduino 1.0.3 IDE if that matters.

e: Just checked with the latest version (1.0.4) of the IDE and got the same result.

C++ code:
const int HEARTBEAT_PIN = 2;
const char HEARTBEAT_COMMAND = 'H';
int heartbeatWatchdogCounter = 0xFF;
boolean heartbeatEnable = false;

void setup()
{
  Serial.begin(9600);
  pinMode(HEARTBEAT_PIN, OUTPUT);
  HeartbeatTimerSetup();
}

void loop()
{
  while(Serial.available()>0)
  {
    char input = Serial.read();
    if(input == HEARTBEAT_COMMAND)
    {
      HeartbeatCommand();
    }
  }
}

void HeartbeatCommand()
{
  heartbeatWatchdogCounter = 0xFF;
}

void HeartbeatTimerSetup()
{
  //set up Timer0 registers
  TCCR0A = 0;
  TCCR0B = 0;
  TCNT0  = 0;
  
  // set compare match register 
  OCR0A = 0xFF;
  
  // turn on CTC mode
  TCCR0A |= (1 << WGM01);
  
  // set prescaler level
  TCCR0B |= (1 << CS12)|(1 << CS10);
  
  // enable timer compare interrupt
  TIMSK0 |= (1 << OCIE0A);
}

// Timer0 ISR
ISR(TIMER0_COMPA_vect)
{
  if(heartbeatWatchdogCounter>0) {--heartbeatWatchdogCounter; }
  heartbeatEnable = (heartbeatWatchdogCounter>0);
  digitalWrite(HEARTBEAT_PIN, heartbeatEnable);
}

PDP-1 fucked around with this message at 16:20 on Apr 21, 2013

TheLastManStanding
Jan 14, 2008
Mash Buttons!

PDP-1 posted:

Any ideas as to what could be going on? My only guess is that something in the Arduino's serial com system is messing with my ISR for that timer, but that still wouldn't explain why the watchdog counter gets reset.
Opening the serial monitor resets the arduino (in the same way that pressing the reset button does) which is why your value and pin state changes briefly. A quick google search led to an arduino playground discussion on disabling the auto reset.

evensevenone
May 12, 2001
Glass is a solid.
Just a suggestion, when debugging timer issues, start with a longer timer like 10 seconds and switch to 1 second when you get it working. This really helps if you have more complex interactions; just slow everything down by an order of magnitude or two.

Also having the device spit out "reset" on startup will save you a ton of grief.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

TheLastManStanding posted:

Opening the serial monitor resets the arduino (in the same way that pressing the reset button does) which is why your value and pin state changes briefly. A quick google search led to an arduino playground discussion on disabling the auto reset.

Bingo! That was the problem, and explains all of the symptoms I was seeing. Thanks so much for this - I was totally barking up the wrong tree thinking that the serial port was mucking with timer settings, and was thinking about dumping the ROM and searching for anything that touched the Timer0 registers manually. Instead it turned out to be something really simple. :)

evensevenone posted:

Also having the device spit out "reset" on startup will save you a ton of grief.

Also good advice, it helped confirm that the device really was being reset upon starting the serial monitor window.


Thanks again thread!

wolrah
May 8, 2006
what?
Total microcontroller newb here working on my first real Arduino project (as in more than just messing with the "Blink" and "Fade" demos).

I'm trying to drive an automotive instrument cluster (in particular one out of a late '90s DSM). So far I've managed to get the speedometer working fairly reliably above 30 MPH using a square wave generated by tone(), but it freaks out at lower speeds and doesn't reliably handle large jumps in speed (though I think this may be more of a design issue, real speed sensors don't suddenly jump from 40 to 160 MPH and it seems the needle attempts the most direct path, even if it goes through zero). I think the low speed issues are either caused by the lower voltage of the signal or it being a square wave and the cluster wanting more of a sine wave, maybe. More testing will happen when I can borrow a signal generator from a friend.

Anyways, my question is more about the tachometer. From what I can find this cluster just takes a direct tach signal from the ignition coil. This signal is a pulse per fire (so two per revolution for the I-4 car I harvested this from), but the signal is -12vDC. I have the ability to source -12v from my hacked computer PSU test supply, I just don't know how I can pulse it under control of my Arduino.

I have a latest-rev Mega and an Uno is on the way, plus a very basic electronics kit from college that includes a pile of resistors and some DIP-format gates and other simple ICs. Anything else I'll need to buy, but a few local stores have surprisingly extensive hobby electronics sections so common parts should be readily available.

HATE TROLL TIM
Dec 14, 2006

wolrah posted:

Total microcontroller newb here working on my first real Arduino project (as in more than just messing with the "Blink" and "Fade" demos).

I'm trying to drive an automotive instrument cluster (in particular one out of a late '90s DSM). So far I've managed to get the speedometer working fairly reliably above 30 MPH using a square wave generated by tone(), but it freaks out at lower speeds and doesn't reliably handle large jumps in speed (though I think this may be more of a design issue, real speed sensors don't suddenly jump from 40 to 160 MPH and it seems the needle attempts the most direct path, even if it goes through zero). I think the low speed issues are either caused by the lower voltage of the signal or it being a square wave and the cluster wanting more of a sine wave, maybe. More testing will happen when I can borrow a signal generator from a friend.

Anyways, my question is more about the tachometer. From what I can find this cluster just takes a direct tach signal from the ignition coil. This signal is a pulse per fire (so two per revolution for the I-4 car I harvested this from), but the signal is -12vDC. I have the ability to source -12v from my hacked computer PSU test supply, I just don't know how I can pulse it under control of my Arduino.

I have a latest-rev Mega and an Uno is on the way, plus a very basic electronics kit from college that includes a pile of resistors and some DIP-format gates and other simple ICs. Anything else I'll need to buy, but a few local stores have surprisingly extensive hobby electronics sections so common parts should be readily available.

What you're after my friend is a transistor! :science:

How much current do you need to source? If it's more than a few dozen mA you'll need a MOSFET (which is just a big transistor more or less). Drive it with one of the PWM pins of the Arduino and you should be good.

Are you sure it's -12v? That seems very strange. If you want to make the thing more compact in the future, you can build a voltage inverter relatively simply. In fact, I'd build the whole the whole thing (inverter and transistors) into one complete circuit so when you're done, all you've got to do is give it a PWM signal.

SomethingLiz
Jan 23, 2009
I'm hoping I can get some advice on motor options. I'm trying to move several wooden rods in and out in a horizontal linear way, like a piston. I need to be able to control how far in and out they go. My first thought was to use a stepper motor for each rod, and to use a linear gear to move the rods. The only problem is that there will be many rods, several hundred to a thousand, and at $5-10 each stepper motors get expensive quickly.

So, I'm wondering if there are other options that I haven't considered that might do the same thing cheaper. I looked into linear actuators, but they are even more expensive than stepper motors.

Any ideas?

Bad Munki
Nov 4, 2008

We're all mad here.


What range of motion are you after? What sort of load?

Is this because you saw that preview for whatever movie it was that has that dude laying on the bed that looks like one of those pin-impression-box things and it's holding him all floating around magic-like? :v:

SomethingLiz
Jan 23, 2009

Bad Munki posted:

What range of motion are you after? What sort of load?

Is this because you saw that preview for whatever movie it was that has that dude laying on the bed that looks like one of those pin-impression-box things and it's holding him all floating around magic-like? :v:


Haha.. No, although I did see that and I want that chair! The range of motion will be 5-10 inches, with no load on the rods, only the weight of the rods themselves.

Bad Munki
Nov 4, 2008

We're all mad here.


So some sort of automagic one of these things, then? I just mean in principle, is all.



Or some other surface? Like, that sort of thing across the surface of the sphere would be intensely cool as well, as it could drive itself across most any surface, especially coupled with a little feedback on the pins.

SomethingLiz
Jan 23, 2009
Yeah, pretty much exactly like that. I'm looking into continuous rotation servos right now, it seems like they might be a good option because they're a little cheaper and don't require motor drivers which should cut down the price a lot. I'm not sure if they'd be strong enough though.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


SomethingLiz posted:

Yeah, pretty much exactly like that. I'm looking into continuous rotation servos right now, it seems like they might be a good option because they're a little cheaper and don't require motor drivers which should cut down the price a lot. I'm not sure if they'd be strong enough though.

How much granularity do you need? 4 steps? 32 steps? A number of tick marks on each rod and an optical sensor, and you can use literally any directional motor.

Analog servos are also really cheap and reasonably easy to drive from 5v, although modifying "thousands" to be free-running would be tedious.

babyeatingpsychopath fucked around with this message at 01:50 on May 7, 2013

Captain Capacitor
Jan 21, 2008

The code you say?
Does anyone have an idiots guide to antennae? I've got an old 2.4GHz radio controller that someone gave me and I was wondering if I could somehow create a simple receiver for it. I just know nothing.

makomk
Jul 16, 2011
You're probably best off buying a cheap receiver module, which means you won't have to worry about the antenna since most of the 2.4 GHz ones have one integrated onto the PCB. The first step is probably to figure out what transmitter chip the controller is using and that'll dictate what you can use to receive it; different chips support different modulations, channels, etc and they're not usually compatible with each other.

e: if you're talking controllers for RC aircraft and the like, apparently some of them use custom chips, encryption, frequency hopping, all sorts of fun stuff. Good luck with that! Sounds like they're more secure than a lot of the 2.4 GHz keyboards out there; fear of cloning by cheap Chinese manufacturers is a much better motivation than your customers getting their credit card details stolen :rolleyes:

makomk fucked around with this message at 18:02 on May 7, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I'm hoping to make a circuit that detects claps with an electret microphone. Do I just need a good reference voltage for the threshold volume and an op amp wired as a comparator to get the result on a digital pin on the arduino, or do I need to also work in amplification?

Also, how can I measure the voltages I can expect from the electret microphone without an oscilloscope? I can't figure it out from the data sheet or Google.

I'm using the one from sparkfun, at http://www.sparkfun.com/products/8635

EDIT: Reading around, it sounds like I might actually want the amplitude of the signal coming off of it, so the comparator might be the last thing I want? And instead I should be amplifying it and taking the sum divided by the number of samples of the absolute value of the inputs or something like that?

TVarmy fucked around with this message at 16:58 on May 8, 2013

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
I'm building a gun safe monitoring system using my Arduino. Created a thread in TFR: http://forums.somethingawful.com/showthread.php?threadid=3548329

Figured it would be of interest in here, and not everybody frequents TFR.

Delta-Wye
Sep 29, 2005

babyeatingpsychopath posted:

How much granularity do you need? 4 steps? 32 steps? A number of tick marks on each rod and an optical sensor, and you can use literally any directional motor.

Analog servos are also really cheap and reasonably easy to drive from 5v, although modifying "thousands" to be free-running would be tedious.

You may be able to DIY a simple piston, if your rods could stand a little deflection. Your outside range of motion was 10", which would be a bit hard to do if the rods are fairly short. You'd also need to take the pistoning mechanism and rig it up into a nice solid package. Each package would each need some space too, because they are about 10" long even though they don't have to be necessarily that thick.

You say you may have thousands and I'm thinking at 10" a piece, this would be terrible idea just because of the scale of the thing. If do you end up on the low end, only moving 5" makes things much easier. The package is smaller so you can pack them in a lot tighter. The horizontal deflection is less too, so it will be easier on the rods. Conveniently, you can control the absolute position of a disk a lot easier than you can control the absolute linear position of a heavy wooden rod.

If porn has taught me anything, it's how to "move several wooden rods in and out in a horizontal linear way, like a piston".
http://i.imgur.com/Idm6IBb.jpg (softly :nsfw: picture of the mechanism)

SomethingLiz
Jan 23, 2009
That's a great idea, Delta-Wye. Thanks. I'll give that a try.

Delta-Wye
Sep 29, 2005
Not even a comment on all of the double entendres. :downsrim:

To be honest, I was pretty sure you were making a sex toy. And I was stoked and totally ready to help with the project...

...until you said there would be many rods, several hundred to a thousand. :catstare:

SomethingLiz
Jan 23, 2009
I didn't even notice all the double entendres until I reread it. Nicely done. On a more humorous note, I was trying to explain the mechanism to my partner on this project, and ended up having to send him the picture you sent me. That was fun to explain.

It's not a thousand sided sex toy, sadly. It's an installation I'm pitching for new hotel in Chicago. If it ends up getting built I'll post some pictures.

nightchild12
Jan 8, 2005
hi i'm sexy

Not directly Arduino, but closely related: I'm doing a thing on an ATtiny2313 with avr-gcc and having problems with progmem.

I'm trying to set up a character (and graphics) set for a 5x7 LED matrix. I don't have enough RAM on the ATtiny2313 to hold the whole array of character maps, so I'm trying to store them on flash using progmem. However, when I try to access the data, the progmem array is giving me pointers to someplace before where the data is actually stored. It's storing the data OK, I can see it in the compiled .hex file, but when I try to access it with pgm_read_byte(&(alphanum[ch][c])) it returns the byte at &alphanum[ch-17][c+1].

code:
// character mapping definitions
uint8_t alphanum[27][5] PROGMEM =
{
 {0x3F, 0x48, 0x48, 0x48, 0x3F}, // A
 {0x7F, 0x49, 0x49, 0x49, 0x36}, // B
 //... removed some arrays here for readability ...
 {0x43, 0x45, 0x49, 0x51, 0x61}, // Z
 {0x78, 0x08, 0x08, 0x7F, 0x08} // 4
// {0x, 0x, 0x, 0x, 0x}
};

void parse_char(int ch)
{
 int r;
 int c;
 int byte;
 // poo poo that is broke
 for(c=0; c<5; c++)
 {
  // for some reason, this is getting me the bytes
  //  starting from alphanum[ch-17][c+1]?
  byte = pgm_read_byte(&(alphanum[ch][c]));
  blank();
  set_col(c+1);
  for(r=1; r<8; r++)
  {
   if(byte & _BV(6)) { set_row(r); }
   byte = byte << 1;
  }
 }
}
I have my main loop set up to call parse_char constantly, and increment the value I pass to it when I push a button. I can make it work by doing pgm_read_byte(&(alphanum[ch+17][c-1])), but that offends my sensibilities. Anyone have any idea why &alphanum[ch][c] is not giving me the correct pointer?

Compiled like so: avr-gcc tinypendant.c -Os -mmcu=attiny2313 -o tinypendant.hex
Uploaded to ATtiny2313 like so: avrdude -p attiny2313 -c usbtiny -U flash:w:tinypendant.hex

Could it be the -Os? If I turn that off, it pitches a fit and stops working since I'm using delay functions from avr-libc in other parts of the code.

fake edit: for you people that read the Embedded Programming thread, should I cross-post this there?

real edit: here's the main loop
code:
 uint16_t k = 17;
 for(;;)
 {
  blank();
  parse_char(k);
  if( (PIND & (1<<PD6)) == 0 )
  {
   k++;
   if( k > 50 )
   k = 0;
   // lazy "debouncing"
   _delay_ms(200);
  }
 }

nightchild12 fucked around with this message at 05:41 on May 15, 2013

HighHobo
Aug 23, 2012
Hey everybody,
first time posting in this thread cause I need some opinions about a problem I am trying to solve. I'm working on a project for a client and decided to use an arduino to program an Atmega328 as the micro-controller for the project. The project uses a lots of pins already, but now I need to control an 8x32 led matrix. I only have 4 pins left to use and I could possibly have one more to use if I really need to. In my original design, I thought about using an ht1632c chip (led matrix controller), but it is a surface mount chip and I don't currently have access to all the tools I would need to use it. I've thought about a solution and would like to know your opinions. I would use 3 pins to connect to 4 8bit shift register with led drivers (4794) to control the 32 columns. I would also use the last available pin to connect to a 4-stage divide-by-8 johnson counter (4022) to control the rows and send a clock after the data has been sent to the 32 columns to switch row. I will try the design in simulation first, but I would like to know your opinions about it and if you had other alternatives idea.

e: Forgot to say I would probably use a driver array with the johnson counter for the current

HighHobo fucked around with this message at 19:01 on May 15, 2013

Delta-Wye
Sep 29, 2005

HighHobo posted:

Hey everybody,
first time posting in this thread cause I need some opinions about a problem I am trying to solve. I'm working on a project for a client and decided to use an arduino to program an Atmega328 as the micro-controller for the project. The project uses a lots of pins already, but now I need to control an 8x32 led matrix. I only have 4 pins left to use and I could possibly have one more to use if I really need to. In my original design, I thought about using an ht1632c chip (led matrix controller), but it is a surface mount chip and I don't currently have access to all the tools I would need to use it. I've thought about a solution and would like to know your opinions. I would use 3 pins to connect to 4 8bit shift register with led drivers (4794) to control the 32 columns. I would also use the last available pin to connect to a 4-stage divide-by-8 johnson counter (4022) to control the rows and send a clock after the data has been sent to the 32 columns to switch row. I will try the design in simulation first, but I would like to know your opinions about it and if you had other alternatives idea.

e: Forgot to say I would probably use a driver array with the johnson counter for the current

By chance, are your available pins serial pins (SPI/RS232/i2c/etc)? Do you need brightness control?

HighHobo
Aug 23, 2012

Delta-Wye posted:

By chance, are your available pins serial pins (SPI/RS232/i2c/etc)? Do you need brightness control?

I can choose my available pins, I'm not using the serial pins of the arduino yet in the project. And no I don't need brightness control.

Delta-Wye
Sep 29, 2005

HighHobo posted:

I can choose my available pins, I'm not using the serial pins of the arduino yet in the project. And no I don't need brightness control.

I would be tempted to take another processor and create a matrix controller, and then send the 'framebuffer' over a serial protocol. Basically, recreating the behavior and features of the ht1632c with a standalone atemga328. The chip isn't much more expensive than a dedicated IC. I have not thought through the best way to do this, but you gain a lot of pins using a coprocessor, especially if you can find a way to avoid the shift registers.

HighHobo
Aug 23, 2012

Delta-Wye posted:

I would be tempted to take another processor and create a matrix controller, and then send the 'framebuffer' over a serial protocol. Basically, recreating the behavior and features of the ht1632c with a standalone atemga328. The chip isn't much more expensive than a dedicated IC. I have not thought through the best way to do this, but you gain a lot of pins using a coprocessor, especially if you can find a way to avoid the shift registers.

Ya, I've thought about this idea, but I wasn't sure it would be "the best". I spent some time searching on the internet and I found another solution : I've ordered a led matrix with an integrated controller board. You only need 3 digital pins to send data to it (http://www.sureelectronics.net/goods.php?id=1119). It uses the same chip I had ordered for the controller (ht1632c) which I couldn't use because it is surface mount.

nightchild12
Jan 8, 2005
hi i'm sexy

nightchild12 posted:

Not directly Arduino, but closely related: I'm doing a thing on an ATtiny2313 with avr-gcc and having problems with progmem.

I'm trying to set up a character (and graphics) set for a 5x7 LED matrix. I don't have enough RAM on the ATtiny2313 to hold the whole array of character maps, so I'm trying to store them on flash using progmem. However, when I try to access the data, the progmem array is giving me pointers to someplace before where the data is actually stored. It's storing the data OK, I can see it in the compiled .hex file, but when I try to access it with pgm_read_byte(&(alphanum[ch][c])) it returns the byte at &alphanum[ch-17][c+1].

Turns out it was a problem with WinAVR and/or that version of avr-gcc. I downloaded Atmel Studio and recompiled the exact same code with it and it magically started working, at like a quarter the size of the WinAVR compiled program. The Atmel Studio IDE is quite nice, as well.

dyne
May 9, 2003
[blank]
What's the best way to step up the voltage output of the arduino? I'm making a tachometer frequency converter for my car. I put a 6 cylinder engine in my previously 4 cylinder car, and am using the arduino to cut the 6 cylinder engine tach signal frequency by 2/3 so it reads correctly on the 4 cylinder tachometer.

The tachometer takes a square wave at ~12-14v (whatever the alternator is putting out) and doesn't really use any current. I already have the arduino set up to read the 6 cylinder tach signal and output a 5v square wave at the appropriate frequency, I just need to step up the voltage to 12-14v. I'm pretty inexperienced with circuits, and if someone could maybe make me a circuit diagram I'd really appreciate it.

edit: also, the frequency will be <500 Hz, if that matters that much.

dyne fucked around with this message at 03:08 on May 22, 2013

Sagebrush
Feb 26, 2012

Two questions:

1) can you pull a +12v source from the car's power supply somewhere near your circuit, or do you need to have the arduino act as the power source?
2) how much current do you need on this 12v square wave?

Cause if the answers are "yes" and "just a little", all you need is a single NPN transistor rated for 12v (the 2N3904 is extremely common and rated for 40v@200mA) and an appropriate (~1k, 1/2 watt) resistor. Wire up the transistor with the collector to the 12v output line, the emitter to the 12v ground, and the base to the arduino digital output pin. The transistor just operates as an electronic switch, turning on and off the power supply at the same rate as the input square wave.

e: a transistor the like 3904 will start to fail at around 300-500 megahertz, so I think you'll be okay in that sense as long as your code can meet the proper timing.

Sagebrush fucked around with this message at 03:14 on May 22, 2013

dyne
May 9, 2003
[blank]

Sagebrush posted:

Two questions:

1) can you pull a +12v source from the car's power supply somewhere near your circuit, or do you need to have the arduino act as the power source?
2) how much current do you need on this 12v square wave?

Cause if the answers are "yes" and "just a little", all you need is a single NPN transistor rated for 12v (the 2N3904 is extremely common and rated for 40v@200mA) and an appropriate (~1k, 1/2 watt) resistor. Wire up the transistor with the collector to the 12v output line, the emitter to the 12v ground, and the base to the arduino digital output pin. The transistor just operates as an electronic switch, turning on and off the power supply at the same rate as the input square wave.

e: a transistor the like 3904 will start to fail at around 300-500 megahertz, so I think you'll be okay in that sense as long as your code can meet the proper timing.
You're correct on both accounts. I'll try that out. Is there any voltage drop with using the NPN transistor (will the square wave voltage be the same as the car's +12v source)?

Sagebrush
Feb 26, 2012

IANAEE but I'm pretty sure that a BJT transistor operating in saturation mode has no (or effectively no) voltage drop between the collector and the emitter. If there was a significant drop, any multi-transistor circuit with multiple possible signal paths (like, say, a computer) would be almost impossible to build. There will be a small drop between the base and the emitter, but you don't care about that in this case.

e: hey, check out what I found:

http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

Sagebrush fucked around with this message at 03:35 on May 22, 2013

Delta-Wye
Sep 29, 2005

Sagebrush posted:

IANAEE but I'm pretty sure that a BJT transistor operating in saturation mode has no (or effectively no) voltage drop between the collector and the emitter. If there was a significant drop, any multi-transistor circuit with multiple possible signal paths (like, say, a computer) would be almost impossible to build. There will be a small drop between the base and the emitter, but you don't care about that in this case.

e: hey, check out what I found:

http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

I am a EE, and this guy is on the right track. I usually use MOSFETs for most things needing a switch, but you should be more than okay here with a NPN transistor. Sagebrush alluded to it, but make sure you have a resistor between the Arduino digital pin and the base pin on the transistor. When on, the voltage on the base should be ~.7V over the emitter, or .7V compared to the ground on the car when the emitter is connected there. The arduino ground will have to be connected to the car's ground, which means the 5V output on the Arduino will be fighting with that .7V base pin and something will most likely blow up - I suspect the cheap NPN will blow before your relatively expensive arduino's digital pin but the goal should be to have nothing blow up :v:

This page is a better explanation I think: http://electronicsclub.info/transistorcircuits.htm

The first section is pretty much a description of how transistors work - I glanced over it and it seems solid, but the money shot is the last schematic:


You need both resistors, and the logic within the Arduino would have to be reversed (digital high on the Arduino puts out 0V and vice versa) but that is a trivial thing in C.

SnoPuppy
Jun 15, 2005

dyne posted:

What's the best way to step up the voltage output of the arduino? I'm making a tachometer frequency converter for my car. I put a 6 cylinder engine in my previously 4 cylinder car, and am using the arduino to cut the 6 cylinder engine tach signal frequency by 2/3 so it reads correctly on the 4 cylinder tachometer.

The tachometer takes a square wave at ~12-14v (whatever the alternator is putting out) and doesn't really use any current. I already have the arduino set up to read the 6 cylinder tach signal and output a 5v square wave at the appropriate frequency, I just need to step up the voltage to 12-14v. I'm pretty inexperienced with circuits, and if someone could maybe make me a circuit diagram I'd really appreciate it.

edit: also, the frequency will be <500 Hz, if that matters that much.

Others have given good explanations as to what you need to do to buffer the signal, but I'm curious if you've tried just driving it directly with the 5V output from the Arduino.

Even though the existing signal is at 12-14V, it's possible that the tach will accept a TTL level signal (5V) directly.

edit:
Out of curiosity, how are you interfacing the 12-14V alternator signal to the arduino?

SnoPuppy fucked around with this message at 18:34 on May 22, 2013

Adbot
ADBOT LOVES YOU

wolrah
May 8, 2006
what?

SnoPuppy posted:

Others have given good explanations as to what you need to do to buffer the signal, but I'm curious if you've tried just driving it directly with the 5V output from the Arduino.

Even though the existing signal is at 12-14V, it's possible that the tach will accept a TTL level signal (5V) directly.

Not the same person, but I'm working on basically this same task with my dash cluster driver (I did discover I have a pile of the transistors recommended above, so I'll be trying this tonight or tomorrow). Five volts got nothing useful out of my tach, it wiggled around a bit but it wasn't consistent in any way, it sort of wavered around 400 RPM regardless of the signal frequency.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply