Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / Project Guidance / Re: Valentine's Day project on: February 12, 2013, 12:17:30 pm
You could run an RTC and make it say "Happy Valentine's day" etc for a number of significant days in the year.  You could also add a LDR so that if it suddenly gets light at around her wake-up time then it could say "Good morning" or similar.  Not every day, perhaps, just every now and again.

Also, if there's an IR receiver and she has a TV in the room then can you program it to recognise the "on" TV signal?  He could say "Hey, can I watch too?" occasionally.

2  Using Arduino / Project Guidance / Re: Inherited Project Woes on: February 12, 2013, 10:03:20 am
Your other "port expander" looks like a PCF8574:

They use addresses from Hex38 onwards.

For those, assuming the 16-pin package, connect data (A4) to pin 15 of PCF8574 and clock (A5) to pin 14.

I am not too sure what the resistors are doing there on the RX and TX lines.  How much of that wiring is known to work?  Can the Arduino communicate with the PC?
3  Using Arduino / Project Guidance / Re: Inherited Project Woes on: February 12, 2013, 09:55:54 am
Sorry - hadn't noticed that there was a picture of the board - yes, pull out the LED or twist a 330ohm or higher resistor round one leg & put that in series with it.

You will need a pull-up on the I2C pins - a 2K2 between A4 and +5V and between A5 and +5V should be about right.
4  Using Arduino / Project Guidance / Re: Inherited Project Woes on: February 12, 2013, 07:13:29 am
Your Arduino sketch is communicating with two sets of devices I2C - having addresses starting at hex20 (8 devices) and hex38 (5 devices).

I don't think that they are likely to be commercial chips with those addresses, so I suspect that each panel is also running on a microcontroller.  If you are using Arduino for control then it would make sense to run an Arduino in each panel too.  I reckon there is an Ardu' in each panel.

If that's the case then you most likely just need to connect A4 and A5 of the main control Arduino to the same pin on the Arduino within each panel.  The code you linked to is acting as "master" and each panel is probably running a simple "slave" code that listens for it's I2C address and goes on or off depending upon one byte received.

Edit - Maybe not!

It seems that this "port expander" uses I2C addresses 0x20 to 0x27:

That suggests that there is a separate LED on each output of this port expander.

clock is pin 1 of the MCP23008, so that goes to A5
data is pin 2 of the MCP23008 so that goes to A4

Not worked out what the devices at 0x38 onwards are yet!
5  Using Arduino / General Electronics / Re: Metal detector with arduino on: February 12, 2013, 05:42:47 am
You could certainly read this with an Arduino but I would have thought that you are better to read it using an analog pin so that you can set your threshold to whatever value you wish.

At the moment your peak is 340mV, which is only 7% of the full 5v range - not great for accuracy.

However, the Arduino has other internal voltage references and also can take an external reference signal:

Make sure nothing is connected to the Arduino Analogue reference pin and then try:


That will set your analogRead function to use the internal 1.1V reference signal.  You then have a peak at around 30% of the full-range, which is entirely workable.  

Then you simply write a sketch that measures for one second and increments a counter every time the signal goes above 250 (for example) and then drops again.  At then end of your second, compare the number of counts with a threshold value (e.g. less than 65,000 and you say you have detected something).  Obviously, you could measure for less time, but why do you need to?

Three positive results in a row are then taken as a detection and you light an LED (or similar).

The thresholds may need tweaking but it should work well.  Why not output the numbers to serial to start and see what you measure under "detecting" and "not detecting" conditions and pick thresholds appropriately.

Hope I'm not barking up the wrong tree here.

6  Using Arduino / Project Guidance / Re: Arduino Breadboard Voltage error troubleshoot help on: February 12, 2013, 05:04:15 am
Ok it works.  That shows how important a simple capacitor has on a circuit.  I added a 22uF electrolytic capacitor to the rails and it worked.  See picture below.

Good stuff!

Amazing what a difference it can make isn't it!

I have had the same experience with decoupling caps - a tiny 100nf ceramic across the power pins can make the difference between a circuit that crashes and resets constantly and a rock-solid board.

I read somewhere on this forum that an inexplicable error is most commonly an issue with power noise - worth remembering!

7  Using Arduino / Project Guidance / Re: How to set up a custom 8-bit data I/O port: on: February 11, 2013, 12:03:27 pm
I got around this on one project by running with no crystal and using PORTB (8MHz) but then I was not using a "proper" Arduino board.  I was using the serial port so I didn't have PORTD available and didn't want two separate serial connections for programing and functioning.
8  Using Arduino / Project Guidance / Re: Mux Shield and DHT22 Temperature Sensor - UNO Rv3 on: February 11, 2013, 11:57:45 am
I don't remember the details of communication with the DHT22 but It's a one-wire digital communication, which is not going to be easy to multiplex!  I remember reading a comment (by Lady Ada I think, who knows her stuff) that the timing of the interface is relatively difficult.

