Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2015-11-17T20:08:47+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=15 2015-11-17T20:08:47+01:00 2015-11-17T20:08:47+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1404&p=2000#p2000 <![CDATA[Pi Co-op • Dawn Robotics Closing Down - Support Implications]]>
Some people may already know this based on this blog post, and the fact that we're running a closing down sale, but if not, unfortunately we're closing down, and indeed may already be closed, depending upon when you read this.

For people who have bought our products, please don't worry that you're going to be hung out to dry, support wise. I'll keep monitoring these forums periodically to try to answer any questions people may have. If you post here and don't get a reponse within a couple of days, please email helpdesk@dawnrobotics.co.uk, as notifications from the forum don't always seem to come through. Also please send me an email if parts you've bought recently, break or are faulty in some way, as I've held back some components to deal with this.

Many thanks to all of Dawn Robotics' customers over the last couple of years. It's been fun. :)

Regards

Alan

Statistics: Posted by Alan — Tue Nov 17, 2015 8:08 pm


]]>
2015-10-07T17:56:30+01:00 2015-10-07T17:56:30+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1385&p=1967#p1967 <![CDATA[Pi Co-op • Re: Reading analogue values on a co-op]]>
I'm afraid that I can't offer much useful advice on removing potential noise sources from your system. If you had no joy after disconnecting the LM35 then I would still suggest writing a simple sketch for the Pi Coop and thus removing PyMata from the equation. I can provide help writing this if you need.

Regards

Alan

Statistics: Posted by Alan — Wed Oct 07, 2015 5:56 pm


]]>
2015-10-01T18:26:44+01:00 2015-10-01T18:26:44+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1385&p=1959#p1959 <![CDATA[Pi Co-op • Re: Reading analogue values on a co-op]]> Statistics: Posted by cchd — Thu Oct 01, 2015 6:26 pm


]]>
2015-09-30T20:38:20+01:00 2015-09-30T20:38:20+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1385&p=1958#p1958 <![CDATA[Pi Co-op • Re: Reading analogue values on a co-op]]> Probable answer - and a question

Many thanks for your comments.

I am thinking (until I get the next failure) that the problem is transient spikes induced in the cable to the depth-dependent variable resistor in the attic.

As you say, this is a 24/365 system. I have tried different ports, with no joy though no consistent results either. I don't think it can be a counter overflow because the time-to-failure ranges randomly between one and twelve hours. At present the silly analogue values are not a problem because they get better ten seconds later and I can ignore them. The failures, where the readings drop to near zero and stay there until a long power cut, are a problem, especially as I am soon away to Australia for four weeks (but I have now got a Belkin Wemo switch I can use to depower and repower this from there).

I now suspect that the twenty feet of wire running from the ground-floor co-op to the roof tank resistor may be picking up something and jinxing the system, so I have this morning disconnected this wire to test the system without it (my inputs currently have no protection) and it has so far run OK for more than twelve hours. Five silly analogue values in 12K readings in that time (12896, 28716, 7392, 3936 and 4064), but no sign of the main 'stuck-low-reading' problem.

I think I should put a capacitor across the bottom of the wire that leads to the attic. It would be in parallel with the tank resistor, which is normally about 135 ohms, and that would be equivalent to being connected between the A2 pin and Vcc. But what value?

Or should I place the capacitor between the A2 pin and earth? That's equivalent to being across the fixed 180 ohm resistor. Suggested values in various posts range from 100pF to 4700 microFarad.

Or an inductor in each lead? In which case, again, what value? I have none, but I see RS do them in anything from 10 microhenries to 100K microhenries.

I don't think I need a 5.4 volt zener. I have no high voltages (other than induced transients).

I did connect the pi's earth line to the house earth, but that made no difference.

My system has no inputs that need to move at a frequency much higher than a milliHertz.

Statistics: Posted by cchd — Wed Sep 30, 2015 8:38 pm


]]>
2015-09-28T18:32:09+01:00 2015-09-28T18:32:09+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1247&p=1938#p1938 <![CDATA[Pi Co-op • Re: Power]]>
Welcome to the forums. :) Sorry for the delayed reply.

The Atmega328 on the Pi Coop will happily run at 3.3V but I think running the Pi Coop at 3.3V will be hard as it is hardwired to the 5V pin on the Pi GPIO header. You may be able to run it at 3.3V if you cut the power trace and hard wire it to the 3.3V pin but it will be messy and you may damage your Pi.

If you'd like to proceed then you can find the schematic for the Pi Coop here.

Regards

Alan

Statistics: Posted by Alan — Mon Sep 28, 2015 6:32 pm


]]>
2015-09-28T18:27:02+01:00 2015-09-28T18:27:02+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1385&p=1937#p1937 <![CDATA[Pi Co-op • Re: Reading analogue values on a co-op]]>
This sounds very odd. My guess would be that the error is occuring somewhere in the Firmata code because as you say, it seems unlikely that 26750 would come from a 10-bit ADC, even if it was malfunctioning quite badly. :)

