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..

energy storages, theoretical examination for homes

very nice article… maths about about  battery storage, gravitational storage, flywheel storage, compressed air, hydogen fuel,

Zitat/citation from

http://www.theoildrum.com/node/8405#more

This is a guest post by Tom Murphy. Tom is an associate professor of physics at the University of California, San Diego. This post previously appeared in Tom’s blog at Do the Math.

UK reached its „peak oil“ and is now an oil/energy importer?!

Zitat/citation from article on

http://europe.theoildrum.com/node/7057#more:

Over the years I have drawn attention to concerns about the impact that peak oil (1999) and gas (2000) in the UK North Sea would have on UK trade balance. In the space of a decade, the UK has gone from oil and gas exporter to importer.

http://europe.theoildrum.com/  UK peak oil

http://www.energieverbraucher.de/de/Energiebezug/Heizoel/Ende-des-Oels__337/#con-12636

Bedini and Bearden at „open mind“ RadioShow 1984

Van de Graaff Electrostatic Generator

How a Van de Graaff Generator Works
www.youtube.com/watch?v=EsZQS2GOMQE

https://www.jlab.org/
http://www.youtube.com/user/JeffersonLab

Should a Person Touch 200,000 Volts? A Van de Graaff generator experiment!
http://www.youtube.com/watch?v=ubZuSZYVBng&feature=plcp

tesla turbine generator

google: tesla turbine generator

http://www.beyondweird.com/conspiracies/testurbn.html

would be great replacement for solar collector pumps?!
and big solar collector parks..

http://hackedgadgets.com/2009/02/27/hard-drive-tesla-turbine/

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

Deutschlands Industrie nutzt ineffiziente Elektromotoren?

wer hätte das gedacht,

in Technologie Review 2012/04 gibt es einen, leider kleinen, 2 seitigen Artikel
über den Nachholbedarf der deutschen Industrie in Sachen Stromverbrauchssenkung.

Die bislang benutzten Asynchron-Elektromotoren sind nur in einem kleinen Drehzahlbereich effizient, kommen aber fast überall vor und verschwenden enorm viel Energie und Geld.
Asynchron-Elektromotoren
billig
laufen von selbst an
direkt an drehstromnetz anschliessbar
Rotor läuft dem Magnetfeld hinterher
Effizienz nur über kleinen,schnmalen Bereich sehr hoch

Synchron-Elektromotoren
höhere Kosten (Kleinmotoren doppelter Preis eines AsynchronMotor Pendant)
laufen nicht von selbst an
geringere Betriebskosten
benötigt Steuerungsmodul (Frequenzumrichter,Drehzahlregelung)
Rotor läuft 1:1 mit dem Stator Magnetfeld
Permanentmagneten Neodym und Co.
Effizienz über sehr großen,breiten Bereich sehr hoch

Da die Motoren jahrelang in Betrieb sind,
sind die Gesamtkosten auf mehrere Jahre zu betrachten.
Die Einsparungen der Synchron-Elektromotoren durch Stromeinsparung wiegen die Initialkosten bald auf.

ACHTUNG:
weiterer Ansatz
eisenlose Eletromotoren(no drag) mit DirectCurrent Impulse Ansteuerung,
Bedini WindowMotor link, KeppeMotoren link !!

Die Industrie in Deutschland, der Maschinenbau, hat ausgebildete Mechatroniker, Elektrik + Mechanik, CNC Fertigung, Präzisionsteile..
damit könnten viele Firmen eigene Studien/Projekte mit begeisteten Mitarbeitern angehen, eigene FabLabs gründen, Vereine gründen, um verschiedene stromsparende Techniken zu prüfen, zu entwickeln und einzusetzen. Die ersten werden einen enormen KostenVorteil vor der Konkurrenz haben. Aber womöglich bezieht die Industrie den Strom viel zu billig (Standortsicherung?), sodass sie keinen Gedanken daran verschwendet ?

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);
}