Search for send data via nodemcu in Topics


send mq7 or other sensors data to mysql of local website via NodeMcu-esp8266

Hi guys im doing a project about uploading sensors data to database of my local site in the internet (via NodeMcu) i install nodemcu libraries to my arduino IDE & can upload easily arduino examples and running well, but don't know how can read sensors data and send it to my website host in .txt format or sql to access it in host & show it on my website. I try this process with one mq7 gas sensor to know what should i do and after success that example continue it, but i stuck in first step. please help me MASTER guys:(((

Topic by hadi95126  


Is it possible to use PWM to send data via a laser? Answered

I am looking into making a laser tag system with an arduino and was wondering how easy it would be to make a laser diode output PWM signals, instead of using an infrared LED. I'm sure this has been considered before, but I couldn't find it anywhere!! Obviously all players would be given protective glasses to wear :) (on a side note: I was also wondering that if it was possible, could it be used in an RGB laser, to make more than seven colours?) Thanks in advance :)

Question by 5225jackiechanman    |  last reply


How do I send data via lasers? Answered

I would like a flexible wearable material capable of receiving data via a laser. I would like the material to not be too affected by outside light and I would like the data transfer rate to be fast (it's only about 3 one-digit numbers I'm sending, so it shouldn't be a problem.) I am using this for a laser tag system, and the back, solders and front two sides is where I'm planning on these sensors being, so flexibility is not absolutely necessary, but would be very nice (being thin and durable, however, is necessary) please no lenses. I don't mind an elaborate setup, as long as it doesn't cost too much and uses minimal tools, but would prefer a simple "attach this to that then wire it to the controller" setup. I'll answer any questions on clarification to the best of my ability. Thank you in advance for any help.

Question by GenAap    |  last reply


Accelerometer Data (arduino) to Android Device Via Bluetooth

Looking to do a mini project. I need help sending the data i recieve from the accelerometer to an android device.. Is this possible and how!

Question by Lethalxp1    |  last reply


Sonic data transmission?

This is just an idle thought, but I was reading a couple of ROV builds, and the one thing they all have in common is a tether - it's a fact of the world that very little in the way of radio signal can penetrate water. So... Could you send control signals to an ROV via sound or ultrasound?  Could beeps and clicks carry enough data, far enough, and clearly enough, to control an ROV? Even more fun, how much data could come back? Sensor readings? Images? Just throwing it out there for you to toy with, but it would be fun to have genuinely-remote control for this class of robot.

Topic by Kiteman    |  last reply


Interfacing the nxt and rfid via the ardiuno?

I am  having a problem here,I am to connect an rfid card reader to the arduino microcontroller and then the microcontroller to the nxt robot.From the researches that i have made i have learnt that the nxt communicates with the ardiuno microcontroller through I2C while the microcontroller itself reads data fom the rfid antenna using an UART bus.I am wondering if you could help on the code to make the arduino send a message to the nxt.

Question by roagile-2007    |  last reply


connect picaxe / computer / internet - budget solution ?

Am a newbee to picaxe working with mac soft- and hardware & i spent a a lot of time looking for the following: ------------------------------------ i would like to ... - transfer in- output data from simple components (such as a IR LED used for light/dark detection ) - .... via picaxe - ... to windows and mac computers in order to .... - pass them on to a website or eMail them ------------------------------------ i already had a look at ... - arduino/processing configurations (e.g. some amazing "twitter" variants posted on instructables, hack-a-day, etc. ... ) - additional external server projects (as on this site - e.g. very impressive webcams driven by websites and controlled by 'site users ...) - Nordic RF, Cellular, Zigbee, Bluetooth, XBee WiFi, FM Transmitter and Receiver, General TX/RX sending/receiving configurations (btw. - there is a very interesting comparison of these on sparkfun ---> http://www.sparkfun.com/tutorials/128 ) - very elaborate software solutions (using combinations of php, processing, python and other scripts) all of them being highly impressive and, most important of course: working well ------------------------------------ but - is there any quite easy-to-configure and budget way which does not require ... - additional, external servers - platform specific software (windows/mac/linux only) - the implementation of several software packages and runs with e.g. ... - a 08M2 picaxe (or larger).... - probably cheap component(s) (such as the Nordic RF mentioned on sparkfun) - a minimum of software requirements - a software/software component which is easy to install and configure (Visual Basic Macros doesn't seem to run once i created them via word on my mac) ? any hints are highly appreciated ...  

Topic by marc_is_curious  


can i send serial monitor data from ESP32 board to B+ via Bluetooth?

Hello guys how are you doing ?so I'm currently working on a project from long time ago that was devastating and depressing for me , i will tell you the idea and what progress I made through the past 6 weeks and see if you can lead or help me ,, so the idea is I'm currently connecting esp32 Arduino board with six senses , 5 of them are flex sensors and one of them is the mpu6050 sensor which reads the angle of x y and z I was able to connect those sensors to esp32 and read all the values on the serial monitor as you can see below the code and the serial monitor https://ibb.co/92qBsh0, now my next step that I didn't know how to do is : I want to send those data, the serial monitor data continuously every 6 second to raspberry pi via the Bluetooth of the esp32 to the Bluetooth of the raspberry pi in order to program those data , i want to program those data to an LCD and a speaker ,For example if I received the following values from the esp32 I want the Res pi to put a certain word to the LCD screen and and then convert it to speech through the speaker , I already connected the LCD to the raspberry pi. , but now how I can send the serial monitor data continuously to the pi so I can program it

Topic by bhyamen  


Arduino Control by Excel2000

Hi Is it possible to send single character data from MS Excel2000, to the Arduino monitor, which will ,via the usb send on to the Arduino device. (say turning leds on and off.)  Low volume of data, 10 characters minute. That is within VBA of the Excel to send the data from Excel to appear in Arduino monitor and thru USB  to Arduino Nano where it will be dealt with by other arduino sketch. I will need to know what vba to use in Excel and what code required in sketch to accept vba. Thanks CharlesHarris

Question by charlie.harris.376    |  last reply


How do I send and receive data on an arduino via wifi using a router with Open-WRT?

My friends and I are building a remote controlled turret (call it cliche, I think it's awesome). They have charged me with the programming and design of the motor chassis. I read the MAKE: article on a Roomba that was controlled via a serial out on an Open-WRT router. However, with the turret, I would find it much more easier to use an Arduino interface. Is there any easy way to communicate between a router running Open-WRT and an Arduino? Thank you for any help.

Question by spel3o    |  last reply


How to save mobile no in arduinos eeprom after reading it from sms recieved on arduino via sim 800 module

Hello! i am building a college project irrigation monitoring device which monitor soil moisture and send that data to mobile via sms. the number to which the sms is send is initially feed into arduino sketch. i want to change that no by sending a sms to arduino . that sms must contain a password followed by new mobile no i have tried but it could not read that no from sms and put it into eeprom. on aduino forum also their is no clue about how to do.sorry for such english.please help .

Question by pratikpitale  


Arduino Bluetooth to Visual Forms

He folks I have a problem I am trying to send data with my arduino via a hc-06 bluetooth module to my pc and display the data with visal forms, my problem is how do I get the data into Visual studio/forms? the data is a 10 cell integer array wich should be displayed as 10 textboxes. or is there a better software to create a GUI thank you in advance

Topic by Red-Fox    |  last reply


How do i write an Arduino code for transfer of vibration data to a pc via bluetooth?

Hi, I am currently attempting to build a circuit for a college module that would use vibration data from a dc motor then send it to a microprocessor before transferring the data via Bluetooth to a pc. I have trawled through numerous sites for the correct components to use but. My question is this. Is there a Arduino code that would enable this idea to be successful? Having never written a code I am somewhat stumped and stressed out to the max. I would be grateful of any help or advice you can offer, Thank you in advance for your time over this, Best regards Mark sheldon

Question by Shaggy74    |  last reply


Infrared transmitter and receiver

I want to make a gadget which sends a few kb of data via infrared and also receives data via infrared with a timestamp. However, I am stuck as I have only used arduinos before and I have to design a circuitboard which I have never done before, with PIC microcontrollers (must be cheap ones). I need help a) choosing a microcontroller and b) assembling all the components into a circuitboard (ir transmitter, receiver, microusb port to transfer data to pc, battery). Gadget will eventually be portable so make everything light. Thanks Khalid

Topic by khabro    |  last reply


Is Arduino the tool for this?

     Hello, I have a question. I'm currently working on a project where data is transferred via radio at a frequency of 916.5 MHz. I need to receive this data, and then send a new signal containing the data out via Bluetooth. I have programming experience, and know C++ fairly well, but have never used Arduino or other microcontrollers. I have looked around, and could not find an answer anywhere else. Can Arduino do this? If so, could you point me in the direction of the radio receiver that can pick up that frequency and Bluetooth transmitter modules (is this the correct word?) that would work for me, as well as what type of Arduino board you would recommend? Thank you! -S

Topic by thesab    |  last reply


How to make an RCON client for minecraft?? I want to send data to my Minecraft console remotely. Answered

Hey minecraft coders/people good with computers, I was wondering how to connect to my Minecraft server with a Remote Console/Controlled Console. I want to be able to send commands to the Console remotely (like from my phone or other computer). I dont know how to send/receive a command/commands to the Minecraft server, I can code everything else (like the text input and GUI). What I want to be able to do: 1. Get the console log sent from my server to my RCON client into a string (then I can print the data out into a GUI or another console) 2. Send commands that I type into my text box to the server via remote access. Thanks! If I was too vague, then please state it and I will try my best to elaborate.

Question by chilll2009  


Arduino codes

Good evening Sir, Madam, I am currently attempting to build a circuit for a college module that would use vibration data from a dc motor then send it to a microprocessor before transferring the data via Bluetooth to a pc. I have trawled through numerous sites for the correct components to use but. My question is this. Is there a Arduino code that would enable this idea to be successful? Having never written a code I am somewhat stumped and stressed out to the max. I would be grateful of any help or advice you can offer, Thank you in advance for your time over this, Best regards Mark sheldon

Topic by Shaggy74    |  last reply


Attiny 2313 & Serial Port