This is only a guess, but the problem may be due to you running your program for fairly extended periods of time. Perhaps a counter overflows in PyMata somewhere?

My first suggestion would probably be to try using a different analog input if you haven't already on the offchance that it makes a difference. After that, your program seems very straightforward so it might be worth just writing a custom Arduino sketch to read the ADC and send the values to a Python program using PySerial. This could be used to check to see if the problem is with the Pi Coop or with PyMata.

Hope that makes sense. Let me know if you need more info on anything.

Regards

Alan

Statistics: Posted by Alan — Mon Sep 28, 2015 6:27 pm


]]>
2015-09-25T08:58:10+01:00 2015-09-25T08:58:10+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1385&p=1929#p1929 <![CDATA[Pi Co-op • Reading analogue values on a co-op]]> http://cchd.eu/data.php requires code to ignore them (they are logged to a 'bad-data' file).

A0 is connected to an LDR, the N17DH 'Linker Light Sensor'. This generally produces sensible values.

A1 is connected to an LM35 temperature sensor, the N11DH 'Linker Temperature Module'. This causes the main problem (and I replaced it with a new one two weeks ago).

A2 is connected direct to a potential divider consisting of a 180 ohm 3-watt resistor and a zero-to-190 ohm water-tank depth sensor. It generally works, but once or twice a day produces an impossible reading around 26750 (yes, from a ten-bit port).

I don't want to post the whole program (if you really want to see my horrible code I have linked it as http://cchd.eu/read7.py). Essentially it starts with
Code:
firmata = PyMata( SERIAL_PORT, max_wait_time=5 )
firmata.set_pin_mode( LDR, firmata.INPUT, firmata.ANALOG)
firmata.set_pin_mode( Temp, firmata.INPUT, firmata.ANALOG)
firmata.set_pin_mode( Depth, firmata.INPUT, firmata.ANALOG)

then reads the ports with
Code:
    LDR_value=firmata.analog_read( LDR )
    time.sleep( DR_delay)
    LDR_value=firmata.analog_read( LDR )
    time.sleep( MUX_delay )
    Temp_value=firmata.analog_read( Temp )
    time.sleep( DR_delay )
    Temp_value=firmata.analog_read( Temp )
    time.sleep( MUX_delay )
    Depth_value=firmata.analog_read( Depth )
    time.sleep( DR_delay )
    Depth_value=firmata.analog_read( Depth )

where DR_delay is currently 0.1 sec and MUX_delay is 2 seconds - it works OK down to a MUX_delay of 0.7 seconds below which bad values increase in frequency. There are further delays - the total cycle delay is about ten seconds.

The big problem is with A1, temperature. It reads OK for between one and twelve hours. Then, at some time which seems quite random, it drops to a port figure that varies between 0 and 18, mean 4 (a temperature around -50C). The drop is sudden and it sticks there. I find no way to restore good figures apart from a power-off of at least five minutes. Pressing the co-op reset button has no effect. Halting the python program on the pi and restarting it has no effect. A brief power-off has no effect. The analogue port is stuck and the low reading continues. Only a long power-off restores normal operation, this being a port figure of around 142 (a temperature of 19.3). The connections seem fine, as wiggling the leads does not trigger the problem. But applying a DVM [an inexpensive one] does: it initiates an immediate drop to low figures and shows 0.05 volts or less (matching a port figure of 10). These low figures never recover, except after a ten-minute power-off.

Unplugging the Vout signal lead from port A1 for ten minutes does not fix the problem. Nor does unplugging both GND and Vcc power leads to the module from the co-op board. Only a total power-down works.

I tried setting the internal pullup resistor with the command
Code:
firmata.digital_write( Temp, firmata.HIGH )

but this had no effect.

Can anyone suggest any hardware or software method to avoid this problem or to reset the port? I can detect the problem in the raspberry python code, but I do not have the hardware to trigger a ten-minute mains power cut.

Statistics: Posted by cchd — Fri Sep 25, 2015 8:58 am


]]>
2015-08-26T17:42:28+01:00 2015-08-26T17:42:28+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1382&p=1908#p1908 <![CDATA[Pi Co-op • Re: Tuturial on Raspberry Pi Camera Robot]]>
Welcome to the forums. :)

I've just got round to answering your comment on the blog, and yes you're right about needing a motor driver.

Can I ask why you're trying to use the Pi Co-op? It would be a more 'integrated' solution, although having to wire on a separate motor driver my retake any space gained. If you were looking for more memory (32kb for the Atmega328 as opposed to 8kb for the mini driver's Atmega8) then we also now sell the Mini Driver MkII which contains an Atmega328. Although unfortunately the pin numbers are slightly different, so the code would have to be changed slightly.

Regards

Alan

Statistics: Posted by Alan — Wed Aug 26, 2015 5:42 pm


]]>
2015-08-25T22:46:17+01:00 2015-08-25T22:46:17+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1247&p=1906#p1906 <![CDATA[Pi Co-op • Re: Power]]> I see some arduino using 16Mhz, they have a switch for 5V and 3v3

