The forums are retiring and are now closed for new topics and comments. The existing content will remain online and accessible through 2020 to provide everyone the opportunity to save any relevant information. In the spring of 2021, these Community forums will be taken offline.

Search for electric imp in Topics


Can I use my Electric Imp on a WiFi hotspot with no internet connectivity?

As in, I would like to use it in an application where an android device has only wifi connectivity, and i intend on controlling other hardware using this android device. I was thinking of potentially using the imp with the android device over a local hotspot network, with no actual connection to the internet. but im not too sure if this would work, since the imp, from what ive read, is cloud based. so i am not sure if my plan would be feasible, and if it isnt, is there a way that i could run a local server, and use that? or would i be better off trying to find a different platform? (and if so, what? im looking at inexpensive platforms for this one) any insight would be appreciated, as ive been unable to find any real answers to this!

Question by zack247    |  last reply


I need help for my electric imp/arduino project....

Hey, I have been working on a project centered around what chris nafis has already done with the grove dust sensor. So far, I have managed to get the dust sensor hooked up to an arduino and I have been getting it to display data, but that's about it. My next step was to get an elecrric im on sparkfun's imp shield to read serial data from the arduino in the form of numbers and then output it to COSM. However, for some reason, this does not seem to want to work on the leval of the imp. I followed most of jimb0's instructions on sparkfun for imps and arduino, but this does not seem to work. I have an arduino leonardo outputting serial data with serial1 at 19200 through pins 1 and 0 to the shield, which it then supposed to connect an imp running a program to patch this to a cosm node. I know nothing about squirrel, just using this code to do things: // Transmit data between UART and Input/OutputPorts on the impee // by: Jim Lindblom //     SparkFun Electronics // date: September 26, 2012 // license: BeerWare //          Please use, reuse, and modify this code as you need. //          We hope it saves you some time, or helps you learn something! //          If you find it handy, and we meet some day, you can buy me a beer or iced tea in return. local rxLEDToggle = 1;  // These variables keep track of rx/tx LED toggling status local txLEDToggle = 1; // impeeIn will override the InputPort class. // Whenever data is received to the impee, we'll jump into the set(c) function defined within class impeeIn extends InputPort {     name = "UART Out";     type = "number";         // This function takes whatever character was sent to the impee     // and sends it out over the UART5/7. We'll also toggle the txLed     function set(c)     {         hardware.uart57.write(c);         toggleRxLED();     } } local impeeInput = impeeIn();  // assign impeeIn class to the impeeInput local impeeOutput = OutputPort("UART In", "number");  // set impeeOutput as a string function initUart() {     hardware.configure(UART_57);    // Using UART on pins 5 and 7     hardware.uart57.configure(19200, 8, PARITY_NONE, 1, NO_CTSRTS); // 19200 baud worked well, no parity, 1 stop bit, 8 data bits } function initLEDs() {     // LEDs are on pins 8 and 9 on the imp Shield     // They're both active low, so writing the pin a 1 will turn the LED off     hardware.pin8.configure(DIGITAL_OUT_OD_PULLUP);     hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP);     hardware.pin8.write(1);     hardware.pin9.write(1); } // This function turns an LED on/off quickly on pin 9. // It first turns the LED on, then calls itself again in 50ms to turn the LED off function toggleTxLED() {     txLEDToggle = txLEDToggle?0:1;    // toggle the txLEDtoggle variable     if (!txLEDToggle)     {         imp.wakeup(0.05, toggleTxLED.bindenv(this)); // if we're turning the LED on, set a timer to call this function again (to turn the LED off)     }     hardware.pin9.write(txLEDToggle);  // TX LED is on pin 8 (active-low) } // This function turns an LED on/off quickly on pin 8. // It first turns the LED on, then calls itself again in 50ms to turn the LED off function toggleRxLED() {     rxLEDToggle = rxLEDToggle?0:1;    // toggle the rxLEDtoggle variable     if (!rxLEDToggle)     {         imp.wakeup(0.05, toggleRxLED.bindenv(this)); // if we're turning the LED on, set a timer to call this function again (to turn the LED off)     }     hardware.pin8.write(rxLEDToggle);   // RX LED is on pin 8 (active-low) } // This is our UART polling function. We'll call it once at the beginning of the program, // then it calls itself every 10us. If there is data in the UART57 buffer, this will read // as much of it as it can, and send it out of the impee's outputPort. function pollUart() {     imp.wakeup(0.00001, pollUart.bindenv(this));    // schedule the next poll in 10us         local byte = hardware.uart57.read();    // read the UART buffer     // This will return -1 if there is no data to be read.     while (byte != -1)  // otherwise, we keep reading until there is no data to be read.     {         //  server.log(format("%c", byte)); // send the character out to the server log. Optional, great for debugging         impeeOutput.set(byte);  // send the valid character out the impee's outputPort         byte = hardware.uart57.read();  // read from the UART buffer again (not sure if it's a valid character yet)         toggleTxLED();  // Toggle the TX LED     } } // This is where our program actually starts! Previous stuff was all function and variable declaration. // This'll configure our impee. It's name is "UartCrossAir", and it has both an input and output to be connected: imp.configure("UartCrossAir", [impeeInput], [impeeOutput]); initUart(); // Initialize the UART, called just once initLEDs(); // Initialize the LEDs, called just once pollUart(); // start the UART polling, this function continues to call itself // From here, two main functions are at play: //      1. We'll be calling pollUart every 10us. If data is sent from the UART, we'll send out out of the impee. //      2. If data is sent into the impee, we'll jump into the set function in the InputPort. // // The end It's not mine, but I modified it slightly t work with numbers instead of strings. I an then using this arduino code on a leonardo: ;int pin = 10; unsigned long final; unsigned long duration; unsigned long starttime; unsigned long sampletime_ms = 30000; unsigned long lowpulseoccupancy = 0; float ratio = 0; float concentration = 0; void setup() {   Serial1.begin(19200);    while (!Serial) {     ;    }   pinMode(10,INPUT);   starttime = millis(); } void loop() {   duration = pulseIn(pin, LOW);   lowpulseoccupancy = lowpulseoccupancy+duration;   if ((millis()-starttime) > sampletime_ms)   {     ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100     concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve     final = concentration*35     ;Serial.println(concentration);     lowpulseoccupancy = 0;     starttime = millis();   } };int pin = 10; unsigned long final; unsigned long duration; unsigned long starttime; unsigned long sampletime_ms = 30000; unsigned long lowpulseoccupancy = 0; float ratio = 0; float concentration = 0; void setup() {   Serial1.begin(19200);    while (!Serial) {     ;    }   pinMode(10,INPUT);   starttime = millis(); } void loop() {   duration = pulseIn(pin, LOW);   lowpulseoccupancy = lowpulseoccupancy+duration;   if ((millis()-starttime) > sampletime_ms)   {     ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100     concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve     final = concentration*35     ;Serial.println(concentration);     lowpulseoccupancy = 0;     starttime = millis();   } } I would really like some help, as this is my science fair project and I am the only person that I know that knows about Imp, and sadly we don't have any hackerspaces around where I live in alaska.

Topic by qquuiinn    |  last reply


LED disk monitor

I'm thinking of making an LED based hard drive monitor that will show the % of free space. My thoughts are either an Electric Imp or a Spark Particle wifi controller and then some kind of OSX script that runs  on my server to read the disk usage and push it to a web server. I'll be using APA102 or LPD8806 strips. Any thoughts or suggestions? Cheers.

Topic by filthyPhil    |  last reply


Convert 320VDC to 230VAC or 48VDC voltage using 230VAC (UK) UPS?

I've got access to 12 flexible Solar Panels - 320VDC each I live in the UK where mains voltage is 230VAC and also might buy an electric engine which would run at 48VDC. Would a UK voltage (230VAC) UPS be able to step down the 320VDC to either 230VAC or 48VDC for use on a boat? I'm thinking I could connect 12 panels in parallel and use either; Double-conversion UPS to deliver 48V by bypassing the conversion from the battery back to 230V or  Line-interactive UPS to deliver 230V directly from the 320VDC. The question is would the UPS's surge protection be able to deal with the high voltages? (Keeping in mind the sun isn't real bright in the UK). Also with regard efficiency will there be a lot of power loss in the system? I don't really know how surge protection from overvoltage works in UPS's and assume it uses some kind of buck conversion...? I'm guessing that the surge protection circuits might struggle with continued voltage overload. Does anyone know if this would be the case? The question is, will the UPS's be able to reliably deliver either 230VAC or 48VDC? Here are the specs for each individual panel; http://www.innoasia.net/2010/pdf/presentation/SmartCity_Takano.pdf Open circuit voltage(Voc): 429V Optimum power voltage(VMP):319 V Short circuit current(Isc): 0.39A Max operating current(IMP): 0.288A torrence:+_5% Maximum system voltage: 1000V THERMAL CHARACTERISTICS: (-25 ° C to +90 ° C) Temperature coefficient É‘Isc +0.08%/ ° C Temperature coefficient É‘Voc -0.35%/ ° C. Temperature coefficient É‘Pmax -0.15% / ° C. Over-current Protection 30mA

Question by mchin2    |  last reply