Is it possible, using just an Attiny 2313, to exchange data with a computer via serial -- or do I need one of those RS232 chips?Theoretically, I think I can, using the digital IOs, dispite its lack of efficiency, but there may be some problem with that...Sending is the main part that I'm not quite confident about ;-)

Topic by zachninme    |  last reply


Newbe + Arduino Mega via codevision + AD9850 = Guidance needed?

Hello,Im very new to 'C' and codevision and have set myself a task to get a AD9850 module working. But there are two things in my way and they are understanding datasheets and writing C code. So first question would anyone help guide me through writing the necessary drivers? or is anyone aware of a web page with the necessary information. I have had the AD9850 working in the Arduino using 3rd party library. I would like to learn how to do this myself (with guidance) but I am a (young) family man with limited time to spend on myself, hence the call for guidance. I was thinking of using the SPI port to send the serial data out, tho this is different to how the arduino boys wire the module up. I know this isn't much information to go on but I am leaving up to you to ask me questions as to not make this intro too long and boring. Last thing is I am planing to post my experience on learning C using the arduino mega on the big bad web so the information might be useful to other newbies or add it to other someone else's site. Many thanks in advance.

Question by DELETED_MakiY2    |  last reply


PIC18LF4680 microcontroller and usb ttl for usart / serial data

Hi everyone. I want to know if it's possible to connect a ttl device directly to my PIC18LF4680 for serial communication via USART . I can connect the ttl device directly to my Arduino Uno without issues. The ttl  device has 6 pins (dtr , rxd , txd , vcc(3.3v or 5v) , cts, gnd) . I have two different codes snippets below that perform USART communication. * Version one(I) utilizes the "usart.h" peripheral library. * Version two(II) uses "TXREG" and "RCREG" for sending and receiving data. Both versions run well in my virtual environment (Proteus 8 Professional), but not in the real world environment. Am I missing a step? Do I need a special library? Or is it not possible with this chip? VERSION (I)   ------------------------ #include "fuses.h" #include #include #include #include void main(void) {         TRISB = 0x00;     OSCCON = 0x76;          // 8mhz (0111 0110)          LATBbits.LATB4 = 0;      LATBbits.LATB1 = 0;      LATBbits.LATB0 = 0;          unsigned char txt1[] = "Hello World \r\n";     unsigned char txt2[] = "Enter a number.... \r\n";         CloseUSART();         OpenUSART(USART_TX_INT_OFF &             USART_RX_INT_OFF &             USART_ASYNCH_MODE &             USART_EIGHT_BIT &             USART_CONT_RX &             USART_BRGH_HIGH &             USART_ADDEN_OFF ,             52);             for(int x=0;x<=20;x++){__delay_ms(50);}         // write/send intro to PC         while(BusyUSART());     putsUSART((char *)txt1);         for(int x=0;x<20;x++){__delay_ms(50);}         while(BusyUSART());     putsUSART((char *)txt2);             for(int x=0;x<20;x++){__delay_ms(50);}             while(1){         sdata = ReadUSART();                 switch(sdata){             case '1':                 LATBbits.LATB4 = 1;                  LATBbits.LATB1 = 0;                  LATBbits.LATB0 = 0;              break;                         case '2':                 LATBbits.LATB4 = 0;                 LATBbits.LATB1 = 1;                  LATBbits.LATB0 = 0;                             break;                         case '3':                 LATBbits.LATB4 = 0;                  LATBbits.LATB1 = 0;                  LATBbits.LATB0 = 1;              break;                                     default:                 LATBbits.LATB4 = 0;                 LATBbits.LATB1 = 0;                 LATBbits.LATB0 = 0;              break;         }     }     } -------------------------------------------- VERSION (II) --------------------------- #include "fuses.h" #include #include #include #define STRLEN 12 volatile unsigned char t; volatile unsigned char rcindex; volatile unsigned char rcbuf[STRLEN]; void USART_init(void){         TXSTAbits.TXEN = 1;     // enable transmitter     TXSTAbits.BRGH = 1;     // high baud rate mode     RCSTAbits.CREN = 1;     // enable continous receiving     // configure I/O pins     TRISCbits.TRISC7 = 1;     // RX pin is input     TRISCbits.TRISC6 = 1;     // TX pin is input (automatically configured)     SPBRG = 52;                PIE1bits.RCIE = 1;      // enable USART receive interrupt     RCSTAbits.SPEN = 1;     // enable USART         } void USART_putc(unsigned char c) {     while (!TXSTAbits.TRMT); // wait until transmit shift register is empty     TXREG = c;               // write character to TXREG and start transmission } void USART_puts(unsigned char *s) {     while (*s)     {         USART_putc(*s);     // send character pointed to by s         s++;                // increase pointer location to the next character     } } void main(void) {         OSCCON = 0x76;          // 8mhz (0111 0110)         USART_init();         USART_puts("Init complete! \n");     INTCONbits.PEIE = 1;    // enable peripheral interrupts     INTCONbits.GIE = 1;     // enable interrupts     while(1)     {     }     } void interrupt ISR(void) {     if (PIR1bits.RCIF)  // check if receive interrupt has fired     {         t = RCREG;      // read received character to buffer         // check if received character is not new line character         // and that maximum string length has not been reached         if ( (t != '\n') && (rcindex < STRLEN) )         {             rcbuf[rcindex] = t; // append received character to string             rcindex++;          // increment string index         }         else         {             rcindex = 0;        // reset string index             USART_puts(rcbuf);  // echo received string         }         PIR1bits.RCIF = 0;      // reset receive interrupt flag     } } ------------------------------------------------------------ Any and all help is appreciated. Thanks!

Topic by newbie14    |  last reply


Cheap wireless between desktop PC in basement and RS232 device upstairs?

Device upstairs has -RS232 serial port on which is sends and receives data periodically.PC in basement has:-RS232 serial port-USB-connected to home WiFi RouterThe device and pc communicate at 115bps ... currently via a long serial cable.Basically i need a wireless rs232 link  (between serial port of the device, and serial port of the PC)orsome sort of hybrid link (between serial port of device, and  PC  ..via wifi or bluetooth)Cheapest solution i know so far, costing about $40, is for a hybrid scenario: buying a used and cheap  Linksys WiFi Router WRT54G, hacking it to add changed firmware (it's Linux open source), adding serial port to it and connect my device to it + write custom program that runs on the Linksys router that sends the serial data to my PC...Might be cheap solution but very scary to me, because i'm only used to writing code for Win32 PC platform. I know next to nothing about Linux.Any other ideas?

Question by tintino    |  last reply


Arduino to Android Sensor result (Flood Alert)

Can i connect my arduino to android via my own app ( project)__ flood alert 1. app must be downloaded from play store 2. send and receive data must use internet 3. target 200 persons 4. app for read water level in app connected to internet. 5. app can trigger alarm if safety water level is exceeded.                                   looks more like this(pic) pls help me...

Question by harek    |  last reply


Cheap wireless between desktop PC in basement and RS232 device upstairs?

Device upstairs has -RS232 serial port on which is sends and receives data periodically.PC in basement has:-RS232 serial port-USB-and is connected to home WiFi RouterThe device and pc communicate at 115200 bps, currently via a long serial cable...which i'm trying to get rid of.Basically i need a wireless rs232 link  (between serial port of the device, and serial port of the PC)orsome sort of hybrid link (between serial port of device, and  PC  ..via wifi or bluetooth)Cheapest solution i know so far, costing less than  $30-$35, is for a hybrid scenario: -buying a used and cheap  Linksys WiFi Router WRT54G from Ebay, -hacking it to add changed firmware (it's Linux open source), -adding serial port to it ..this basically turns it into a Linux PC with built in Wifi and Serial Port. -write custom Linux program that runs on the Linksys router that sends the serial data to my PC...Might be cheap solution but very scary to me, because i'm only used to writing code for Win32 PC platform.  I know next to nothing about Linux !   Any other ideas?

Question by tintino    |  last reply


Computer to Arduino XBee using C? Answered

Greetings all!  I've been searching everywhere and I'm just needing that push in the right direction. I have two series 1 XBee's and I would like to plug one XBee in to my computer via USB and the other will sit on an Arduino board on the wireless shield.  My computer is running Slackware Linux and I would like to use C to send and receive data with the arduino.  Does anyone have any insight to this type of problem? Thanks!

Question by mal10c    |  last reply


Review of my first PCB design for a current meter shield?

I am completely new in designing circuits and PCBs and would appreciate your feedback on my first project. I want to measure the current flowing through an AC line using the ACS712 current sensor (IC1). The analog output (which is a proportional voltage between 0V and 5V) is converted using an ADS1115 (IC2). The digital signal is passed to an underlying Wemos D1 mini board via I2C, which contains an ESP8266 to process and send the data to a server. Furthermore, an AC/DC module (HLK-PM01) is mounted on the bottom side of the PCB to power the components.

Question by DELETED_MakiY2  


need help for nrf24l01+

Well i am using rf24 module for a project since i am new to it i am having some difficulties to send the data. Actually i am doing a remote consisting of a geeetech voice module + nrf24 + arduino nano. It must communicate with a hub which comprises of arduino uno + rf24 + relays. I have tested the voice module and the data is read as serial command. see the code for a simple example without rf24 below. For my project i need to make the transmitter read the serial command of the voice module and send it to the receiver side. In the receiver side it will activate relay with a switch case section. I would appreciate if anyone could help me out and suggest me how to send the command of the geeetech voice module via rf24. //code for simple test between voice module and nano int led1 = 2; int led2 = 3; byte com = 0; void setup() { Serial.begin(9600); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); delay(2000); Serial.write(0xAA); Serial.write(0x37); delay(1000); Serial.write(0xAA); Serial.write(0x21); } void loop() { while(Serial.available()) { com = Serial.read(); switch(com) { case 0x11: digitalWrite (led1, HIGH); //turn red on break; case 0x12: digitalWrite (led2, HIGH); // turn yellow on break; case 0x13: digitalWrite (led1, LOW); // turn red off break; case 0x14: digitalWrite (led2, LOW); // turn yellow off break; case 0x15: digitalWrite (led1, LOW); digitalWrite (led2, LOW); // turn both off break; } } }