Statistics: Posted by victagayun — Tue Aug 25, 2015 10:46 pm


]]>
2015-08-25T16:06:43+01:00 2015-08-25T16:06:43+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1382&p=1904#p1904 <![CDATA[Pi Co-op • Tuturial on Raspberry Pi Camera Robot]]> Of course we will be using additional driver for that.

Statistics: Posted by victagayun — Tue Aug 25, 2015 4:06 pm


]]>
2015-01-05T20:05:38+01:00 2015-01-05T20:05:38+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1298&p=1586#p1586 <![CDATA[Pi Co-op • Re: Initiate/communicate with an arduino sketch?]]>
No problem. Hope you had a good break. :)

Glad the answer works for you, if you need help on any specific areas as you continue your work, please let me know.

Regards

Alan

Statistics: Posted by Alan — Mon Jan 05, 2015 8:05 pm


]]>
2015-01-03T16:54:11+01:00 2015-01-03T16:54:11+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1298&p=1576#p1576 <![CDATA[Pi Co-op • Re: Initiate/communicate with an arduino sketch?]]>

You answered my question. Upon reviewing the example sketch, I believe I could use Pymata.

It was basically a philosophical question. Could there be an existing library of Arduino Sketches, which could be executed, as is, using the Pi Co-op board? It seems like you think it can; but, it would take some digging into.

Arnold

Statistics: Posted by arnoldbail — Sat Jan 03, 2015 4:54 pm


]]>
2014-12-29T12:53:10+01:00 2014-12-29T12:53:10+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1296&p=1564#p1564 <![CDATA[Pi Co-op • Re: Raspberry Pi and co-op communication.]]>
Arduino pin naming can be a bit confusing I'm afraid, especially because it bears bery little relation to the numbering of pins on the microcontroller (which is what you see on the schematic).

The microcontroller on the Pi Co-op is an Atmel Atmega328, and you can download its datasheet here. In the datasheet you can see a pinout for the microcontroller, and these pin numbers are the ones that you see on the schematic. The diagram on this page shows the pin mapping from microcontroller pins to Arduino pins. This is largely arbitrary and was chosen by the people who wrote the Arduino libraries.

When using PyMata, you would just use the Arduino pin numbers, and software further down (on the Pi Co-op) will work out how to translate the pin numbers properly. PyMata will usually be able to work out whether 2 refers to digital pin 2, or A2 by the function you're calling, or other parameters. So for example, when you called set_pin_mode, you also said that the pin was analog so it knew to use A0. If you want to use A0 as a digital input you'd need to pass in 14 as the pin. This is calculated by using the table on this page.

Hope this is of some help, and not too confusing. :)

Regards

Alan

Statistics: Posted by Alan — Mon Dec 29, 2014 12:53 pm


]]>
2014-12-28T23:54:29+01:00 2014-12-28T23:54:29+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1296&p=1559#p1559 <![CDATA[Pi Co-op • Re: Raspberry Pi and co-op communication.]]>
I have tried to continue with my project and have become slightly confused with the schematic and the numbering system which python uses.

I have the code:
POTENTIOMETER = 0
firmata.set_pin_mode(POTENTIOMETER, firmata.INPUT, firmata.ANALOG)

Which I have adapted from on-line, my potentiometer is connected to A0 and I there is no indication on the schematic that A0 was 0. From the schematic I thought it was pin 23. I am confused to how the schematic relates to the referencing within Python. For example on the pi co-op board there is A2 and 2, so am slightly confused which one would be 2.

Any help would be appreciated.

Statistics: Posted by Maximus789 — Sun Dec 28, 2014 11:54 pm


]]>
2014-12-22T15:22:12+01:00 2014-12-22T15:22:12+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1298&p=1535#p1535 <![CDATA[Pi Co-op • Re: Initiate/communicate with an arduino sketch?]]>
Sorry for the delayed reply on this. I wanted to have a think about the best answer, and then time flashed by... :oops:

Anyway, the short answer to your question is that, in order to use PyMata with the Pi Co-op, a specific Firmata sketch must be loaded on the Pi Co-op. You can either load this sketch manually using the Arduinio IDE, or it will be automatically loaded for you when the Python PyMata library starts up. Essentially the PyMata library starts up and tries to communicate with the Firmata sketch using serial. If it can't communicate then it automatically uploads the sketch using the Ino library.

So, if you want to use PyMata, you have to either use the Firmata sketch, or you can modify it to do the extra things you want.

What special events exactly do you want to monitor? Can you give some examples please? I think that you might be able to do a lot of what you want just using Python. The main thing you can't do easily is respond to pin interrupts (so respond immediately if a pin on the Pi Co-op goes from high to low).

Regards

Alan

Statistics: Posted by Alan — Mon Dec 22, 2014 3:22 pm


]]>