pcDuino: mini PC (Ubuntu,Python) + Arduino

pcDuino: mini PC + Arduino
http://www.pcduino.com/

new piece of hardware for a cool price of only 59,- EUR
with more power as rasberry pi (of costs of energy consumption)
http://www.exp-tech.de/Mainboards/pcDuino-Dev-Board.html

mini Linux PC (Ubuntu 12.04), so we are happy to use Python to handle the full set of Arduino IO Pins on this board. The  Arduino IO Pins are not located exactly as they are on Arduino Uno Rev3.. but an Adapter Plate will solve that.

Raspberry Pi vs. pcDuino:
http://raspberrypihax.net/pcduino-competition-that-could-take-on-the-raspberry-pi/

59,- Euro ONLY.. exceptional price..
A battery voltage logger based on arduino cost the same..
Arduino UNO Rev 3: 25,- Euro
mSD Shield RTC+miniSDcard: 18,- Euro
ADS1015 12bit ADC: 10,- Euro
Grove Voltage Divider: 6,- Euro
Sum: 59,- Euro

the pcDuino gives you SDcard,12 bit ADC , 10-bit ADC only,
but no RTC?
BUT you get USB for standard Wifi components..which costs many bugs as native arduino shields! thats a huge pricy advantage.
https://s3.amazonaws.com/pcduino/User+Guide/pcDuino+arduino+environment.pdf

Udoo mini computer combines best of Arduino and Raspberry Pi

cool new toy, linux mini pc and arduino in one piece

http://www.udoo.org/

Shipping to begin as soon as October 2013 .. $99, $109, $129

http://www.kickstarter.com/projects/435742530/udoo-android-linux-arduino-in-a-tiny-single-board

merde,
kickstarter wants paying via amazon account, credit card only.. here i am out,
i have to wait until end of year, to buy this genius toy in europe shops via paypal etc.,
no kickstart support by me.. ;o(

Raspberry Pi Rev 2.0

http://www.heise.de/hardware-hacks/meldung/Raspberry-Pi-Revision-2-0-kommt-von-Sony-1702339.html

first batch watch sold out..
remembers me Rascal Micro.

its so low cost..
hmm using a raspberry pi for python programming,
to read sensors from arduino board via usb serial,
and control actuators at arduino..
very interessting thing to me
no need to by an ethernet shield/SDcard shield(50Euro), sdcard shield(15Euro)..
thats on the raspberry already..

but i will wait, till first bugs are gone..
dont wnat to be early adaptor..
such boards come up these days, with more or less support behind..
but raspberry pi has potential by SONY?

Arduino neighbourhood

Arduino neighbourhood:

http://leaflabs.com/devices/#Maple
http://www.heise.de/newsticker/meldung/ARM-Board-fuer-Arduino-Shields-1618108.html

pythonic board

python on nokia handy to steer arduino
http://www.developer.nokia.com/Community/Wiki/Communicating_with_Arduino

python on a chip, only a bit of python power
https://www.xcore.com/projects/python-chip
http://code.google.com/p/python-on-a-chip/

mini pc:
http://www.solid-run.com/products/cubox
http://www.olimex.com/dev/index.html
iMX233-OLinuXino is Industrial grade Single Board Linux computer in very compact form.
http://apc.io

PYTHON ARM-Board für Arduino-Shields

http://www.heise.de/newsticker/meldung/ARM-Board-fuer-Arduino-Shields-1618108.html
http://rascalmicro.com/ you want to buy one? sold out!

wow, a board like Arduino?
using these many available shields from arduino?
and programming not in C/C++
its complete PYTHON !!!

150,- Dollars..  that price could be ok,
hmm for that money i can use a junkyard laptop 100,-euro (lenovo with celeron)
and work with arduino… complete Logic would be programmed at laptop in python..
having more calculation power … managing image recognition, shooting webcam images etc..

i will have an eye on that piece of pythonic hardware

Arduino Read Analog with MCP3208 and LM3940

i want to track a 12 Volt battery, charging and discharging cycles (bedini project)

using voltage divider: 3 pieces of 1K resistors 1%,
min readings at 12.00V, max reading for 15V…
15V divide by 3.. each resistor gets max 5V
these 5V are the analog input for Arduino..

but Arduino Analog readings have too much fluctuations..
and are 10 bit (1024steps) only.. but 10bit should enough?
5V / 1023 = 0,00488V = 5mV  for each step

DONT FORGET EXTRA POWER WALLPUG 9V…
this stabilizes board power!!! and so the Vref for the external extra ADC MCP3208

so i looked around on arduino pages..
coming around with the SPI ADC the MCP3208 12bit(4096steps)
http://arduino.cc/playground/Code/MCP3208

i connected all pins to my ARDUINO MEGA 5V board..
http://arduino.alhin.de/index.php?n=43

the MEGA Vcc is fluctuating a bit too..
while connected to external power supply,
i checked this via
http://hacking.majenko.co.uk/node/57

i must give the MCP3208 a Vref,
so i give the MEGA 5V as Vref for the MCP3208…
i have to await fluctuating measures, i guess..
and it was so…
for my purpose still too much fluctuating

so next step.. i use a voltage supply chip a  LM3940(low dropout), giving 3.3V from a 5V source, http://www.ti.com/product/lm3940,
these 3.3V will be the Vref for the ADC MCP3208
you have to use capacitors with the LM3940! otherwise you will not get the 3.3V output.
in datasheet 0.47mikroF and 33mikroF,  i used 4.7mikroF
with that  i get best possible stable values… till now
but after 10 good values, there comes always one value out of order/magnitude…
why? i dont know.. i will test an extra 5V powersupply for the adc..to check that
>> the error was in my SPI handling.. solved that, it works great

JPG
PDF

by the way
i would like to buy a Arduino shield, an ADC shield..
doing all the stuff, stabilizing Vref,
giving real world measures.. less offsets..
BUT there is nothong available in online-shops…
so i hope the people from
http://hacking.majenko.co.uk/node/27
will build the ADC shield

 

PS: alternativ power supply/converter
http://www.watterott.com/de/Breadboard-Spannungsversorgung-5V/33V
could used to get a stable Vref? LM317 could be interchanged with more expensive, better chip..

Python for programming Arduino

you can plug arduino via usb to a computer/laptop to use the computer/laptop for the main programm logic, using arduino only as sensor&actuator…

but powering an laptop all time..

hmm.. is there anything out there, using Python directly on the arduino?

you could use a cellphone/handy with symbian S60 and nokias DeveloperKit

arduino + Symbian S60
http://www.developer.nokia.com/Community/Wiki/Communicating_with_Arduino

or something more like this, python on a chip
arduino + py-on-a-chip
http://code.google.com/p/python-on-a-chip/
https://xcore.com/projects/python-chip

so i am waiting for a extra ArduinoPythonShield, in the plug and play way…
that would be great.. solving many starting problems with C/C++
having more fun, faster results..

Arduino Voltage Sensing

at first i tried a simple voltage devider, (Oreilly Arduino Cookbook page177)
3x1k + 1x1k, measureing above the 1k .. for measuring max 20Volts,

i connected my Mega2560 via usb… and the values where a little „fluctuating“..
i started calculating middle-values, 10%-influence of new value on old value,.. and so on..
BUT
today i gave a try on adding a external powersupply to the Mega2560.. and hey..
the analog reads went fine.. quite stable!
no need for me for „attopilot voltage current sensor“ anymore (maybe later ;o) )