Topic by keshavcanaye  


switching on a device using a mcu

I just want to know, I have a device (a gravis game pad pro) that continuously sends out a 3 byte serial packet via 2 wires (the game pad drives the clock, so the mcu is the slave, the clock is at 20khz), but there isn't any chip select or slave select or anything like that to start the serial transmit, and since my application circuit already has another serial device on connected to the spi pins of my PIC, I can't have the game pad on all the time, so I decided I need to control when to power on the game padwhat should be used (that i have on hand right now)?a switching regulator like the TC110 from microchip? (i don't have this one yet)a mosfet driver (i have lots of tc4424)?2n3904 or 2n2222 or bc547 transistor?EDIT: I'm just gonna use the mosfet driver... But what is the proper way to do this?or waste some program space and manually interpret the clock and the data pins? there is always five consecutive "1" in the first byte of data, and that condition can never be repeated

Topic by frank26080115  


How to get data from a load sensor through bluetooth module on an Android App/Arduino?

I am creating a mobile android application which gets data from a load sensor connected to HC-06 Bluetooth module and sends the data to a mobile application. The mobile app has two activities one for listing the bluetooth devices available and the other is the main activity to get data from the load sensor. I have managed to connect/pair with the Bluetooth module but I am unable to get data from it. The main activity consists of a button 'btnScan' that will get the data, and a text field to display the data. Can someone please help?  Here is the MainActivity File package com.uniproj.senseplate; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.UUID; import android.app.Activity; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast;   public class MainActivity extends Activity {       Button btnscan;   TextView txtArduino, txtString, txtStringLength, calorie;   Handler bluetoothIn;   final int handlerState = 0;             //used to identify handler message   private BluetoothAdapter btAdapter = null;   private BluetoothSocket btSocket; //= null;   private StringBuilder recDataString = new StringBuilder();      private ConnectedThread mConnectedThread;       // SPP UUID service - this should work for most devices   private static final UUID BTMODULEUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");     // String for MAC address   private static String address; @Override   public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       //Link the buttons and textViews to respective views                    btnscan = (Button) findViewById(R.id.scanBtn);                 txtString = (TextView) findViewById(R.id.txtString);     txtStringLength = (TextView) findViewById(R.id.testView1);       calorie = (TextView) findViewById(R.id.sensorView1);     bluetoothIn = new Handler() {         public void handleMessage(android.os.Message msg) {             if (msg.what == handlerState) {          //if message is what we want              String readMessage = (String) msg.obj;                                                                // msg.arg1 = bytes from connect thread                 recDataString.append(readMessage);              //keep appending to string until ~                 int endOfLineIndex = recDataString.indexOf("~");                    // determine the end-of-line                 if (endOfLineIndex > 0) {                                           // make sure there data before ~                     String dataInPrint = recDataString.substring(0, endOfLineIndex);    // extract string                     txtString.setText("Data Received = " + dataInPrint);                                 int dataLength = dataInPrint.length();       //get length of data received                     txtStringLength.setText("String Length = " + String.valueOf(dataLength));                                         if (recDataString.charAt(0) == '#')        //if it starts with # we know it is what we are looking for                     {                      //get sensor value from string between indices 1-5                      String weight = recDataString.substring(1, 5);                      //update the textviews with sensor values                      calorie.setText(weight + "kg");                            }                     recDataString.delete(0, recDataString.length());      //clear all string data                    // strIncom =" ";                     dataInPrint = " ";                 }                        }         }     };           btAdapter = BluetoothAdapter.getDefaultAdapter();       // get Bluetooth adapter     checkBTState();        // Set up onClick listeners for button to scan for data     btnscan.setOnClickListener(new OnClickListener() {       public void onClick(View v) {         mConnectedThread.read("1");       }     }); }   private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException {             return  device.createRfcommSocketToServiceRecord(BTMODULEUUID);       //creates secure outgoing connecetion with BT device using UUID   }       @Override   public void onResume() {     super.onResume();         //Get MAC address from DeviceListActivity via intent     Intent intent = getIntent();         //Get the MAC address from the DeviceListActivty via EXTRA     address = intent.getStringExtra(DeviceListActivity.EXTRA_DEVICE_ADDRESS);     //create device and set the MAC address     BluetoothDevice device = btAdapter.getRemoteDevice(address);          try {         btSocket = createBluetoothSocket(device);     } catch (IOException e) {      Toast.makeText(getBaseContext(), "Socket creation failed", Toast.LENGTH_LONG).show();     }      // Establish the Bluetooth socket connection.     try     {       btSocket.connect();     } catch (IOException e) {       try       {         btSocket.close();       } catch (IOException e2)       {      //insert code to deal with this       }     }     mConnectedThread = new ConnectedThread(btSocket);     mConnectedThread.start();         //I send a character when resuming.beginning transmission to check device is connected     //If it is not an exception will be thrown in the write method and finish() will be called     //mConnectedThread.write("x");   }     @Override   public void onPause()   {     super.onPause();     try     {     //Don't leave Bluetooth sockets open when leaving activity       btSocket.close();     } catch (IOException e2) {      //insert code to deal with this     }   } //Checks that the Android device Bluetooth is available and prompts to be turned on if off   private void checkBTState() {     if(btAdapter==null) {      Toast.makeText(getBaseContext(), "Device does not support bluetooth", Toast.LENGTH_LONG).show();     } else {       if (btAdapter.isEnabled()) {       } else {         Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);         startActivityForResult(enableBtIntent, 1);       }     }   }     //create new class for connect thread   private class ConnectedThread extends Thread {         private final InputStream mmInStream;         @SuppressWarnings("unused")   private final OutputStream mmOutStream;               //creation of the connect thread         public ConnectedThread(BluetoothSocket socket) {          btSocket = socket;             InputStream tmpIn = null;             OutputStream tmpOut = null;             try {              //Create I/O streams for connection                 tmpIn = socket.getInputStream();                 tmpOut = socket.getOutputStream();             } catch (IOException e) { }                   mmInStream = tmpIn;             mmOutStream = tmpOut;         }                 public void run() {             byte[] buffer = new byte[1024];              int bytes;             // Keep looping to listen for received messages             while (true) {                 try {                     bytes = mmInStream.read(buffer);                     bluetoothIn.obtainMessage(handlerState, bytes, -1, buffer).sendToTarget();                 } catch (IOException e) {                     break;                 }             }         }                 //write method         public void read(String input) {             byte[] bytes = input.getBytes();//converts entered String into bytes             try {                 mmInStream.read(bytes);//write bytes over BT connection via outstream             } catch (IOException e) {               //if you cannot write, close the application              Toast.makeText(getBaseContext(), "Connection Failed", Toast.LENGTH_LONG).show();              finish();                            }          }      } } Here is the Arduino file #include int led = 13; int button = 12; LiquidCrystal lcd(9, 8, 4, 5, 6, 7); // Pins used for inputs and outputs******************************************************** float sensorValue1; float containerValue; char inbyte = 0; int flag; const int numReadings = 50; int readings[numReadings]; int index = 0; int total = 0; int average = 0; //******************************************************************************************* void setup() {     pinMode(led, OUTPUT);   digitalWrite(led, HIGH);   Serial.begin(9600);     for (int thisReading = 0; thisReading < numReadings; thisReading++)   {       readings[thisReading] = 0;   }     lcd.begin(16, 2); //change to 16, 2 for smaller 16x2 screens   lcd.clear();   lcd.print("hello, world!");   delay (1000);   lcd.clear();   delay (500); } void loop() {   digitalWrite(led, HIGH);   readSensor2();    //DONE       printLCD();       //DONE   return; sendAndroidValues();   //when serial values have been received this will be true   if (Serial.available() > 0)   {     inbyte = Serial.read();     if (inbyte == '0')     {       //LED off       digitalWrite(led, LOW);     }     if (inbyte == '1')     {       //LED on       digitalWrite(led, HIGH);     }   }     //delay by 2s. Meaning we will be sent values every 2s approx   //also means that it can take up to 2 seconds to change LED state   delay(2000); void readSensor2() {   total = total - readings[index];     readings[index] = analogRead(A0);     total = total + readings[index];     index = index + 1;     if (index >= numReadings)   {      index = 0;   }     average = total / numReadings;        //sensorValue1 = (analogRead(A0) - 330)* i;    //delay(200);         Serial.println(average);    delay(100);          if( digitalRead(button) == HIGH && flag == 1)   {     flag = 0;     containerValue = 0;      }   else if (digitalRead(button) == HIGH && flag != 1) {   flag = 1;                        //when the button is pressed the initially sesnsor     containerValue = sensorValue1;      delay(10);   }     //Serial.println(digitalRead(button));    delay (1000);    } //sends the values from the sensor over serial to BT module void sendAndroidValues() {   //puts # before the values so our app knows what to do with the data Serial.print('#');   //for loop cycles through 4 sensors and sends values via serial   Serial.print(sensorValue1);   Serial.print('+');     //technically not needed but I prefer to break up data values     //so they are easier to see when debugging Serial.print('~'); //used as an end of transmission character - used in app for string length Serial.println(); delay(5000);        //added a delay to eliminate missed transmissions } void printLCD() {   lcd.setCursor(4, 0);   lcd.print("   GRAMS    ");   lcd.setCursor(4, 1);   lcd.print(sensorValue1); }

Question by AyoS1    |  last reply


GSM remote temperature monitoring/ logging

Hello! I currently monitor low energy buildings using temperature, power and CO2 sensors.  These are stand-alone units which log to an internal memory. Which is great if the person is in and you can collect the data - but not so good if they are out. I want to take things to the next level and be able to collect temperature and power logs remotely.  There are bits of kit on the market which do this - but the cost is prohibitive (£1,000+).   There are also various other cheaper GSM based products on the market for GPS trackers, car sensors, home monitoring etc... Is anyone out there clever enough to suggest cheap modular components that could be combined to: 1 - sense a temperature 2 - log the temperature 3 - periodically send the file via a mobile signal I'm up for doing the work  if someone can point me in the right direction - or very happy if some has already done it! Many thanks John

Topic by Cornwalljohn  


Speak Visual Contest - for computer modders and visual artists

MAKE has just announce a new contest it's running with NVIDIA called the Speak Visual Contest. This is perfect for computer modders since you can enter a PC mod, gamer station or PC hardware creation. Interestingly enough, it's also open to motion graphics and data visualization that uses a graphics card as well.Top prize is a Digital Storm PC with some killer specs that's worth over two grand. Five runners up will win the BFG GeForce GTX 260 OC MAXCORE. Others will win copies of Building The Perfect PC 2nd Edition or Make Projects: Small Form Factor PCs from MAKE.Even cooler, one of the ways to enter is to submit an Instructable with "modificationstation" as a tag. Below is the full list of ways to enter.Flickr: tag your photos with "modificationstation" and also add it to the Make: Flickr photo pool.YouTube, Vimeo, blip.tv: tag your videos with "modificationstation".Submit your project link via the Make: Submit form.Instructables, tag your project with "modificationstation".You can also send links to your videos, photos or more to us via email. Speak Visual Contest

Topic by fungus amungus    |  last reply


How can I register a physical button press on a webplatform using the Feather HUZZAH with ESP8266?

I am trying to make a cube where 4 of its sides have a physical button which can be pressed. I want to be able to receive what button was pressed and when via long distance. So wherever the cube is, I can read what it sends on a webplatform of any kind.I looked into Adafruit IO, the feather boards and IFTTT automation but can't figure out how to do this still...I have a basic arduino kit already but nothing Adafruit related yet, before I buy more parts I need to make sure I know what I need and how I will make it work.So far my best research has gotten met to the Feather HUZZAH with ESP8266, but I am not skilled in coding are working with circuit boards. All I know is that it has the option for a battery so my cube can function on it's own (which is very important)So the main question is: How can I make a small portable cube with buttons on its side to send the data of those button presses to an online platform wherever it may be used?

Question by SenneH  


How can I register a physical button press on a webplatform using the Feather HUZZAH with ESP8266?

I am trying to make a cube where 4 of its sides have a physical button which can be pressed. I want to be able to receive what button was pressed and when via long distance. So wherever the cube is, I can read what it sends on a webplatform of any kind.I looked into Adafruit IO, the feather boards and IFTTT automation but can't figure out how to do this still... I have a basic arduino kit already but nothing Adafruit related yet, before I buy more parts I need to make sure I know what I need and how I will make it work. So far my best research has gotten met to the Feather HUZZAH with ESP8266, but I am not skilled in coding are working with circuit boards. All I know is that it has the option for a battery so my cube can function on it's own (which is very important) So the main question is: How can I make a small portable cube with buttons on its side to send the data of those button presses to an online platform wherever it may be used?

Topic by SenneH    |  last reply


Motion Detector Trail Camera

Motion Detector Trail Camera motion, detector, detection, surveillance, security, trail, camera, webcam, webcamera, wildlife, IR, arduino, cheap, inexpensive, spy, cam Hello everyone. I'm planning on building a motion detector triggered "trail" camera, as inexpensively as possible.  I want to use a cheap IC (integrated circuit), if possible, not a $45 Arduino.  I've learned that the most expensive component of this project seems like it will in all likelihood be the digital camera module (the lens and CCD, which is a pixelated digital sensor for the brightness and color of light).  However, I have an old webcam from which I could salvage the camera module out of, if reasonably convenient.  And this is the primary thing I think I'll need help with. Beyond that, my plan is to get a cheap IC, plug the camera module into it on a breadboard, find (hopefully find and not have to delve into learning how to program this) some programming code for the IC to capture the image data and turn into some kind of conventional image file, and then capture the digital camera files on an SD card via SD card shield plugged into the IC via the breadboard.  After the initial project is finished, I'm thinking of taking it a step further by transferring the image files directly to a computer, and upload them immediately to the web but that will come later. And of course write some code to signal the camera to shoot when the motion detector detects motion.  And do some research about which kind of motion detector I want and get it.  But this part seems relatively pretty easy.  Oh, and also get some kind of battery; probably a Li-Ion cellphone type battery with a shield or 'holder' for it.  Haven't yet researched about the shield / 'holder' part for that, but seems like it should be easy. Questions: 1) What kind of programming would I need for the IC to capture the image data from camera and turn it into conventional image file?  Where would I get it?  ...or what?  I just want pictures, not video. 2) How do I salvage the 'camera module' from a web camera for this?  Or rather, perhaps I should ask, once I salvage it, how exactly do I plug it into the IC to send the image data to the IC...? 3) What is a cheap but effective IC for this? Anyways, thank you; cheers. Jack Oh, also wanted to note that I indeed have been looking through many tutorials about this stuff.  I guess I'm at that point where I feel like it would be worth it to write down where I'm at and ask for further directions.  Lol.  Thanks again.

Topic by jack207    |  last reply


FEETECH 17DOF DIY humanoid robot

Https://www.instructables.com/edit/new Feetech 17 DOF humanoid robot ready to play for education DIY FEETECH New Humanoid Robot Profile https://www.youtube.com/watch?v=bSsR33E2Zr0 The FT-17DOF-SC-RTP is a ready to play humanoid robot which comes fully assembled & completed from our team at FEETECH. This humanoid robot uses 17PCS FT-SCServo (SCS15). SCS15 is all metal gear 15kg.cm and uses TTL level Half Duplex Asynchronous UART BUS Communication Protocol. It gives the feedback of the data relevant to position, voltage temperature, load and speed. This humanoid robot uses all aluminum alloy parts, anodized color (red, blue, white for optional) or an assortment.It is simple wiring and makes assembly and disassembly fast and convenient. It is easy to use "MOTION" editing software for Windows system. As long as you use a computer you will love playing with this humanoid robot, even if you do not have any programming knowledge, you can edit the humanoid robot actions within ‘MOTION’ editing software. Robot hobbyist can move the robot in a variety of different poses by hand, then read in and save data from robot joint SCServo via software, moving through the posture sequences from one by one will complete the program of series motion or dance. The data of dance or motion group can be saved into your local computer for use the next time, or download into the robot control board for offline operation. The 2.4G remote control system is based on Arduino open source, users can freely modify according to our Arduino source and combination with the Robot Control Board (SCM-1) to create more advanced functions. You will feel strong & excited when to play this robot dance and movement patterns. The Robot Control Board (SCM-1) can also accept UART instructions, allowing the user to send control instructions according to the packet data’s protocol complementing the robot scope of uses and research. Humanoid Robot Specifications Height:380mm; Weight: 1.7kg(Including battery); DOF:17 Degrees Of Freedom in total Head 1 PCS Hands 6 PCS Feet 10 PCS Connect with computer:USB-mini 2300mAH NI-MH rechargeable battery and AC charger Arduino open source 2.4 G remote control system Key feature -17DOF,UART BUS servo, simple wiring, easy to assemble and disassemble -It is easy to use "MOTION" editing software for Windows system, Programmed robot’s motion by hand. -Save the robot motion data on local and is easy to be use by other robots. -Motion automatic interpolations function; Make the movement more continuous and smooth, make sure the movement of posture to posture more perfect within specified speed time. -Can name the motion group by yourself if you need great for understanding and memory. It can repeat like function calls every motion group. Each motion can be imported and exported alone. -After a series of motion group orderly arrangement can coherent form a dance. Both played online and off-line available. -Each motion group can be remote controlled by Arduino open source 2.4G remote control system (especially good for use as a fighting robot) -With 39kb FLASH motion data storage unit, can be divided into 254 motion group. If storing one motion group, It can contain up to store 730 posture. -The “MOTION” software can show motion data. The robot will to move online when double-click any data of software. This is very easy to debug robot’s motion. -Can be controlled by Arduino UART with instructions. -NI-MH battery can recharge any time no needing worry about d damage. Battery can run about 30 minutes. -Accurate design of each part. Using a screwdriver can complete the assembly Packing list One assembly completed set of FT-17DOF-SC-RTP humanoid robot including: -All metal gear SCServo * 17pcs -Aluminum alloy machinery frame * 1set -Master control board (SCM-1) * 1pcs -Arduino open source 2.4 G remote control system * 1set -7.2V 3,000mAh NI-MH battery  * 1set -8.4 V AC charger * 1pcs -USB-mini cable 150cm -Programming software “Motion”  * 1set (download from Website) Related documents -Instruction manual -Robot debugging manual -Software debugging instruction -Remote controller instruction

Topic by Robotfans  


how do I get an electronic device made?

Hi folks, I am new to this forum so please ignore and naivity / stupidty on my part and I hope this is the right place to ask this type of question. I need help and am appealing to anyone who knows anything about getting an Electronic Device Made. Basically, I require a Bi-Directional People Counter to put in the doorways of venues to count footfall in and out of a given location. It needs to be wireless (Battery operated), easily attached to a doorway/entrance (adhesively) so light weight and able to transmit the data back to our servers (probably via the venue wireless). I have an idea about what type of sensor I need (PIR) and the basic components within the device like battery, circuit board, wireless transmitter etc and I know I will require some sort of algorithm to aggregate/calculate the data and send it back to our servers. My problem is that I am not an engineer and can obviously only get so far and I don't know what to do next. From my research it would seem I need to get an Industrial Designer and a Manufacturing Engineer but both of these seem to be further down the process than what I need first. What I need is; 1. someone (an expert) who can understand the business problem I have and create the electronic device to solve it. Ie. design the circuit, tell me what type of battery I need, what type of sensors we should be using, code the algorithm to make it work and what the subsequent output of their design will be etc and for them to then produce these designs, PCB, Bill of Materials etc. 2. someone I can then take that data to and tell them to make it look pretty (presumably the Industrial Designer) by designing the case/aesthetics etc 3. to then have all the required information (functional designers / circuitry, mould/casing etc) to take to a manufacturer to put the final product together, ready for sale. Does anyone know what type of company or person I should be talking to for each phase? What are people called that do phase 1 that I outlined? Basically, I think I know what I need in terms of technology and its capabilities but I now need a professional/expert to take over to make it a reality. Any help or advice on this would be hugely appreciated as I'm getting a bit muddled and would love some clarity on the process so I can move forward in which ever direction is now appropriate? Thanks all!

Topic by jonkrug    |  last reply


Brainlink: atxmega, Bluetooth, rechargeable battery, accelerometer and more

It looks to me like I'm the only person on Instructables who uses a Brainlink in projects, so I wanted to share my experience with it.   The Brainlink is an atxmega with a cute case, Bluetooth module, a USB-rechargeable battery, accelerometer, multicolor LED, photo diode, IR transmitter, IR receiver, TTL serial uart, a bunch of pwm and digital and analog i/o lines and a regulated 3.3V output.   Full specs and official website are here.  It was produced by a Carnegie Mellon University spinoff. It originally sold for an overpriced $129 but unsurprisingly the product couldn't succeed at that price and it was discontinued.  SurplusShed has them for $39, which is more reasonable, and they periodically have 30-50% off everything sales if you sign up for their emails (for instance, they have a 48% off through the end of today with coupon code SS81420).  When on sale for $20 it's a lot of goodies economically put in one package (and you can pick up some lenses for Google Cardboard from SurplusShed while you're at it). The Brainlink seems to be primarily designed to interface computers or Android devices with all sorts of robotic devices.  There is an open source Java framework for talking to the Brainlink (though the serial protocol is simple enough to just roll your own).   I've used the Brainlink to decode IR signals (the official website has software for analyzing IR signals) and to control a Roomba via the serial uart.  Lately I've been using the Brainlink as a serial-to-Bluetooth bridge to talk to the Mindflex toy EEG (works better with my modded Brainlink firmware--the mods make it fast enough to capture raw data from the Mindflex: I will probably eventually write an Instructable)--see the photo. If you want to use it standalone, Arduino-style, you can upload your own firmware, either writing it from scratch or starting with the original firmware (source code is available).  I haven't actually worked with a real Arduino, but I was pleased to see how smooth the process of building and uploading the firmware was.  I just used WinAVR and it all worked just fine.  They have instructions and a link to the firmware source here. My own firmware mod was to add a full serial bridge mode.  Just send a 'Z' command to the Brainlink and until it's next turned off it bridges between Bluetooth and serial (at whatever baud rate you set with the regular Brainlink 'C' command).  The regular serial communication code may be OK for sending occasional commands to a robot, but it doesn't seem to work for sustained data receiving, at least not at the 57.6K baud that the toy EEG I was using works at.  With the bridge mode and an S-video cable, you basically get the functionality of a Rootooth for Roomba connection at a much smaller price. Presumably, with appropriate firmware you can make autonomous things, but I've been using it with a phone or a PC. For connecting stuff to the Brainlink, you use what look like 1.25mm spacing JST-style connectors (there is one 8-pin port and one 10-pin port;  for serial only connections, you only need three pins near one end of the connector, so a 3-pin connector works for serial).  They include one connector for each port.  I've ordered a bunch of 1.255mm JST connectors from a Chinese ebay seller--hopefully they will fit.   I have no affiliation either with SurplusShed or the makers of the Brainlink.

Topic by arpruss    |  last reply


24 x 24 LED Matrix Project

I would like to share with you all an awesome project and some doubts and questions related to the same. This is a 24 x 24 LED Matrix project taken from here. All the data is taken from the same link. 24×24 LED dot matrix -->   This is pretty old circuit but I found it interesting to describe here. 24×24 LED display is formed by using 9 8×8 Dot LED matrix displays, that are connected to AT90S2313 MCU. MCU scans an indicator lines in series. Special PC program is written which allows drawing images on screen and transfer them via COM port to device. You can send images in series what gives an animation effect.   Circuit is was built using obsolete AT90S2313 MCU which can be replaced by Attiny2313 MCU with minor modifications of firmware. To make program work you event don’t need to connect device to computer COM port. You can store images in other master MCU EEPROM memory Each received byte from UART is immediately sent to 8 LEDs, second byte to next 8 LEDs and so on. Bytes has to be sent one by one without delay. USART is working at 115200 baud, 8bits, no parity. ---------------------------------------------------------------------------------------------------------------------------------- THE PROBLEMS >1>I really dont know if the circuit is good or not tell me if it is going to work. >2>I cant get 8x8 dot matrix displays so i am going to normal leds to a 24x24 one. >3>I have never worked with bus before (the bold red lines in the circuit) so i dont know how to connect it. >4>The schems are segmented i am finding it hard to figure out how to connect some of the segments. >5>Also i need to know how to hook it up to my pc. >6>I have never done programming so i need to know how to program the ic. THANK YOU I couldnt get the images uploaded nicely so i linked them. 1 2  

Topic by science_freak    |  last reply


[URGENT] Unable to Connect Ethernet Shield With Ubuntu:? Answered

[URGENT] Unable to Connect Ethernet Shield With Ubuntu: I have Arduino Uno R3 compatible Microcontroller and Ethernet Shield v1.1 I tried a lot But the ethernet Shield isn't responding Online need help. Details are below My Ubuntu IP: 192.168.1.17 Mask: 255.255.255.0 Gateway: 192.168.1.1 Demo Arduino Sketch: #include #include #include Servo myservo; // create servo object to control a servo byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address byte ip[] = { 192, 168, 1, 177 }; // fixed IP addr in LAN byte gateway[] = { 192, 168, 1, 17 }; // internet access via router byte subnet[] = { 255, 255, 255, 0 }; //subnet mask EthernetServer server(80); //server port String readString; void setup(){ pinMode(6, OUTPUT); //pin selected to control LED //start Ethernet Ethernet.begin(mac, ip, gateway, subnet); server.begin(); //the pin for the servo co //enable serial data print Serial.begin(9600); Serial.println("server LED test"); // so I can keep track } void loop(){ // Create a client connection EthernetClient client = server.available(); if (client) { while (client.connected()) { if (client.available()) { char c = client.read(); //read char by char HTTP request if (readString.length() < 100) { //store characters to string readString += c; //Serial.print(c); } //if HTTP request has ended if (c == '\n') { Serial.println(readString); //print to serial monitor for debuging client.println("HTTP/1.1 200 OK"); //send new page client.println("Content-Type: text/html"); client.println(); client.println(""); client.println(""); client.println("Home Automation"); client.println(""); client.println(""); client.println("Home Automation"); client.println(""); client.println(""); client.println("Turn On Light"); client.println("Turn Off Light"); client.println(""); client.println(""); delay(1); //stopping client client.stop(); // control arduino pin if(readString.indexOf("?lighton") >0)//checks for on { digitalWrite(6, HIGH); // set pin 6 high Serial.println("LED On"); } else{ if(readString.indexOf("?lightoff") >0)//checks for off { digitalWrite(6, LOW); // set pin 6 low Serial.println("LED Off"); }} readString=""; //clearing string for next read }}}}}

Question by Beacon_av    |  last reply


Hc-05 and Arduino connection

Hello to everyone.I have make a bleutooth robot which i can control it via android(tablet) and i have a problem with the code.I want from the robot to stop when connection lost or bluetooth disconnected.Now when the connection lost the robot go ahead and falls on the objects.How to add this line on the code?Can you help me please?The STATE pin of HC-05 when is HIGH is connected and when is LOW is disconnected.I put this on my code but it doesn't stop.Thank you for your time The bluetooth that i use is HC-05 My code: #include Servo SERVO_1; // Initialize Servo1 // Motor Control Variables int PWM1 = 9; int ENABLE1 = 8; int PWM2 = 5; int ENABLE2 = 7; int PWM3 = 3; int ENABLE3 = 4; int PWM4 = 6; int ENABLE4 = 12; int STATE=2; void setup() {   SERVO_1.attach(10);   Serial.begin(9600);   pinMode(ENABLE1, OUTPUT);  //Δήλωση όλων των μεταβλητών ως έξοδος   pinMode(ENABLE2, OUTPUT);  //Δήλωση όλων των μεταβλητών ως έξοδος   pinMode(ENABLE3, OUTPUT);  //Δήλωση όλων των μεταβλητών ως έξοδος   pinMode(ENABLE4, OUTPUT);  //Δήλωση όλων των μεταβλητών ως έξοδος   pinMode(STATE, INPUT); } void loop() {    if(digitalRead(STATE)== HIGH)   // see if there's incoming serial data:   if (Serial.available() > 0) {     // read the oldest byte in the serial buffer:     int incomingByte = Serial.read();     // action depending on the instruction     // as well as sending a confirmation back to the app     switch (incomingByte) {       case 'F':         moveForward();         Serial.println("Going forward");         break;       case 'L' : // Case 'L' is received,         SERVO_1.write (180); // Στρίψε Αριστερά.         SERVO_1.attach(10);         break;       case 'N':         turnright();         Serial.println("Turning right");         break;       case 'M':         turnleft();         Serial.println("Turning left");         break;       case 'O' : // Case 'L' is received,         SERVO_1.write (0); // Στρίψε Αριστερά.         SERVO_1.attach(10);         break;       case 'B':         moveBackward();         Serial.println("Going forward");         break;       case 'P':         SERVO_1.write(90); // Στρίψε Αριστερά.         SERVO_1.attach(10);         break;       case 'S':         moveNone();         Serial.println("Stopping");         break;       default:         // if nothing matches, do nothing         break;     }   } } void moveForward() {   // turn the driving motor on to go forwards at set speed   digitalWrite(ENABLE1, HIGH);   digitalWrite(ENABLE2, HIGH);   digitalWrite(ENABLE3, HIGH);   digitalWrite(ENABLE4, HIGH);   analogWrite(PWM1, 255);   analogWrite(PWM2, 255);   analogWrite(PWM3, 255);   analogWrite(PWM4, 255); } void moveBackward() {   // turn the driving motor on to go backwards at set speed   digitalWrite(ENABLE1, LOW);   digitalWrite(ENABLE2, LOW);   digitalWrite(ENABLE3, LOW);   digitalWrite(ENABLE4, LOW);   analogWrite(PWM1, 255);   analogWrite(PWM2, 255);   analogWrite(PWM3, 255);   analogWrite(PWM4, 255); } void turnright() {   digitalWrite(ENABLE1, HIGH);   digitalWrite(ENABLE2, HIGH);   digitalWrite(ENABLE3, LOW);   digitalWrite(ENABLE4, LOW);   analogWrite(PWM1, 255);   analogWrite(PWM2, 255);   analogWrite(PWM3, 255);   analogWrite(PWM4, 255); } void turnleft() {   digitalWrite(ENABLE1, LOW);   digitalWrite(ENABLE2, LOW);   digitalWrite(ENABLE3, HIGH);   digitalWrite(ENABLE4, HIGH);   analogWrite(PWM1, 255);   analogWrite(PWM2, 255);   analogWrite(PWM3, 255);   analogWrite(PWM4, 255); } void moveNone() {   // turn the driving motor off   digitalWrite(ENABLE1, 0);   digitalWrite(ENABLE2, 0);   digitalWrite(ENABLE3, 0);   digitalWrite(ENABLE4, 0);   analogWrite(PWM1, 0);   analogWrite(PWM2, 0);   analogWrite(PWM3, 0);   analogWrite(PWM4, 0);   SERVO_1.detach(); }

Question by dimitrakis1992    |  last reply


Help with my project.

Little help with my project.  I think ya'll could help me with my project. I have no experience in electrical engineering other than 1 high school electronics project. That I messed up, but still have that project & it works due to teacher tinkering with it. So now I'm attempting to tinker with electronics. I've taken a Paper Jamz amplifier that was powered by 4 aaa batteries and modified it to be powered by a 6v 300ma ac/dc wall wort w/o destroying either. Whoa who!! Now time to try something a bit harder. This project is to make a attractive desktop Solar USB charger, dual stereo amplifier, mp3 player system (Pandora's Box). Seeing Joshua Zimmerman of BrownDogGadgets.com's heavy duty solar charger in a tin & USB charging circuit I believe that my project is possible. I will probably be purchasing both of them and hack together a Dual USB solar charger with 2 AA batteries.  Looking over this post could someone draw a schematic in "English" with missing parts added? So I've started to tinker. Here is a list of all the things I have. Got pictures of some of them but not sure if I have to go pro to post. (* Not married to some of these parts) 2 Paper Jamz amplifiers 8ohm 1w stereo speakers (each powered by 4 aaa batteries) 1 5v 200mA solar panel * 1 Paper Jamz battery pack * (4 aaa batteries) Not sure what batteries to use. Can power both amps w/ 1 pack. Coby 1gb USB mp3 player (playback functions powered by 1 aaa battery) 1 Micro USB MALE - USB A MALE cable cut and stripped. Breadboard, hookups for wiring. To avoid soldering. Audio hookups: 4 3.5mm M - M, 2 3.5mm F - F coupler, Stereo Y adapter 3.5mm M - 2 F  Y adapter Cigar Box enclosure. Internal dimensions (open no lid space): 2.25"h x 7.5625"w x 6.1875"d. external closed: 2.6875"h x 8.375"w x 7.0625"d So I've powered both of the amplifiers with one set of AAA batteries. I'm thinking that they can be powered by the 2 AA batteries from the solar charger. Let me know if I'm right here.   I would like to attach my USB micro male whip to a circuit, through box to charge my BlackBerry PlayBook. I think it needs 5v 1.8a for charging. Don't know if it also needs fake data voltage for charging. I've tested my phone with the USB micro whip, AAA power pack & it charges. For ease of construction I'll be using the breadboard & hot glue circuit parts together. Seeing that the mp3 player only needs power from the equivalent of a aaa battery, what is the best way to reduce the amperage from the two AA batteries so not to burn out the Mp3 player? Going to mount it against side of box with USB MALE adapter going through back wall. Use dowl rod pieces for buttons on side, battery hookups faceted inside. All components sending/receiving audio via 3.5mm audio patch cables.  Paper Jamz amps wired in parallel through breadboard to power pack. [power pack, breadboard (not mounted)], audio ports, speakers. Speakers mounted to sound board suspended from lid. Would like to mount solar panel on outside of box lid. Nothing mounted is set in stone but the audio ports & speakers are fixed in place.  Thanks in advance hope ya'll can help here. & if your going to Maker Fair Detroit this weekend have fun. Thanks again,  Okaybye! Josh Kalbow Remember to Zombie proof your projects. 

Topic by Zombie_Tinker    |  last reply


Robo-Goat Lives - At least I hope he Will

OK here goes. I work at zoo and I am a self taught geek, (mainly old school). I recently volunteered for a project mainly because I'm too stupid to know that it's not possible :~) Purpose of the program/project To - Engineer, Design and Build an Animatronic Robot Goat for: a Cheetah Conservation Fund in Kenya, Africa. This device will replicate a live goat in: size; appearance; movement; sound and smell (smell supplied by others), that can withstand the sever conditions of the desert, durable, possibly solar powered and easy to transport, setup and operate. Note: Up until this point real goats have been tried but they have not been too successful. They were either too stressed or they were stolen for by locals their meat. Objective(s): To lure Cheetahs into an area and enticement them into a cage trap with a simulated live goat (Robo-Goat), to provide a safe humane and ethical capture of wild cheetahs so that recently acquired state of the art GPS/Cellular tracking collars can be placed on them to help gather information to preserve this endangered animal. Analog Radio Tracking Collars have provided the only way to gather much of the information for many different wild animals. Radio Tracking style of the past has always been a difficult and time consuming endeavor, with old style tracking, large heavy radio collars that broadcast a ”beep” continuously, must be tracked with specialized hand-held radios and yagi antennas. All this to locate an animal being studied. Many times you would have to get close enough to disturb the animal just to find out where it is and then try to track it. Obviously not good “normal behavior” data gathering. The new GPS/Cellular systems track the animal in real time and send back data coordinates on the animals location, elevation, speed and direction as it travels. This GPS information is sent via cell towers, (yes they have them in Africa), to a computer that logs and graphs the movements. The research gathered through these efforts may provide the answers to saving these endangered animals. Project design/methods: #1. Establish parameters Record video & audio movements and sounds of normal & panicked goats Research and study movements and demonstrate what mechanical requirements will be necessary to replicate the minimum needed movements - [DONE]. {Raise and lower head; Look left and right; open/close mouth} Determine movement engine {I'm not sure here} {All of the movements are really axial in nature} {At first I was thinking motors but then there are end stops, control systems, ect. To deal with} {next I'm considering solenoids for the low energy requirements and simple full scale movements, except you cant control the speed} {But now I am becoming fixated on model airplane actuators for low weight, low noise and appendage like joints and accessories} {then I ran across "pager motors" and how they are small powerful and inexpensive some how I don't know where to begin} {can you tell this is all still up in the air?} Throw distance & Speed of movement - [DONE]. {Raise and lower head = 90 degrees of arc from base of neck = 5 seconds max} { Look left and right = 90 degrees of arc from left to right with return to normal center point half way = full movement l-r = 2 seconds max i hope} {open/close mouth = 45 degrees of arc from lower jaw = 1 second max} Repetition rate & pattern {random if possible} Determine audio requirements - [DONE]. {this is easy but requires playback trigger synchronized with mouth} The Cosmetics: Determine body and outer skin requirements – [Engineering]. {aluminum wire frame mesh} {foam sculpted head for low mass} {foam wrap suit for body & legs for low mass} {tyvek skin, airbrushed or penned for low mass} {stainless steel / nylon joints for low mass} DB level of normal and panicked goats - [DONE] {I have determined audio system requirements} Determine control system requirements {clueless at this point} Determine power requirements {I'm thinking deep cell marine battery and solar panels to retain charge autonomously} {amp hour rating for battery and solar charging circuit TBD after R&D; tests} {if solar is not feasible them battery exchange schedule TBD} #2 Acquire all electronic and mechanical parts #3 Create mechanicals Fabricate lightweight frame and skeleton structure. Assemble motion joints and motion engine Assemble and test motor functions Determine estimate of MTBF for spare parts, if any #4 Create & install sound system Edit custom audio media for both normal & panicked goats Utilize 12v Solid State Audio Playback Unit # 5 Create Control System #6 R&D; Testing Test charging and power circuit Final assembly #7 Final test Any help to provide suggestions to get me started on the type of engines would be great. tia

Topic by sharpfocus  


Can anyone help me out with my project?

Little help with my project.  I think ya'll could help me with my project. I have no experience in electrical engineering other than a 4th grade science fair project on the difference between parallel and series circuits. And 1 high school electronics project that I messed up, but still have that project & it works due to teacher tinkering with it. So now I'm attempting to tinker with electronics. I've taken a Paper Jamz amplifier that was powered by 4 aaa batteries and modified it to be powered by a 6v 300ma ac/dc wall wort w/o destroying either. Whoa who!! Now time to try something a bit harder. This project is to make a attractive desktop Solar USB charger, dual stereo amplifier, mp3 player system (Pandora's Box). Seeing Joshua Zimmerman of BrownDogGadgets.com's heavy duty solar charger in a tin & USB charging circuit I believe that my project is possible. I will probably be purchasing both of them and hack together a Dual USB solar charger with 2 AA batteries.  Looking over this post could someone draw a schematic in "English" with missing parts added? So I've started to tinker. Here is a list of all the things I have. Got pictures of some of them but not sure if I have to go pro to post. (* Not married to some of these parts) 2 Paper Jamz amplifiers 8ohm 1w stereo speakers (each powered by 4 aaa batteries) 1 5v 200mA solar panel * 1 Paper Jamz battery pack * (4 aaa batteries) Not sure what batteries to use. Can power both amps w/ 1 pack. Coby 1gb USB mp3 player (playback functions powered by 1 aaa battery) 1 Micro USB MALE - USB A MALE cable cut and stripped. Breadboard, hookups for wiring. To avoid soldering. Audio hookups: 4 3.5mm M - M, 2 3.5mm F - F coupler, Stereo Y adapter 3.5mm M - 2 F  Y adapter Cigar Box enclosure. Internal dimensions (open no lid space): 2.25"h x 7.5625"w x 6.1875"d. external closed: 2.6875"h x 8.375"w x 7.0625"d So I've powered both of the amplifiers with one set of AAA batteries. I'm thinking that they can be powered by the 2 AA batteries from the solar charger. Let me know if I'm right here.   I would like to attach my USB micro male whip to a circuit, through box to charge my BlackBerry PlayBook. I think it needs 5v 1.8a for charging. Don't know if it also needs fake data voltage for charging. I've tested my phone with the USB micro whip, AAA power pack & it charges. For ease of construction I'll be using the breadboard & hot glue circuit parts together. Seeing that the mp3 player only needs power from the equivalent of a aaa battery, what is the best way to reduce the amperage from the two AA batteries so not to burn out the Mp3 player? Going to mount it against side of box with USB MALE adapter going through back wall. Use dowl rod pieces for buttons on side, battery hookups faceted inside. All components sending/receiving audio via 3.5mm audio patch cables.  Paper Jamz amps wired in parallel through breadboard to power pack. [power pack, breadboard (not mounted)], audio ports, speakers. Speakers mounted to sound board suspended from lid. Would like to mount solar panel on outside of box lid. Nothing mounted is set in stone but the audio ports & speakers are fixed in place.  Thanks in advance hope ya'll can help here. & if your going to Maker Fair Detroit this weekend have fun. Thanks again,  Okaybye! Josh Kalbow Remember to Zombie proof your projects. 

