Pages: [1] 2   Go Down
Author Topic: Not enough pins for project  (Read 1227 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello to everyone,

I am currently starting a new project which involves an arduino, 3 sensors, Sd card and a display but the pins are not enough. One though approaching the problem is to use multiplexers but then becomes complicate. Any other thoughts?

Thank you very much!
Logged

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some more information about the display and the sensors would be helpful.  The SD card only takes 4 pins (CS, DIN, DOUT, CLK).  You could get a serial display and that would cut the number of pins to 1 or 2, but even a HD44780 compatible only needs 6 or 7.  Most analog sensors only need 1 pin.  The UNO has 20 I/O pins, so I'm wondering why you don't think that is enough.
Logged

Experience, it's what you get when you were expecting something else.

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok we have 20 pins. Display needs 6 digital pins, Sd card 4 digital pins, sensors need 5 of analog pins! So you have right ! But those 5 pins left ( 4 digital- 1 analog) are enough to connect it with a usb port?
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which board are you using ?

If you use the Arduino Uno, pin 0 and 1 are used for the serial connection via the usb. So you have still 2 digital and 1 analog pin for futher use.
The Arduino Leonardo uses some kind of internal software serial port via the usb. Thus you have 2 pins extra.

On Ebay are I2C lcd converters. Using a shift register for the lcd is also not hard to do.
What kind of sensors do you have ? Perhaps you can use digital sensors with I2C (not that you need the extra pins, but just for fun).
« Last Edit: March 26, 2013, 11:11:43 am by Erdin » Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Erdin,
I am using arduino Uno but I built it on a breadboard using an ATMEGA328p. The sensors that I use are ADXL335 (they need 4 analog pins). But to connect the arduino with a usb port do I need only 2 digital and 1 analog? I haven't decided which display I am using yet but most of them need 6 pins.
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
USB Interface: You need two things:

- a separate USB to TTL Serial converter (a small board) unless you want to build all that on your own board..
- Connection from the USB Converter to GND, +5V, D0 and D1 pins. So you should only need those 2 Arduino pins.

LCD Displays: See this on the http://ArduinoInfo.Info WIKI:
http://arduino-info.wikispaces.com/LCD-Blue-I2C

Those displays only need 2 pins: A4 and A5   (Maybe a problem for your application?) 
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The ADXL335 is a common accelerometer.
But the digital ones are cheaper and are more common.
Sparkfun has a buying guide, https://www.sparkfun.com/pages/accel_gyro_guide

The ADXL335 has 3 analog outputs (x,y,z), so it needs 3 analog inputs.
Do you have one ADXL335 ?
What are the other 2 sensors ?

The RX (pin 0, PD0) and TX (pin 1, PD1) pins can be connected to a USB-to-serial-ttl-level adapter. You can use that to communicate with the PC.
You can also use that to upload a sketch, once you have the bootloader programmed.

Do you know this pinmapping page ? very handy. http://arduino.cc/en/Hacking/PinMapping168
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK guys ! You have given to me the right information to guide me! Now I have to do a bit more of research and I will get back if I stuck somewhere! Erdin I use ADXL335, a gyroscope and a piezoelectric!

Thanks every one for your effort guys!
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Accel + Gyro ?
Take a look at the price of these, http://www.ebay.com/sch/i.html?_sop=15&_sacat=0&_from=R40&_nkw=mpu-6050+module&LH_PrefLoc=2&rt=nc&LH_BIN=1
Jeff Rowberg has the software for it, http://www.i2cdevlib.com/
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes this accel with gyro is a lot better! I think I will use one of those!
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys I have a question! When I am going to use the accel and the gyro to take the measurements for coordinates X,Y and Z then for each measurement I have to find the time taken for each one. To make the timer should I use the oscillator of the ATMEGA328p or the oscillator from the sensors?
Logged

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Besides, all the good suggestions above, here's another:

If you don't have a I2C to Parallel converter for your LCD display, you can always use a 74HC595 and send data serially to the LCD. In this scenario, the 74HC595 will work as a "serial to parallel" converter, and you'll only use 3 pins to interface with the 595. There are several articles in the web that will teach you how to interface with a HD44780 display.

The 595 is a lot cheaper and just as easy to implement than the i2c adapter. When working with a LCD display, the 595 will allow for slightly display updates, but not nearly as fast as the native parallel implementation.

On a side note: I am a HUGE fan of the 74HC595 when it comes to Arduino projects. Basically it works as a port multiplier and a serial-to-parallel converter (for digital pins), although officially its description is "8-bit Shift Register". There are plenty of libraries available for the 595, be it running dual motor drivers, LCDs, etc, which proves it is useful for all sorts of projects. Besides, it is extremely cheap (in the cents range).

Logged

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you mean by, "I have to find the time taken"?  Do you want to know how long it took for read of the device?  Or do you want to know something like "wall clock time" that you took the sample?
Logged

Experience, it's what you get when you were expecting something else.

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For example the first measurement will start from 0 and then take the time to read the second measurement from the device!
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, for this you can use the "millis" function from Arduino.
Logged

Pages: [1] 2   Go Up
Jump to: