Paul Newton's Content - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Paul Newton's Content

There have been 35 items by Paul Newton (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#62826 How to reduce pin usage

Posted by Paul Newton on 24 May 2015 - 07:13 AM in General Discussion

A nice thing about these serial to parallel chips is that all the outputs change at the same time. Individual GPIOs have to be changed one at a time.
Not always a problem, but sometimes important.
Paul



#61712 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 24 February 2015 - 09:02 PM in Netduino 2 (and Netduino 1)

Well done.

 

My first experience of I2C (not on a Netduino) was a very bad one. We spent around a week trying to debug our comms issue before we finally read the data sheet's errata list and found out the I2C would never work properly on the processor we were using. Then we had to work out how to make the product work without working I2C hardware - not fun!

 

Paul




#61692 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 22 February 2015 - 07:39 PM in Netduino 2 (and Netduino 1)

Good to hear.

When you're done, the wiki is a good place to share.




#61677 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 20 February 2015 - 05:01 PM in Netduino 2 (and Netduino 1)

My knowledge has run out now.

There have been lots of threads about I2C on the forums, but I found that searching for them does not seem to work for me.

 

Perhaps someone else knows if the ACK is actually checked by the Netduino?

Maybe when writing, the ACK is not checked and the Netduino just counts the number of bytes sent out.

 

Anyone?




#61673 Netduino MiniSumo robot

Posted by Paul Newton on 20 February 2015 - 08:18 AM in Project Showcase

Great project!




#61672 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 20 February 2015 - 08:16 AM in Netduino 2 (and Netduino 1)

Just to confirm - return value of "0" means success?

 

What happens if you just add the resistors? (Pull-up to 3.3.V)

I would expect the return value to change to fail.

 

I'll have to get a hard hat.




#61662 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 19 February 2015 - 07:28 PM in Netduino 2 (and Netduino 1)

I think there are a few of us from the Shire on the forums.




#61655 Pull Up, Pull Down, Pulling my hair out!

Posted by Paul Newton on 19 February 2015 - 08:41 AM in Netduino 2 (and Netduino 1)

Hi IceMan,

 

I2C uses transistors to pull the signals to ground and pull up resistors to pull the signals up to the positive rail.

This allows the same two wires to send data in either direction, and you can have many nodes on the wires - e.g its a multi-drop system.

 

After each 8 bits, the sender listens for an ACK. An ACK is a low bit. If the pull-ups are not connected correctly, then it would be possible for the Netduino (the master) to hear a low bit for the ACK and assume it was the slave pulling the data line down. So your sends might be reported as successful.

 

This external page shows the waveform and talks about the signals in a down to earth way.

 

There is a Forum page about choosing the right voltage to pull-up to. I would pull-up to 3.3V unless your I2C device needs a 5V pull-up.

 

I think it would be worth initially adding the resistors with nothing else connected. Try sending something and verify the send now fails.

 

Then connect the two data lines and a ground to the slave device.

The slave will also need power, this may either come from the Netduino or a separate supply - as long as the grounds are joined.

Now try again and see if the send is reported as successful.

 

Take small steps and you should get there.

 

Have Fun - Paul




#61598 How do the input pins work ?

Posted by Paul Newton on 12 February 2015 - 01:49 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I am using a Netduino plus v1 with v4.2 firmware.

 

In C# I use:

using System;
using Microsoft.SPOT.Hardware;

InterruptPort port = new InterruptPort(pin, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow);

The mode at the end can be set to:

Port.InterruptMode.InterruptEdgeHigh, 
Port.InterruptMode.InterruptEdgeLow, 
Port.InterruptMode.InterruptEdgeBoth, 
Port.InterruptMode.InterruptEdgeLevelHigh, 
Port.InterruptMode.InterruptEdgeLevelLow

I think you are describing "Both"

 

Be aware that after the v4.1 to v4.2 firmware update, there are now two ways to configure inputs - Secret labs and Microsoft. So you may have issues using other people's code snippets unless you get the correct using statements and references. It had me confused for a while.

 

Hope this helps - Paul




#61554 set brightness for Room light

Posted by Paul Newton on 07 February 2015 - 02:08 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Seandy,

 

Welcome to the Forums.

 

The relay you gave a link to is not able to control current; it can only turn ON or OFF (100% or 0%).

You will need to find another type of module to control current.

 

Please be careful - mains voltages can and do kill people!

Try and choose a module that includes all of the high voltage components so that you only have to connect to a low voltage isolated input.

 

Have a search on the forums, I am sure others have posted with details of modules they have used.

 

Have (safe) fun - Paul




#61541 LM35 & a PhotoCell

Posted by Paul Newton on 06 February 2015 - 08:13 PM in Netduino Plus 2 (and Netduino Plus 1)

Sounds a bit spooky.

 

I don't remember having issues with my analogue sensors.

(I am using three Sharp Infra-Red range sensors.)

 

Anyway, glad to hear you have a working solution.

Remember to have fun - Paul




#61527 LM35 & a PhotoCell

Posted by Paul Newton on 05 February 2015 - 05:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Cyn,

 

This is just a guess, but A5 and A4 are dual purpose (they are also I2C on the Plus v1).

 

Try using A0,A1,A2 & A3 (e.g LM35 on A3 and LDR on A0).

See if the problem has gone away.

 

I am not saying that you are using A4 & A5 as I2C - I am just wondering if they are behaving differently to the other analogue pins.

 

Paul




#61492 LM35 & a PhotoCell

Posted by Paul Newton on 03 February 2015 - 08:34 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi CT1,

 

Tell us more about the "PhotoCell".

Is this a Light Dependant Resistor LDR or a solar cell that generates a voltage?

Either way, a link to a datasheet would be good.

 

If it is a solar cell, do you know the output voltage?

Is it possible you are driving too high a voltage into the analogue pin 0 ? (this could affect the ADC circuit in the Netduino)

Is the temp sensor affected if the cell is kept in the dark?

 

If it is a resistive sensor, how are you connecting it to the Netduino?

Have you used another resistor to form a voltage divider? Is the divider connected to 3.3V or 5V? (5V may be too high).

 

It might help to tie the other unused analogue inputs to ground each via a separate resistor - say something in the range 1K to 5K.

 

Lots of questions - hopefully one of them will provoke a eureka moment.

 

Paul




#60897 Obstacle Avoidance Robot with SeeedStudio Motor Shield V2

Posted by Paul Newton on 07 December 2014 - 09:14 AM in Project Showcase

Great project so far!

 

Mike is on the right track - we will need a wiring diagram to help understand what is wrong with the power.

The photos don't quite allow us to see the wiring well enough to understand what is connected where.

 

I use a mixture of fritzing and paint - both are free. Which one I select for a particular job depends on whether I think I will change the diagram a lot (in which case fritzing is better).

 

Have Fun - Paul




#60725 Problem with Pete Brown's post

Posted by Paul Newton on 16 November 2014 - 08:52 AM in General Discussion

I had the same issue, but was able to read the word of Pete by using the preview button.

 

If you hover your mouse between the title and the number of replies, a small button appears with a down arrow on it, click on it to reveal the post.




#60667 Azure Veneziano

Posted by Paul Newton on 09 November 2014 - 08:26 AM in Project Showcase

Adding a 270Ohm resistor to protect inputs from accidents in the software is a good idea.




#60623 74hc595 Shift Register and PWM

Posted by Paul Newton on 04 November 2014 - 07:22 PM in Netduino 2 (and Netduino 1)

Hi Joop,

 

Like the 74HC595, the PCF8574 will not remember the current settings after a power on, and it would not be affected by a reset of the Netduino.

Unlike the 74HC595, when the Netduino comes out of reset, it could poll the PCF8574 to check the current levels on the I/O pins.

 

If I were using one, I would still write a class to control it for me. The class would include a method to read back the most recent settings without having to wait for an I2C operation to complete.

 

Have Fun - Paul




#60594 74hc595 Shift Register and PWM

Posted by Paul Newton on 01 November 2014 - 08:08 AM in Netduino 2 (and Netduino 1)

Hi JoopC,

 

Simple answer is that, if all you have is the 74HC595, you can't know the output state of the pins until you have set them.

This can be a real problem at power on / reset.

 

There are some strategies to get the values:

  • You could run a wire back to the Netduino so you can read the state - but that defeats the purpose of using the shift register to get more I/Os!
  • You could add an input shift register (74HC165) to read all the outputs of the 74HC595 and convert them back into a serial message that you can read on the SPI bus. Again this is a bit wasteful unless there are other inputs you needed to sample also, and there is the delay of reading the shift register before you get your answer.
  • Better would be to create a persistent variable that holds the last word you wrote to the shift register, and add some methods to read the word in what ever format you need. Ideally wrap it in a class to look after everything for you once you understand how to write each bit of the code.

 

There is still the power on / reset problem.

One strategy here is to use the enable signal of the 74HC595 to set the outputs to high impedance (e.g. "OFF") at program start, and use pullup or pulldown resistors to set each output to a sensible initial level for your circuit. Once you have written the initial state into the 74HC595, you then enable the outputs of the shift register.

 

Lots to think about, remember its supposed to be fun - Paul




#60588 74hc595 Shift Register and PWM

Posted by Paul Newton on 31 October 2014 - 03:42 PM in Netduino 2 (and Netduino 1)

Hi Iain,

 

You might want to consider using a PWM chip e.g. TLC 5940

According to the data sheet, you only need 3 pins to write to it, and it will generate 16 channels of PWM for you.

The nice thing is that you should only have to tell it to set a pulse width once, you will not have to keep your program busy clocking out loads of data into the shift registers to keep the motors running at a constant speed. (If you try to generate PWM from a shift register, any interruption in the sending of the data to the shift register could leave your PWM pin high or low for an unplanned period of time. This would cause the motors to slow down or speed up.)

 

The TLC5490 connections are basically the same as the 74HC595 shift register. Since I know you are trying to reduce the number of pins used, I think you will still want to get the other motor control signals from the shift register, you might consider wiring up the two devices into a chain to keep it at 3 pins, or have the clock and data in parallel, with separate enable lines (4 pins).

 

Paul




#60587 2 H-Bridge and Shift Resister

Posted by Paul Newton on 31 October 2014 - 03:26 PM in Netduino 2 (and Netduino 1)

Hi Iain,

 

As far as shields go, they are often bulky, inflexible and can be expensive. Making you own board is far better - I do hope it goes well.

The main thing I was suggesting was that you have a look at the shields that are out there and check out how they wire up the driver chip - e.g. simplifying direction control and extra protection diodes.

 

Where shields and modules are good, is to help prototype a circuit and allow you to get started on the software. They allow you to wire up a system using known working parts, that you can then swap out for your own circuitry as it is built.

 

Wiring the batteries in series will give you 18 Volts, this sound a bit high - but obviously it depends on the motors you are using. The L293D has an absolute maximum rating of 36V, so 18V is not a problem to the driver chip.

Remember that wiring in series will not help deliver more current to the motors.

 

Be very careful if you decide to wire the batteries in parallel (to increase the available current), rechargeable batteries have a low internal resistance and if you try to join two batteries in parallel, any difference in charge level between them will result in current flowing from one to the other. This may cause heat and damage to the batteries.

 

My buggy uses a block of 5 rechargeable NiMh AA batteries in series, I found these are good for driving 4 modest motors. 5AA cells probably take up less space than 4 PP3 cells, and are cheaper! Obviously I don't know the actual requirements (voltage and current) for your motors.

 

I see you have another post talking about PWM, so I won't mention it here, but why are you trying to reduce the number of connections to the Netduino? I take it you have some cunning plan in mind for the other pins....

 

Have Fun - Paul




#60568 2 H-Bridge and Shift Resister

Posted by Paul Newton on 29 October 2014 - 09:09 AM in Netduino 2 (and Netduino 1)

Hi Jardeth,

 

I think you will have trouble controlling the speed of the motors with your design.

This is because it will be quite difficult to toggle the outputs of the shift registers fast enough to give pulses of varying lengths.

 

I would recommend four changes:

  • Check if the driver chip requires you to add protection diodes, if so, add them to protect the driver circuit.
  • When using shift registers, connect them to the SPI port pins - SPCK, MOSI, and a latch pin. This will allow fast and easy writing to the shift registers. Have a look in the Wiki for some examples.
  • Have a look at the circuit diagrams for available H bridge drivers modules. These usually include an inverter logic gate that allows you to control the direction of each motor with one Netduino output. The output is taken directly to the IN1 signal, and an inverted version is taken to the IN2 signal. Then a single PWM signal is connected to the enable input to control the speed.
  • Use the four Netduino PWM outputs to control the speed (one per motor) - this will give much better speed control than driving the PWM from the shift register.

Once you only need two signals per motor (4 x PWM and 4 x direction), you might decide you don't need the shift registers after all!

 

Rather than build it myself, I have used an Ardumoto shield for driving a pair of motors. The schematic is here, showing the inverter circuit.

There are lots more shields and modules to chose from, and there will be ones that allow control of more than 2 motors.

 

One last thing, you said you wanted to use a 9V battery to power the motors - don't use a PP3 battery it won't have enough power to drive any sensible size motors. Use a pack of rechargeable cells (maybe 6 x AA NiMh, or a LIon / Lipo pack).

 

Hope this helps - Paul




#60563 Silly problem with power over USB

Posted by Paul Newton on 28 October 2014 - 12:32 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Wernfried,

 

I think your USB port will not be able to supply enough current to drive the Netduino Plus 2 when active. The difference between the Netduino and a phone is that the phone has a battery that will smooth out the demand on the supply - e.g when the phone needs a higher current, the battery will supply it - the rest of the time the battery charges.

 

I was going to refer you to the Wiki page that has a comparison of Netduino boards, but the power supply figures for the Plus 2 are not in the table. However, looking at the Plus v1 in the table, it is listed as taking 80mA when active. The Plus 2 will be similar, so it is a safe bet that when your program turns on an LED, it could easily be taking the current consumption too high for the supply you have.

 

It might be better to take the power from the same supply that the router uses. Assuming the power goes into the router through a barrel connector, you could make a simple splitter using a plug and a pair of sockets, and pass the power to the barrel connector on the Netduino.

 

Hope this helps - Paul




#60489 Servo position control

Posted by Paul Newton on 21 October 2014 - 06:20 AM in General Discussion

Hi Giuliano,

 

The simple way to do this would be to use a reed switch.

You wire it up just like a push button switch.

There are lots to chose from - different sizes, some with change over contacts.

 

In the UK Maplin have several around £2 to £4, this one being £1.99.

 

The only drawback will be accuracy.

The magnet will activate the reed from a distance, so it may be hard to resolve the position accurately.

 

If you need a really accurate position, then an Infra-red LED and transistor pair would be best, with the servo disc passing between the pair to block the light until a small drilled hole allows it through. The input to the Netduino would still be an on/off signal and the software should be the same.

I would start with the reed switch and get the system working first, then consider improving it.

 

Hope this helps - Paul




#60455 Continuous Rotation Servo

Posted by Paul Newton on 18 October 2014 - 08:00 PM in Netduino Plus 2 (and Netduino Plus 1)

Its always nice to here someone has followed my advice, but not as nice when it did not help. Just like being at work ;-)