Question by Zombie_Tinker    |  last reply


500W electric scooter control and instrumentation with Arduino mega

1. Introduction DC 500W motor control with an Arduino mega to limit starting current and to vary the speed of the scooter. The battery is in 24V, 10A.h. The following table summarizes their characteristics: https://i58.servimg.com/u/f58/17/56/35/17/a014.jpg https://i58.servimg.com/u/f58/17/56/35/17/a111.jpg 2. Bibliography: Link download : sketch_escooter_feed_back_reel_V1.ino https://drive.google.com/file/d/0B_fB3GAsM02FSlRTWHdyRkhuUW8/view?usp=sharing escooter_ampli_SIMULINK.mdl https://drive.google.com/file/d/0B_fB3GAsM02FOW9OdmlhdDhJZGc/view?usp=sharing escooter feed back ISIS.DSN https://drive.google.com/file/d/0B_fB3GAsM02FOXdRWFN5OWRMQkE/view?usp=sharing youtube  :  "study trotinette electric e-scooter 100W et 350W, wiring"  youtube https://www.youtube.com/watch?v=QqJ2-YiE8Tg&index;=75&list;=PLfZunVn_gcq7EOurXuWU2sRFmh6CbiUiL Article: «Study of electric scooters 100W and 500W (Arduino), Revue 3EI 2017» Pdf? Book «I realize my electric vehicle» at DUNOD 3. Open loop program To test the programming, we simulate the program in ISIS, as can be seen in the following figure. In addition, we have an LCD display to display data (duty cycle corresponding to the PWM at 32Khz, motor current, motor voltage, action on the pushbuttons, 4 push buttons are used. BP1 to manually increment the duty cycle, BP2 decrement it. BP3 set the duty cycle to 0, corresponding to the brake contact. The speed of the motor is practically proportional to the duty cycle https://i58.servimg.com/u/f58/17/56/35/17/a211.jpg We made our own current amplifier called a step-down chopper but it is possible to buy a shield There are many cards for Arduino to control DC motors especially of low powers and also of great powers as can be observed on the following links.http://www.robotpower.com/products/MegaMotoPlus_info.html http://www.robotshop.com/en/dc-motor-driver-2-15a.html https://www.pololu.com/file/0J51/vnh3sp30.pdf https://i58.servimg.com/u/f58/17/56/35/17/a310.jpg But all these chopper shields measure the current internally but there is no current limitation. In order to have a current limitation, an analog current loop is required using specialized AOP or IC or a fast digital current loop. But what should be the value of the limitation current? The choice of the current value is normally for the 1-hour operation service in order to be able to carry out relatively long climbs without reaching the critical temperature of the engine. In our case, the limitation current must be Limiting motor = Power / Upper battery = 500W / 24V = 20A In addition, the power transistor of the chopper can only support 50A in our case. But in open loop, it has no current regulation, so as not to exceed the maximum current, a ramp of the duty cycle will be used. A 0.1 second interruption routine will be used to measure the voltage of the current (sample measurement, sample). This sampling time is arbitrary but does not allow to be faster than the rise time of the current because the electric time constant of the motor is L / R = 1.5 ms. Open loop operation with a 25.5s (8bit) ramp and 0.1s interrupt routine provides a good understanding of the operation of a DC motor drive. The display will only be done every 0.2s to have a stability of the digits on the screen. In addition, a digital filtering will be done on the current and the voltage on 4 values therefore on 0.4s. [b] Algo open loop [/b] Interrupt Routine All 0.1S Read voltage and current Loop loop (push button scan) If BP1 = 1 then increment PWM If BP2 = 1 then decrement PWM If BP3 = 1 then PWM = 0 Displaying variables every 0.2s Code: [Select] // include the library code: #include #include #include #define SERIAL_PORT_LOG_ENABLE 1 #define Led     13       // 13 for the yellow led on the map #define BP1     30       // 30 BP1 #define BP2     31       // 31 BP2           #define BP3     32       // 32 BP3 #define LEDV    33       // 33 led #define LEDJ    34       // 34 led #define LEDR    35       // 35 led #define relay   36       // 36 relay #define PWM10    10      //11   timer2    LiquidCrystal lcd(27, 28, 25, 24, 23, 22); // RS=12, Enable=11, D4=5, D5=4, D6= 3, D7=2, BPpoussoir=26 // Configuring variables unsigned   int UmoteurF = 0;  // variable to store the value coming from the sensor unsigned   int Umoteur = 0; unsigned   int Umoteur2 = 0; unsigned   int Umoteur3 = 0; unsigned   int Umoteur4 = 0; unsigned   int ImoteurF = 0;  unsigned   int Imoteur = 0; unsigned   int Imoteur2 = 0; unsigned   int Imoteur3 = 0; unsigned   int Imoteur4 = 0;            byte Rcy=0 ;    // 8bit duty cycle unsigned    int temps; // the setup function runs once when you press reset or power the board void setup() {   pinMode(Led, OUTPUT);   // Arduino card   pinMode(LEDV, OUTPUT);   pinMode(LEDR, OUTPUT);   pinMode(LEDJ, OUTPUT);   pinMode (PWM10,OUTPUT);     // Pin (10) output timer2   //  digitalWrite(LEDV,LOW);   Timer1.initialize(100000);         // initialize timer1, and set a 0,1 second period =>  100 000   Timer1.attachInterrupt(callback);  // attaches callback() as a timer overflow interrupt   lcd.begin(20, 4);    Serial1.begin(9600);   TCCR2B = (TCCR2B & 0b11111000) | 0x01;         //pin 10  32khz    http://playground.arduino.cc/Main/TimerPWMCheatsheet                                                   //http://www.pobot.org/Modifier-la-frequence-d-un-PWM.html   //   analogWriteResolution(bits)      https://www.arduino.cc/en/Reference/AnalogWriteResolution lcd.setCursor(0,1); lcd.print("Rcy"); lcd.setCursor(10,1); lcd.print("Um"); lcd.setCursor(5,1); lcd.print("Im"); lcd.setCursor(10,1); lcd.print("Um"); lcd.setCursor(20,1); // 4 lines display * 20 characters lcd.print("BP1+"); lcd.setCursor(25,1); lcd.print("BP2-"); lcd.setCursor(29,1); lcd.print("BP3=0"); } // Interruptions  tous les 0.1s void callback()  { temps++; //toogle state ledv for check   if ( digitalRead(LEDV)== 1 ) {digitalWrite(LEDV,LOW);}     else {digitalWrite(LEDV,HIGH);}     analogWrite(PWM10,Rcy);   // frequency Umoteur=analogRead(A0); Imoteur=analogRead(A1); Imoteur2=Imoteur; Imoteur3=Imoteur2; Imoteur4=Imoteur3; ImoteurF=(Imoteur4+Imoteur3+Imoteur2+Imoteur)/4 ; Umoteur2=Umoteur; Umoteur3=Umoteur2; Umoteur4=Umoteur3; UmoteurF=(Umoteur4+Umoteur3+Umoteur2+Umoteur)/4 ;   }// End routine // Loop corresponding to main function void loop() {    // BP + LED   if ((digitalRead(BP1))==1) {     lcd.setCursor(20,0);      // Column line     lcd.print("BP1");     digitalWrite(LEDR, LOW);        digitalWrite(LEDJ, LOW);     Rcy++;                        // PWM incrementation     if ( Rcy>254)  {Rcy=254;}     delay(100);               //8bits * 100ms = 25S increment 25ssecond slope     }        if ((digitalRead(BP2))==1) {     lcd.setCursor(20,0);     lcd.print("BP2");             Rcy--;      if ( Rcy<2)  {Rcy=2;}  // PWM almost at 0, engine stop         delay(100);      digitalWrite(LEDR, HIGH);     digitalWrite(LEDJ, HIGH);     }   if ((digitalRead(BP3))==1) {     lcd.setCursor(20,0);     lcd.print("BP3");      Rcy=2;               // PWM almost at 0, engine stop     } if (temps>=2)  { lcd.setCursor(0,0); lcd.print("                "); // Erase line lcd.setCursor(0,0);     lcd.print(Rcy); lcd.setCursor(5,0); ImoteurF=(ImoteurF)/20;     //resistance (5/1024)*(10/0.25ohm) si ACS712 66mV/A                            // For resistance 1ohm (ImoteurF) / 20; Simulation 5/25 lcd.print(ImoteurF); lcd.setCursor(10,0); UmoteurF=UmoteurF*10/38;                              //10/38   10/30 simula if (Umoteur>ImoteurF){UmoteurF=UmoteurF-ImoteurF;  }  //U-R*I lcd.print(UmoteurF); temps=0; }// End if time    } // End loop https://i58.servimg.com/u/f58/17/56/35/17/dsc_0614.jpg Since there is a limit of 9000 characters in the forum below Open loop program feature previous The interrupt routine lasts only 250 microseconds, the loop of the main program which scans the action of push buttons is 13micros and the display time of all data is 11ms. Thus, it is possible to improve the sampling period and thus the speed of the regulation of the current. The Arduino makes it possible to make the instrumentation of the scooter so to know the power, the consumption in Ah and Wh, to measure the speed, to know the consumption according to Wh / km, to measure the temperature of the engine, Have a safe operation. But for now we will see how to limit the current 4. Closed loop program, limited current control The sampling period will increase to 0.01 seconds (interrupt routine) If the current is less than the desired value, then the duty cycle can be increased or decreased to the desired value which is the setpoint. On the other hand, if the motor current is greater than the limiting value, there is a rapid decrease in the duty cycle. So as not to exceed the value of the duty cycle if it is saturated to 254 maximum and to the minimum value 6. Code: [Select] if (Imoteur<4000)                    // No current limitation at (20A * 10) * 20 = 4000   {if (consigne>Rcy)   {Rcy=Rcy+1;}   // Pwm ramp + 1 * 0.01second pure integrator    if (consigne    if ( Rcy>254)  {Rcy=254;}           // Limitation of duty cycle    analogWrite(PWM10,Rcy);   // Frequency 32kHz timer2}         } if (Imoteur>4000)  { Rcy=Rcy-5;              // No current filtering, to be faster                     if ( Rcy<6)  {Rcy=5;}       // Rcy is not signed, nor the PWM therefore Rcy minimum must not be less than 6                   analogWrite(PWM10,Rcy);   // Frequency 32kHz timer2}                        } 5. Closed Loop Program, Limited Current Control with Acceleration Handle An acceleration handle provides a 0.8V voltage when not operated and a 4.5V voltage when the handle is fully engaged. Instead of using pushbuttons to increase or decrease the speed setpoint, an acceleration handle will be used Code: [Select] Upoignee=analogRead(A3); // The relation in Upoign and the setpoint which corresponds to the duty cycle corresponds to if (Upoignee>100) { consigne=(Upoignee/2);     //0=a*200+b    et 255=a*800+b                      consigne= consigne-100;                   }                            else { consigne=0;   }               if (Upoignee<100) { consigne=0;  }     // redundancy     6. Temperature and safety program of the motor with the current measurement The outdoor temperature measurement can be easily performed by the LM35 component which charges 0.01V by degrees Celsius Code: [Select] temperature=analogRead(A2); //lm35 0.01V/°C temperature=temperature/2;       // Temperature coefficient lcd.setCursor(5,2); lcd.print("      "); lcd.setCursor(5,2); lcd.print(temperature);   // Display in ° C lcd.setCursor(9,2);      // Erasing secu display lcd.print("     ");   if (temperature>80 ) {lcd.setCursor(9,2);         // If motor external temperature is above 80 ° C                      lcd.print("secuT");                       Rcy=0;} In addition, thermal safety by measuring the motor current will be added. If the limitation current is greater than 10s then the motor will no longer be powered for 30s. A "secu" display will appear on the LCD display. This safety makes it possible to cut the motor on slope too high and when blocking the engine but it would be necessary to add the measurement of the speed in the latter case Code: [Select] if (timesecurite>=10000 ) {flagarret=1;      // If limitation current for a current of more than 10s                               timerepos=0;                               consigne=0;                               Rcy=0;                                 timesecurite=0;}       //   Then stop engine during a downtime    if (flagarret==1 ) {lcd.setCursor(9,2);         // If limiting current for a current of more than 20s                      lcd.print("secU");  }     //   Then stopping the motor for a stop time and display                                                     if (timerepos>=30000 &&  flagarret==1) {flagarret=0;                                           lcd.setCursor(9,2);      // After a rest time here of 30s                                            lcd.print("       ");   }   The display can be observed if the temperature is above 80 ° C https://i58.servimg.com/u/f58/17/56/35/17/a017.jpg Thermal safety by measuring the motor current (digital thermal relay) which allows to know the image of the internal temperature of the engine would be ideal. But for this, it is necessary to know well the thermal modeling of the motor. 7. Measurement of the energy capacity of the battery The energy capacity of a battery is in A.H, we will display the value in mA.H to have a high accuracy. The capacity will be in A.Second in the following equation. So to have in mA.H, it will be divided by capacity by3600. Capacity (A.s) n = I * Te + Cn-1 with Te = 0.01s and I multiplied by 10 So in the interrupt routine Code: [Select] capacity=ImoteurF+capacity ; And in the display Code: [Select] lcd.setCursor(0,3); // Display of energy capacity lcd.print("C mA.h="); capacity1=capacity/(18000);   //18000=3600*5  5=> Current measurement coefficient lcd.print(capacity1); To check a current of 10A with an adjustable resistor and after 30s, the capacity must be 83mA.H 8. Power and modeling with SIMULINK Modeling helps to understand the vehicle and its control. In addition, it is possible to compile the control part directly into the Arduino program from simulation under Simulink. But it will not be possible to simulate the instrumentation with the LCD display. In the following figure, we can observe the simulation of the programming of the chopper with the current limitation with Simulink. In the following figure, the green box shows the duty cycle control to vary the speed and the red border the current limitation. The controller of the control is here a simple integrator but it is possible to carry out a multitude of control. https://i58.servimg.com/u/f58/17/56/35/17/azub_c15.jpg In the previous figure, it can be observed that the current is well limited to 25A from 2s to 9.5s. Then, the current reaches 10.8A under established speed regime at 22.5km / h. The dynamics are similar to the tests carried out. With a slope of 5%, the cyclic ratio reaches only 100% as can be seen in the following figure. The speed will reach painfully 19km / h with a current of 24A and a motor power of 580W. See article: Study of electric scooters 100W and 500W (Arduino), 9. First conclusion It is easy to control a 500W DC motor with an Arduino and some components So repair many scooters that are in DC motors. But it takes some knowledge (automatic, engine) to know how to properly manage the engine and limit its current so as not to damage it The display of the speed, the distance, the operating time to know the Watt.km / km can also be realized with a menu 2. The .ino program as an attached file, But it is not possible to put an attached file in ISIS electronic labcenter? What is this forum? It would be desirable that the compiler could generate the.cof to debug in Isis and test the program line by line .... Arduino still has to make a lot of effort to be on the same level as other microcontrollers 10. speed measurement (tachometer) Velocity measurement is carried out using a hall effect sensor SS495 or A1324 which counts each revolution of the wheel. It is enough to enter the perimeter of the wheel of the scooter (130mm of radius therefore 0.816m in the case To have the speed, it is enough just to divide the number of turn of wheel on an arbitrary time of 1s to have a minimum speed of 0.81m / s therefore of 2.93 km / h. In addition, an average filter with 3 values will be used to display the speed. At 25km / h, there will be 8.5 laps. To count the turns, an external interrupt routine will be used on input INT0 21 of the mega card. http://www.locoduino.org/spip.php?article64 To simulate the speed, a pulse on input 21 will be used with a duty cycle of 10%. https://i58.servimg.com/u/f58/17/56/35/17/a018.jpg Code: [Select] void INT0b21() {   Tspeed++;   // External interruption to count the number of turns } // In the set up declare the interrupt routine when the 5V edge of the magnet detection is done   attachInterrupt(digitalPinToInterrupt(21), INT0b21, RISING );  // External interruption // In loop if (temps09>=5)  {        // 1 second loop lcd.setCursor(13,2);      // Erasing speed lcd.print("kph     "); lcd.setCursor(16,2); speed1=Tspeed*2937;      //1tour*816*3.6/1s=2.937km/h speed2=speed1;           //Tspeed (rate/seconde) speed3=speed2; speedF=(speed1+speed2+speed3)/3000;   // To put in kph lcd.print(speedF,1);    // Display to the nearest tenth Tspeed=0;   // Reset counter temps09=0;  //reset time } To improve the accuracy of the velocity measurement, it is possible that the sampling time of the velocity measurement is dependent on the velocity. For example: For speeds less than 10km / h sample at 1second, but above 10km / h sample at 2 seconds. 11. Distance measurement for autonomy The distance corresponds to the total number of turns of the wheel multiplied by the perimeter of the wheel. So do not set the number of turns to 0 for each sample. On the other hand, the reset of the distance will be done when pressing the reset of the Arduino Mega. The distance display will be displayed to the nearest second. At 32km / h, it will take 2 minutes to do 1km as can be seen in the following figure: https://i58.servimg.com/u/f58/17/56/35/17/a019.jpg Code: [Select] void INT0b21() {   Tspeed++;   // External interruption to count speed   nbrRate++; } lcd.setCursor(13,4);      lcd.print("km      ");  // distance=(nbrRate*816)/1000;  //distance m distance=distance/1000;  //distance km lcd.setCursor(15,4);      lcd.print(distance,1);  You can observe the electrical installation with the chopper, the arduino, and the display when the program is set up https://i58.servimg.com/u/f58/17/56/35/17/dsc_0613.jpg 12. Synthesis The RAM space is used only at 4% and ROM space at 3%, for an Arduino mega. So we could take an arduino a little smaller. But, there are 8 Lipo cells to make the 24V power supply to power the engine via the chopper. Therefore, the voltage measurement of each element will be on the Arduino with a JST connector. This measurement makes it possible to know if a cell with an internal resistance which begins to pose a problem and to know if the balancing of each cell has indeed been carried out. It is possible to switch to 36V with 12 cells also with the arduino mega without using an external shield that multiplex 24 analog inputs on input A0 It is possible to send all data to a smartphone via Bluetooth HC06 via pins 20, 21, RX1 and TX1. But the application under android realized under JAVA Studio can not be shared on this forum. This part will not be explained. After having made the instrumentation of this scooter, a study should be carried out on the precision of the measurements, it is possible to read "Instrumentation of a low-power electrical motor vehicle" eco marathon "type Revue 3EI N ° 81, July 2015 http://www.fichier-pdf.fr/2015/09/07/instrumentation-vehicule-faible-consommation-eco-marathon/

Topic by Iutgeiisoissons