Show Posts
Pages: [1] 2
1  Development / Other Hardware Development / Nanode - A Front End for the Internet of Things on: May 29, 2011, 10:50:30 am
Some of us in the UK have been developing a new product called Nanode.

Nanode is a very low cost device which will be used to connect up the Internet of Things.

It's compatible with Arduino Shields and the Arduino IDE - but comes with an ethernet controller on board all for the same price as an Arduino Uno. (22GBP 25Euro  40USD).

The first ones are being shipped as development kits, which you can easily build yourself.

So you have an open source internet connected device very cheaply which you can then experiment with internet connected smart sensors and the Internet of Things.

Read more about Nanode here http://hackerspaces.org/wiki/Nanode

And here http://www.nanode.eu/

The next batch of kits will be ready in mid-June

If you are interested in Nanode - follow @Nanode_1 on Twitter or email nanode at hotmail dot co dot uk



G
2  Development / Other Hardware Development / Nanode - A Network Applcations Node - based on Arduino on: May 14, 2011, 09:13:21 am
Here's a new project that a few of us are working on in the UK

http://wiki.hackspace.org.uk/wiki/Project:Nanode

It's an open hardware/open source, low cost platform on which to develop smart sensor and network applications.

It's easy to make from a kit costing about £22 (25 euros, US$ 40), and ideal for hackspaces, schools, colleges, hobbyists etc.

For more information check the London Hackspace Wiki for regular updates or check Twitter for #nanode

If you want more details, or want to make a batch of pcbs from the design files for local distribution outside the UK - please contact @monsonite on Twitter.


G

3  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts on: March 15, 2010, 05:00:37 am
Thanks mem,

I had considered the pulsein approach, but this thing has to work on the fly and make rapid decisions based on the 2 inputs.  I couldn't afford to wait for pulsein to timeout on one channel before I tested the 2nd channel.

G
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts on: March 15, 2010, 04:58:42 am
Thanks Groove,

I read up on the reference on functions and realise that I had to change from void to int.  I'm new to C coding having spent too many years out in the PIC assembly wilderness.

I've now got it working.  I reduced the MsTimer to 1000 so now it prints once per second and I can read directly in Hz.

It works fine with the 2 channels.

It's for an electric car conversion where I have rpm from a flywheel sensor and another pulsetrain from a sensor on the roadwheel.

I have to take in these 2 inputs, process them and then output a single square wave to convince the engine management system that the engine is spinning the flywheel normally.  The hoops we have to jump through to hack modern car systems.


For future reference this makes a great frequency counter for frequencies up to 32.76KHz. I have tested on my signal generator.


G
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts on: March 15, 2010, 03:58:00 am
CB,

It's the same sketch as EriSan500 provided

Code:
// Count pulses on digital pins 2 and 3 using interrupts
// Print the counter values to serial every 30 secs and reset the counters to 0

#include <MsTimer2.h>

volatile unsigned int Counter1 = 0;
volatile unsigned int Counter2 = 0;

void setup()
{
  Serial.begin(9600);
  MsTimer2::set(30000, printCounters); // 30s period
  MsTimer2::start();

  attachInterrupt(0, increaseCounter1, FALLING);
  attachInterrupt(1, increaseCounter2, RISING);
}

void loop()
{

}

void increaseCounter1()
{
  Counter1++;
}

void increaseCounter2()
{
  Counter2++;
}

void returnCounter1()
{
  unsigned int c;
  {
    uint8_t SaveSREG = SREG;   // save interrupt flag
    noInterrupts();   // disable interrupts
    c = Counter1;  // access the shared data
    Counter1 = 0; // reset Counter1 to 0
    SREG = SaveSREG;   // restore the interrupt flag
  }
  return ( c ) ;
}

void returnCounter2()
{
  unsigned int c;
  {
    uint8_t SaveSREG = SREG;   // save interrupt flag
    noInterrupts();   // disable interrupts
    c = Counter2;  // access the shared data
    Counter2 = 0; // reset Counter2 to 0
    SREG = SaveSREG;   // restore the interrupt flag
  }
  return ( c ) ;
}

void printCounters()
{
  Serial.print("Counter1: ");
  Serial.println(returnCounter1);
  Serial.print("Counter2: ");
  Serial.println(returnCounter2);  
}



It errors at the first return ( c ); statement with the following:

In function 'void returnCounter1()':
error: return-statement with a value, in function returning 'void' In function 'void returnCounter2()':
 In function 'void printCounters()':

Is this a reasonable approach to measure the frequency of 2  channels , or is there another route?

I need to measure 2 unrelated frequencies:  one is 0 -1500Hz, other is 0- 6000Hz

Any code assistance appreciated


G


6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts on: March 13, 2010, 11:22:53 am
Hi I've been following this thread in the hope that I can get the 2 channel interrupt driven pulse counter to work.

Is there an update to EriSan500's example code?  I'm still getting some errors with the return (c ) statements and the

Serial.println(returnCounter1);   which is says is overloaded

New to this - but need to get a 2 channel tachometer working.

Much appreciated if there is a working sketch.

Thanks in advance


G.

7  Forum 2005-2010 (read only) / Interfacing / Re: Testing homebrew ENC28J60 Ethernet interface on: August 25, 2010, 05:48:47 am
Ian,

The ENC28J60 uses high currents from the 3V3 rail when driving the ethernet. These high current transients are supplied by the decoupling capacitors.  Leaving them off would cause the 3V3 rail to dip greatly when the chip is doing internal switching.  Same with the 10uF cap on the Vcap pin - this acts as a reservoir capacitor for an internal voltage regulator.


G
8  Forum 2005-2010 (read only) / Interfacing / Re: Testing homebrew ENC28J60 Ethernet interface on: August 25, 2010, 05:18:55 am
ill_switch,

Your circuit appears to be fine.

I use a 10uF electrolytic on Vcap and that works fine.  I notice that the decoupling on the 50R networks is 100nF.  Microchip datasheet suggests 10nF.

If the '328 is successfully initialising the ENC28J60 then it should flash the green and yellow LEDS twice after start up.  

Check the continuity of SCK, SS  MISO and MOSI - it may be that you have a broken track and the SPI bus just is not fully connected.  As well as broken tracks - look for solder shorts or if it's a home made board - etching faults which might leave shorting slivers of copper between pins.

Check that the ENC28J60 is not being held in reset.

If your wiring is correct and intact then they should work with the original NuElectronics code.

Have you got anything else hanging on the SPI bus?  Unless you use a 74AHC125 tristate buffer in place of the 74XX08, then the MISO line will not be released and could cause something else to hang.

Possibly swap out the 74XX08, for a '125 and enable MISO with the SS line and see if that fixes it.

If all else fails, swap the ENC28J60 for a fresh one.

Sorry you've had so much grief with this - mine worked just fine on breadboard.



G

9  Forum 2005-2010 (read only) / Interfacing / Re: Testing homebrew ENC28J60 Ethernet interface on: August 22, 2010, 05:32:23 am
Hi Ill_switch,

I just built up the same ENC28J60 / ATmega328 combination on breadboard yesterday and initially tested it with the NuElectronics code.  Here's some tips - where I went wrong.

1.  Make sure that the 5 Vdd and 4 Vss pins on the ENC28J60 are all connected.
2.  Make sure that your 3V3 regulator can supply enought current - the first regulator I used suffered extreme voltage droop when I connected 3V3 to the mid point of the 50R Tx network termination resistors.
3. Make sure that you have lots of 100nF decoupling on the ENC28J60 and a good 10uF minimum reservoir cap on the 3V3 rail.
4.  Recheck all your SPI bus wiring. There's only 4 wires but make sure that /CS is correct, MISO and MOSI. If you are using a 74XX08 as the level shifter make sure that it is powered from 5V.

When you reset the '328 the ENC28J60 should be reset too - join the reset pins together.

The yellow and green leds will flash twice if the '328 is correctly talking to the ENC28J60.

The NuElectronics server worked fine as soon as I sorted out my lack of 3V3 current. I then loaded Andy Lindsay's Pachube Client code that I had running on the Nuelectronics shield - and that works fine too.

There's not much to go wrong, but invariably it will be a wiring fault or a missing connection.

I've done a write up here.

http://sustburbia.blogspot.com/2010/08/arduino-compatible-web-server.html


Good luck in getting it to work - you really won't be far off having it run.



G.
10  Forum 2005-2010 (read only) / Interfacing / Re: Digital Input Voltage on: July 27, 2010, 07:51:22 am
Ruffles,

When using a potential divider to lower a voltage,  think in terms of the upper resistor dropping the bulk of the voltage, leaving the lower resistor with the desired voltage left across it.

It's the ratio of the resistors and not the absolute values that is important.

In equation terms the voltage across the lower resistor

Vl = Rl  x   Vin/(Ru +Rl)

Where Ru and Rl are the values upper and lower resistors


Consider your 14V example.  Lets say that we want to use the upper resistor to drop 10V, leaving 4V across the lower resistor - which is an ideal voltage for a digital input.

The resistors will drop a voltage proportional to their value, so how about a 10K to drop the 10V and a 3.9K (nearest common value to 4K) to drop the remainder?

To get a more formal calculation for how this works - you have to use Ohm's Law.

Back to your 14V example.  First think of the resistors added together in series to get the total resistance i.e. 14K.

Then the current flowing through each resistor is the total voltage (14V) divided by the sum of the resistors (14K)  so a current of 1mA flows through each of them.  Once you know this, you can multiply this current by the resistance if the lower resistor (4K) which will tell you that it will drop 4V and the 10K will drop 10V.




Common handy ratios:

To half the voltage use resistors of equal value - say 10K and 10K

To divide by 4,  make the bottom resistor say 1K, and the total = 4K, so the top resistor is 3K.

To divide by 10,  the sum has to add up to 10, so make the upper 9K and the lower 1K.

As others have stated - you can ignore the leakage current drawn by the input port.

However you do have to bear in mind the power dissipated in the resistor.   Many small resistors will be "quarter watt"  so have a maximum power handling of 250mW.  They will get hot if you get close to that power rating.

If you drop 10V across 10K the power dissipated will be 10mW.  If you drop 10V across 1K the power is 100mW.

Hope the above helps.  

G
11  Forum 2005-2010 (read only) / Interfacing / Re: Two channel tachometer on: March 09, 2010, 10:07:10 am
Thanks Mem,

Some experimentation required, I think.

G
12  Forum 2005-2010 (read only) / Interfacing / Re: Two channel tachometer on: March 09, 2010, 09:59:31 am
Thanks,

Looks like the PulseIn function will do what I need, provided I can run it on more than 1 pin at a time.



G
13  Forum 2005-2010 (read only) / Interfacing / Two channel tachometer on: March 09, 2010, 05:17:41 am
List,

I am hoping to use an Arduino to measure flywheel rpm and roadwheel rpm on a vehicle project.

The flywheel sensor gives 60 pulses per revolution, in the rev range 0 to 6000rpm. - so a minimum pulse duration of 166uS.

The roadwheel is limited to 0 to 32 revolutions per second over normal road speeds.

I was thinking of setting up separate counters on two of the input pins and integrating the input pulses over a given number of milliseconds - say 10mS.

I need a tight loop of interrupt driven code that monitors the two tacho inputs giving numerical outputs (probably in Hz) that can be further processed.

Does anyone have anything similar?

Thanks in advance.


G
14  Forum 2005-2010 (read only) / Workshops / Arduino in SE England/London/Surrey on: December 17, 2008, 05:03:55 pm
Hi,

I'm a new member in Redhill, Surrey.

I have just bought a Freeduino and Ethernet Shield from nuelectronics, with the intention of serving sensor data up to Pachube.

My interests lie in using Arduino for monitoring renewable energy systems, and reducing energy consumption in the home.

I'd be interested in sharing code and experiences with anyone in the UK, who is working along similar lines.

I've been doing hardware since the early 80s and PIC assembler for about 10 years. This is my first real excursion into AVRs, and hopefully with the Arduino, it will help me to improve my (non-existent) C skills.

I have some experience in wireless (433Mhz), datalogging, and low level telecoms- such as DTMF decoding, FSK generation and decoding for modems and lots of other things that you're not supposed to connect to the BT network.  smiley-wink

Looking forward to learning from the Arduino Community.


G

15  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Open Source Data Logger Project Using the Arduino? on: July 04, 2009, 10:26:24 am
Hi,

I've managed to introduce the Arduino into my workplace.  We make energy monitoring displays, and we use the Arduino to control our automatic test equipment.

The open-source data logger is of interest to me, and I am keen to see it happen.  We currently use dataloggers from Picotech, but you always need the PC running and they are let down by flaky software and the inevitable crashes of windows.  

I'd just like a box that you could connect up like a multichannel multimeter with lots of 4mm "bananna" plugs that will log to data-flash or SD memory, and only needs a dc power supply to make it work.

We've just built a 6 channel relay board that the Arduino plugs straight into, and it also uses a 4051 analogue mulltiplexer to provide 8 additional analogue input channels.  We also buffer the PWM outputs to give us 4 channels of voltage output, one of which feeds through an opto-isolating op-amp to give a +/-10V swing - entirely isolated from the Arduino ground.  A small +/-12V dc/dc converter supplies the isolated power.

The board is proving useful as a common starting point for the automated test equipment system we are building to test our main product.  We've arranged it so that you can plug additional shields on top of the relay board, such as an ethernet shield for remote web control.

The next step is to provide a shield that carries an SD card for cheap data storage.  I'm looking at a 2 memory system consisting of an Atmel 32Mbit data flash and a separate SD card which can be removed and plugged into a PC for data retrieval.  Flash memory and SD cards are now dirt cheap so there is no real excuse these days not to have huge amounts of storage on a simple datalogger.

My interests include solar pV and solar waterheating - so I'm hoping to use the generic design as a solar pV datalogger and controller.

Other interests include low cost wireless and interfacing micros cheaply to the telephone network.  I'd love to have a generic wireless interface that could connect a $2 micro to the web for under $10. That will truly be one step further towards "the internet of things".

As I'm predominantly a hardware engineer, I'd be looking to partner with anyone who would be willing to colaborate on the firmware aspects of the project.


G.

Pages: [1] 2