Don't give up!

 

I think all the RC servos I have come across are designed for 5V, so a 9V battery is probably not a good idea as the extra volts could damage the electronics..

Also if you were thinking of a using a "PP3" 9V battery, be aware that these are intended for circuits that draw small amounts of current - like small radios, smoke alarms, etc. They are not really very good for supplying higher currents to motors.

 

I followed your link to the servo, you said it was a continuous  rotation servo, I assumed you meant something that could drive a buggy wheel, but the link you gave is to a normal micro servo. I don't think it matters, but is it a continuous rotation one, or normal one?

 

Following the link, I am using some very similar servos to control some N-gauge model railway points (aka "turnouts" in American). They were small enough for me to fit into the base board of my layout without having to fit any hardware or wires under the board. The layout fits under a table - so nothing can stick out underneath as it will catch on peoples' legs when they are sitting at the table!

 

I found they worked OK for me as normal left - right servos.

 

We need to work out where the problem is - the Netduino/software or the servo.

 

Have you got any other servos you can use to verify the Netduino and software?

Or, have you got anything else that can drive the micro servo (maybe a radio control receiver, perhaps a friend has something)?

 

See if you can work out where the problem is.

 

It also might help to post your whole program or at least the bit that drives the servo.

Perhaps you could cut it right down to a tiny 10 to 15 line program or "test harness" that just drives the servo and demonstrates the problem.

You may have done something someone else will spot as being a problem. Maybe the servo class is being deleted by mistake after you use it.... There are lots of people on this forum, and when shown the right thing, they will solve the problem.

 

Hope this helps - Paul




#60399 Continuous Rotation Servo

Posted by Paul Newton on 12 October 2014 - 05:28 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Ludio,

 

How are you powering the servo?

 

When you say that it buzzed but did not move, it makes me think that there is not enough power for the servo to turn the motor, or there is not enough voltage for the analogue feedback circuit (in the servo) to work properly.

 

The ground and the PWM pins of the servo should connected to the Netduino, but the power should not be drawn from the Netduino.

Ideally, power the servo by taking a ground and +V to a separate battery pack.

 

Let us know how you get on.

 

Paul





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.