without external power supply:
528 2.59 10.35
528 2.59 10.35
531 2.60 10.41
529 2.59 10.37
530 2.60 10.39
528 2.59 10.35
529 2.59 10.37
529 2.59 10.37
530 2.60 10.39
528 2.59 10.35

with external power supply:
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00
510 2.50 10.00

another fact, when fluctuating measurments occur, is
when i try to measure above a potentiometer 1kOhm(4Watt) with a 12V LED lamp in serie.
direct measures at the powersource, battery did not fluctuate.

 

 

 

model: 50V / 90A

http://www.sparkfun.com/products/9028 look for the datasheet there

Voltage Measurement Test

Pin Setup:
GND – GND
V – Analog 0

i want to measure Voltages between 11 and 15 Volts…
so i will test Analog Reads and proof at same time with an DigitalMeter.
adding the breakout parallel shows a voltage drop..?!

in datasheet is stated, that the voltage measurment has a 14,7kOhm resistor, my multimeter shows 15,75kOhm, maybe my multimeter isnt good enough.

the breakout is for 3.3V, with 5V you loose some precision.
http://arduino.cc/en/Reference/AnalogReference
so my arduino is a 5 V board, 10-bit resolution (0-1023)

 

measured analog values and an factor x

76 -> 5.74
77 -> 5.82
78 -> 5.89

tips:
http://electronics.stackexchange.com/questions/21963/arduino-mega-0-10v-analog-input

http://www.ladyada.net/learn/sensors/index.html

http://forums.adafruit.com/viewtopic.php?f=25&t=11597
  analogRead(5);
delay(10);
nTemp = analogRead(5) * 5000L / 1024L  / 10;

http://sites.google.com/site/measuringstuff/the-arduino 10-bit arduino explained

Python serial read for Arduino



# -*- encoding: utf-8 -*-
#

import sys
import time
import serial

print "ok"

# Parameter von Konsole entgegennehmen
#if len(sys.argv) != 2:
#   print "you have to pass the name of a serial port"
#   sys.exit(1)
#serial_port = sys.argv[1]

serial_port = "COM13"
arduino = serial.Serial(
   serial_port,
   9600,
   serial.EIGHTBITS,
   serial.PARITY_NONE,
   serial.STOPBITS_ONE)
   
time.sleep(2)

# continous read
line = arduino.readline()

while len(str(line))!=0:

      line = arduino.readline().rstrip()
      print line
      
#
###

Arduino DS3234 RTC output: YYYY-MM-DD hh:mm:ss