I expect that it can be done, but I don't think the DHT22 is a very good choice as a first sensor for using with a multiplexer. Assuming that you can read switches etc OK then you might rather use a TMP36 or similar analogue device if you want to read temperature as a first project using the multiplexer.

9  Using Arduino / Project Guidance / Re: Arduino Breadboard Voltage error troubleshoot help on: February 11, 2013, 11:43:34 am
Two things:

Firstly, I assume that you have links at the bottom of the breadboard, out of the photo, which link the power rails on the two sides of the breadboard.

Secondly, have you tried a electrolytic smoothing cap (say 47uf or 100uf) on both the input and output of the regulator?

It's a bit difficult to see from your photos but the regulator appears to be connected up correctly and if you are not changing the Arduino wiring then that should not be making the difference.  That leaves the following differences:

The Arduino is connected at the other side of the BB - is the power not connecting across to both sides?  Is there a dodgy contact in the BB?

The Arduino has smoothing capacitors - try adding those.  A 100nf ceramic across the power pins of the chip would not hurt either.

I struggle to see what else it can be.

10  Using Arduino / Project Guidance / Re: Need power/voltage advice on: February 08, 2013, 12:53:10 pm
Again, it's hard to tell without knowing the rating of the beacons but i would expect a basic relay module of this type:

Would do the job.  It's rated to something like 30V & 10A DC.  I can't see how your beacon can be much above 12V or 2A but that is an absolute guess.

You could probably do equally well with a transistor (maybe a darlington or MOSFET) but for that you probably would need to know more about the specifications of t bacon.

Edit - equally, your sainsmat relay appears to be rated to 30V 2A.  You can't know for sure without knowing the rating of the beacon but I would doubt it takes more than 2A and I'm sure it won't go above 30V.
11  Using Arduino / Project Guidance / Re: Need power/voltage advice on: February 08, 2013, 11:54:58 am
How are the beacons powered normally?  Batteries or a DC adapter?

If the latter then you may simply be able to cut one of the wires between the adapter and the beacon and splice in the relay.  However you need to know that the relay is rated for the voltage and current of the beacons.  I'm not sure what else there is that can be said without more information.
12  Using Arduino / Project Guidance / Re: 2 digit seven segment display on: February 08, 2013, 11:24:13 am
That's why I used a 7219 - less than £2 for 2 delivered:

I'm sure I've seen them cheaper too.

For the shift registers you connect each pin of your 7-segment to a shift-register output using a suitable resistor.  You connect the data-in of the first shift register to the Ardu' and the data-in of the second to the data-out of the first.  Both shift registers are connected to latch and clock pins on the Arduino.  You send data with shiftOut just like the shiftOut tutorial.

Edit - 10 for $5 -
13  Using Arduino / Project Guidance / Re: Duplicate Serial Output on Arduino Mega on: February 08, 2013, 11:13:47 am
I guess this is a stupid answer but why not just write a "DoubleSerial" function in your code.  You call that each time you want to write to both and it writes the same data to both serial ports.
14  Using Arduino / Project Guidance / Re: 2 digit seven segment display on: February 08, 2013, 10:27:23 am
Definitely.  7221 is just a fancy version of the 7219 I think.

Datasheet is here:

You need to set up a few parameters first then, when you come to write data, you send it two bytes at a time using shiftOut:

Pull the latch pin LOW
shiftOut the digit number
shiftOut a byte of data
Pull the latch pin HIGH again.

There is code for using a 7219 to control 4-digits of a sunrise-clock that I built here:

The initial setup may need changing for the different chip and you only want 2 digits rather than four, but the data-transfer functions should be the same.  I defined my own characters but the chips have a "decode" mode where you just send them the number and they display it using a built-in font.

15  Using Arduino / Project Guidance / Re: bootloader on: February 08, 2013, 10:06:22 am
I'm no expert on bootloaders but I'm pretty certain they will only work on the chip for which they were complied.  That means, for example, that you could most likely use the same bootloader on an Uno and a breadboard Arduino if they both used an ATMega328P but the Mega uses a different chip (in fact I think there are several chips for different Megas) so I would be highly surprised if you bootlaoder would work.  I'm also fairly sure that the IDE won't let you do the upload without over-riding some safeguards.

Also, since the IDE sets the fuses at the same time as burning to bootloader, if you fooled the IDE into using the wrong bootloader you could potentially brick your Mega by setting fuses appropriate for a different chip - not a great plan when the chip is soldered-in!

Summary - I don't think it will work and I wouldn't try!
Pages: [1] 2 3 ... 10