4x20 HD44780 display and 6pcs. relay.

Hello here...

I am new into Arduino-stuff, but it's really cool and fun playing with. I have been making DIY-Audio for a decade now, but newer tried using programmable chip's before. I bought my Duemilanove for the purpose of making an input-selector for a new Pre-amp, i am making (It's a PASS B1-pre.).

I have allready attached a display, but i was wondering if it's possible to make the shifting of 6 relays, without using another Atmel processor ?

The pin's used for the display is as follow :
2, 3, 4, 5, 11, 12. And for spare there is 0, 1, 6, 7, 8, 9, 10

The shifting should be done with 2 pushbotton's (NormallyOpen), i have 5vdc psu, transsistors, resistors ready, and the relay's are 5vdc. / 160ohm, witch gives around 30mA, therefore i have to use transistor and seperate psu!

I would have the 2 pushbottons to count up, or down, from relay 1 to relay 6 (Audio-input) - Well there is some Toslink included in my setup, but it's dosent really have something to do with the Atmel.

well i think it's possible, but i could use some hint's / sketchs, or whatever to get going the right direction. - I must say, that i am a very newbee into this.

I would very much upload a picture, if i would be allowed (no browse botton) ? :slight_smile:

Jesper.

You might look into using a shift register or two (595 is popular, there are others) to get your data in/out for the relays and buttons, seeing as you have few data lines left.

Although, I notice you don't note the analog pins (I think) - those pins can be used for digital I/O if you need them...

Other options: using an Arduino Mega (more pins, memory, etc), using a serial LCD display (fewer data lines needed), and of course using another ATMega chip (and doing serial comms between them). ATMega chips aren't expensive, and are easy to set up "standalone" - your only issue might be in finding them for purchase, there was a "shortage" not too long back.

Ok, i see what you meen, but i stil, want to see, if it's possible to do without extensions...

When you say analog pins, you meen analog input 0 - 5 right ?
Like described :

Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6

I use only 6 pins, so giving me 7 spares(enough for 6 relays) ? - Right ?

Jesper.

Yes - I think so - analog pins 0-5 may be referenced as digital pins 14-19:

You'll have enough for the relays - but not for the buttons (unless those are already included in your pin count?).

Ahhh... Ok, now i understand your'e upinnion !

I think i can use the analog input's for my 2 buttons though, but i am not sure ?

Jesper.

ATMega chips aren't expensive, and are easy to set up "standalone" - your only issue might be in finding them for purchase, there was a "shortage" not too long back.

@cr0sh
Do you mean by there was a "shortage" for the ATmega168/328 and there would be difficult to find them? In that case I am going to be very sad and worry, because I really like to work with Arduino!

Do you mean by there was a "shortage" for the ATmega168/328 and there would be difficult to find them? In that case I am going to be very sad and worry, because I really like to work with Arduino!

It was more of a case where it seemed, anyhow, that a lot of chinese suppliers bought up all of Atmel's stock, and you couldn't get any of the ATMega328s (plus other parts) from places like DigiKey or Mouser, etc (the big suppliers) in any quantity.

But if you needed a ton from a chinese supplier (who had bought them all) - it was "easy" (although it was possible to be burned by them, too - Ask SparkFun).

You could find chinese suppliers selling low quantities of them (fine for hobby purposes - provided you got the real deal) with or without bootloaders, on Ebay for anywhere from $2.00-5.00 US each. I bought a few 168s and 328s that way (dunno if I got burned or not - haven't tried them yet).

Anyhow - Atmel eventually started their production line again for the ATMegas, and DigiKey/Mouser eventually got stock - but I don't know what their numbers are nowadays (haven't looked) - about a month or so ago I think DigiKey had like 9000 pcs in stock, something like that.

The thing is, Atmel only has like one fabrication facility to produce their product, at least in the US (not sure if they have fab works overseas or not? Maybe someone else here can shed some light?) - and when shortages occur because buyers buy them up quickly, then you have to wait (at least, here in America) until the fab switches back over to the ATMega line and starts making them again. Even so, you might have to be "quick" to grab some when they are available.

:smiley:

I have also purchased a few Atmega8/88/168/328 from ebay (chinese supplier) So as a hobbiest I don't have to be worry, as I could always find a few ATmega for my projects.

Thank you for lighting on the question.