Original Code Snippet from sparkfun,
added YYYY-MM-DD hh:mm:ss output
i used Arduino MEGA-2560 via USB, power from USB,
important: i have to use SPI_MODE3 instead of SPI_MODE1 !!!
SPI_MODE1 delivered bullsh**

PinSetup
RTC – MEGA2560
————–
GND – GND
VCC – 3.3V
SQW – GND (squarewave signal output for interupters)
CLK – 52
MISO – 50
MOSI – 51
SS – 53


#include 
const int  cs=53; //chip select 

void setup() {
  Serial.begin(9600);
  RTC_init();
  //day(1-31), month(1-12), year(0-99), hour(0-23), minute(0-59), second(0-59)
  //SetTimeDate(27,4,12,16,5,0); // manuell Zeit setzen, kein 00 benutzen!
}

void loop() {
  Serial.println(ReadTimeDate());
  delay(1000);
}
//=====================================
int RTC_init(){ 
	  pinMode(cs,OUTPUT); // chip select
	  // start the SPI library:
	  SPI.begin();
	  SPI.setBitOrder(MSBFIRST); 
	  SPI.setDataMode(SPI_MODE3); // both mode 1 & 3 should work 
	  //set control register 
	  digitalWrite(cs, LOW);  
	  SPI.transfer(0x8E);
	  SPI.transfer(0x60); //60= disable Osciallator and Battery SQ wave @1hz, temp compensation, Alarms disabled
	  digitalWrite(cs, HIGH);
	  delay(10);
}
//=====================================
int SetTimeDate(int d, int mo, int y, int h, int mi, int s){ 
	int TimeDate [7]={s,mi,h,0,d,mo,y};
	for(int i=0; i<=6;i++){
		if(i==3)
			i++;
		int b= TimeDate[i]/10;
		int a= TimeDate[i]-b*10;
		if(i==2){
			if (b==2)
				b=B00000010;
			else if (b==1)
				b=B00000001;
		}	
		TimeDate[i]= a+(b<<4);
		  
		digitalWrite(cs, LOW);
		SPI.transfer(i+0x80); 
		SPI.transfer(TimeDate[i]);        
		digitalWrite(cs, HIGH);
  }
}
//=====================================
String ReadTimeDate(){
	String temp;
	int TimeDate [7]; //second,minute,hour,null,day,month,year		
	for(int i=0; i<=6;i++){
		if(i==3)
			i++;
		digitalWrite(cs, LOW);
		SPI.transfer(i+0x00); 
		unsigned int n = SPI.transfer(0x00);        
		digitalWrite(cs, HIGH);
		int a=n & B00001111;    
		if(i==2){	
			int b=(n & B00110000)>>4; //24 hour mode
			if(b==B00000010)
				b=20;        
			else if(b==B00000001)
				b=10;
			TimeDate[i]=a+b;
		}
		else if(i==4){
			int b=(n & B00110000)>>4;
			TimeDate[i]=a+b*10;
		}
		else if(i==5){
			int b=(n & B00010000)>>4;
			TimeDate[i]=a+b*10;
		}
		else if(i==6){
			int b=(n & B11110000)>>4;
			TimeDate[i]=a+b*10;
		}
		else{	
			int b=(n & B01110000)>>4;
			TimeDate[i]=a+b*10;	
			}
	}
        /* ORIG output
	temp.concat(TimeDate[4]); // tag
	temp.concat("/") ;
	temp.concat(TimeDate[5]); // monat
	temp.concat("/") ;
	temp.concat(TimeDate[6]); // jahr
	temp.concat("     ") ;
	temp.concat(TimeDate[2]); // stunde
	temp.concat(":") ;
	temp.concat(TimeDate[1]); // minute
	temp.concat(":") ;
	temp.concat(TimeDate[0]); // sekunde
        */
        
        /////
        // custom
        
        //temp.concat(" -- ");
        
        String DD = String( TimeDate[4] );
        if (DD.length()==1){ DD = "0"+DD; }
        
        String MM = String( TimeDate[5] );
        if (MM.length()==1){ MM = "0"+MM; }

        String YYYY = String( TimeDate[6] );
        if (YYYY.length()==1){ YYYY = "200"+YYYY; }
        if (YYYY.length()==2){ YYYY = "20"+YYYY;  } // ;o)
        if (YYYY.length()==3){ YYYY = "2"+YYYY;  }  // ;o)
        
        temp.concat( YYYY );
        temp.concat( "-" );
        temp.concat( MM );
        temp.concat( "-" );
        temp.concat( DD );
        
        
        String hh = String( TimeDate[2] );
        if (hh.length()==1){ hh = "0"+hh; }
        
        String mm = String( TimeDate[1] );
        if (mm.length()==1){ mm = "0"+mm; }
        
        String ss = String( TimeDate[0] );
        if (ss.length()==1){ ss = "0"+ss; }
        
        temp.concat(" ");
        temp.concat( hh );
        temp.concat( ":" );
        temp.concat( mm );
        temp.concat( ":" );
        temp.concat( ss );
        //
        /////
  return(temp);
}