technologie innovation

Technologie Innovation

Translate

lundi 4 septembre 2017

Design and Control robot by computer (node-red/cameras)




  This article is about control robot car photovoltaic with laptop and camera So The objective of this project is to design and conception remote control node-red toy or robot. We learn the interface of the commercially available RF transmitter and receiver module coupled with HT12E and HT12Dpair (Encoder/Decoder) to transfer data over the air to the motors in the our robot car.
  For complete computer control, we have used two cameras, wireless by program droid-cam starts from it, we did remote by node-red 
 For loading a battery for remote receiver we have used photovoltaic.

Working Logic for the RC Robot Car

  Here is a flowchart to help you understand the working logic of the robot car. First we will go over the basic idea of the RC car and the working logic that is involved in the car. There are two blocks, the Transmitter (remote control using node-red)) and the Receiver (robot car)also this flowchart help you understand Solar charging method by photovoltaic panels Starting from the control of the loader To facilitate remote control, we used two cameras we talk about later

On the transmitter side, you have the switch node-red to give the digital inputs to the encoder IC. The encoder then encodes this data and sends it to the RF Transmitter module. On the receiver side, you will have the RF Receiver which receives the encoded data and passes it on to the decoder. The decoder decodes the data and sends it to the motor driver IC to drive the motors.     


Circuit diagrams and description.

Required Components

Transmitter Section:


Optocoupler:

For Arduino control are used in the remote control to move the car backward, forward, left and right.
HT12E Encoder IC :
It is a 2 series encoder IC used for wireless communication applications. It is mainly used to convert 12 bit parallel data (8 address bits and 4 data bits) to serial out so that it can be transmitted using a transmitter Module.


RF Tx Module:

434 MHZ ASK transmitter module for transmission. It is capable of providing a data rate of about 8kbps.




Arduino:
Used for two things, first power the remote and the second for the programming to control remote.

Reciver Section:

RF RX module:
A high sensitivity 434 MHZ ASK Receiver module for receiving the data from remote control. 


HT12D Decoder IC:

It is a 12 series decode IC used for wireless communication applications. It converts the serial input to parallel out.

Motor Driver:
L293D is a motor driver IC which has two channels for driving two motors. L293D has two inbuilt Transistor Darrlington pair for current amplification and a separate power supply pin for giving external supply for the motors.

Motors:
Here two B0 motors are used which are driven by the motor driver L293D and both of them are connected to robotic wheels to move the car
Power:
So 9V/12V battery is required to power the circuit.so we will use battery, photovoltaic panel and solar regulator will talk about it later

Remote encoder/ transmitter circuit

Node-RED:Interacting with arduino

Introduction:
  Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.
  Node-RED provides a browser-based flow editor that makes it easy to wire together flows using the wide range nodes in the palette. Flows can be then deployed to the runtime in a single-click.
Why Node-RED?

  • Open-source
  • Multi-platform/Cross-platform
  • Browser based and supported by cloud platforms like Bluemix of IBM.
  • Visual programming tool
  • Supports real-time automation of M2M and IoT protocols.
  • Future of Industrial IoT(Internet of Things)


              1-Preparing your Arduino Uno board

              Baud-rate should be 57600.

              • Don't use/open your serial monitor, keep your COM port free.
              • Keep your arduino board connected to your computer.
              • testing your arduino
              Code firmata
              Run Arduino ,open file>examples>firmata>standardfirmata and click to upload


              2-Preparing your Node-red
              How to install Node-red ?
                  ---->For Windows
              Download node.js for your computer, Click here.
              -Open the command prompt and install Node-RED with this command.
              npm install -g node-red
              
              -Now
               run your Node-RED, with this command

              node-red
              Copy the local-server link to your browser(Chrome)  
              http://localhost:1880/#
                 
               ---->For Ubuntu/linux
              -install node-js and npm
              install the -legacy version of the package 
              sudo apt-get install nodejs-legacy
              Verify that the installation was successful by checking the version.
              node -v
              You'll see Node.js output its version number:

              Node Package Manager (npm) helps you install and manage Node.js software packages, and we'll use it to install Node-RED. Install npm using apt-get.
              sudo apt-get install npm
              To verify the install was successful, ask npm to print its version information:
              npm -v
              -installing node-red
              Use npm to install node-red
              sudo npm install -g node-red
              First, we'll need to open up a port on our firewall. Node-RED defaults to using port 1880, so let's allow that.
              sudo ufw allow 1880
              And now launch Node-RED itself. No sudo is necessary, as port 1880 is high enough to not require root privileges.
              node-red
              your ip adress is http://127.0.0.1:1880//

              at last welcome to node-red.
              Node-red at a glance
              Now install the new package Arduino for node-red:
              open terminal
              create this command
              cd ~/.node-red/
              and install this package
              sudo npm install node-red-node-arduino
              or Write in 'Menu>Manage palette>Install' node-red-node-arduino and install this is the last

              3-Connect Node-red with arduino
              Now it is time to create your project.
              Choose the following NODES-
              • switch Node Input,
              • Freebord Node,
              • Arduino out node-red

              Or
              Copy and Import the following code (Menu>Import>Clipboard)

              [{"id":"744bed9a.120ab4","type":"arduino out","z":"282f2cb4.0b1164","name":"","pin":"9","state":"OUTPUT","arduino":"46aa28ae.e4fdc8","x":569,"y":149,"wires":[]},{"id":"76963dab.7db304","type":"arduino out","z":"282f2cb4.0b1164","name":"","pin":"10","state":"OUTPUT","arduino":"46aa28ae.e4fdc8","x":591,"y":203,"wires":[]},{"id":"799bb4e7.ddb5ec","type":"arduino out","z":"282f2cb4.0b1164","name":"","pin":"11","state":"OUTPUT","arduino":"46aa28ae.e4fdc8","x":523,"y":324,"wires":[]},{"id":"3cdf4b80.64ea24","type":"arduino out","z":"282f2cb4.0b1164","name":"","pin":"12","state":"OUTPUT","arduino":"46aa28ae.e4fdc8","x":556,"y":400,"wires":[]},{"id":"111271b9.43e14e","type":"freeboard","z":"282f2cb4.0b1164","name":"v","x":417,"y":102,"wires":[]},{"id":"3f40040b.7d5ddc","type":"freeboard","z":"282f2cb4.0b1164","name":">","x":367,"y":264,"wires":[]},{"id":"65d0128e.be831c","type":"freeboard","z":"282f2cb4.0b1164","name":"<","x":353,"y":352,"wires":[]},{"id":"28e5dd0f.34a2a2","type":"ui_switch","z":"282f2cb4.0b1164","name":"","label":"^","group":"c8f421c4.2b8b1","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":84,"y":158,"wires":[["744bed9a.120ab4","111271b9.43e14e"]]},{"id":"723ffab5.9d0154","type":"ui_switch","z":"282f2cb4.0b1164","name":"","label":"v","group":"c8f421c4.2b8b1","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":81,"y":242,"wires":[["76963dab.7db304","3f40040b.7d5ddc"]]},{"id":"de62a34.7c65f6","type":"ui_switch","z":"282f2cb4.0b1164","name":"","label":"<","group":"c8f421c4.2b8b1","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":82,"y":330,"wires":[["799bb4e7.ddb5ec","65d0128e.be831c"]]},{"id":"a01a4ffa.ea24b","type":"ui_switch","z":"282f2cb4.0b1164","name":"","label":">","group":"c8f421c4.2b8b1","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":84,"y":472,"wires":[["3cdf4b80.64ea24","c3071b0b.9a9c98"]]},{"id":"c3071b0b.9a9c98","type":"freeboard","z":"282f2cb4.0b1164","name":">","x":287.94447326660156,"y":502.2153015136719,"wires":[]},{"id":"46aa28ae.e4fdc8","type":"arduino-board","z":"","device":"/dev/ttyACM0"},{"id":"c8f421c4.2b8b1","type":"ui_group","z":"","name":"Default","tab":"c9dac48d.106528","disp":false,"width":"12"},{"id":"c9dac48d.106528","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

              You should modify the Nodes, with your custom settings.
              And click DEPLOY BUTTON to run your program.
              In the end. in order to command in the node-red . Open this adress ip http://127.0.0.1:1880/ui/#/0
              So the control of the node-red is ready

              Transmitter circuit with Arduino-Uno

              Now for the transmitter circuit, you will have to bear in mind that this is your remote. So The HT12E encoder are 12 bit encoders that is they have 8 address bits and 4 data bits. The address bits can be left open or pulled low. In the circuit below, you will see that each of the address pins (A0 to A7) are connected to output arduino pin 9 to 12 . So if the pin arduino is ON then that line is connected to GND (VSS) otherwise the pin is left floating.
              The TE (transmit enable) is an active low input to the IC. This enables the transmission. So when the pin-arduino connected to pin 14 is pressed, the 8 address bits along with the 4 data bits (AD8 to AD11) are serially encoded and sent out at the DOUT pin.

              For our application (RC robot car) we will connect TE directly to GND as we have to keep sending the data as and when they arrive to the rc car.

              The aim of using the optocoupler is we can also provide electrical isolation/seprate between an arduino source and an HT12E encoder load using just light

              Your use of the Node-red helps you control through the computer to order to go forward, back or turn left or right through the command set

              Unlike the receiver circuit, this does not need to have a beefy battery. You could power this circuit with output 5V arduino. This circuit will help you understand how the system works and how to install your project for transmission section

              Remote receiver/decoder circuit 


              This is the circuit diagram for the receiver. It handles the RF reception as well as the motor drive.
              The address pin in the decoder (HT12D) behaves just like that of the encoder. The data is received at the DIN pin from the RF receiver circuit and then this data is checked 3 times (according to the datasheet the data is transmitted 3 times and received 3 times and only if all 3 times the data is same it is decoded) and then decoded and the IC checks if the address pin connection of the encoder is same as that of the decoder. If the address configuration of the decoder matches that in in the received data (from encoder) the data is decoded and latched on to the data pins (D8 to D11).
              This decoded data is then sent as control signals to the motor driver IC. L293d is a dual H-bridge motor driver to be short. It is used to drive the motor in both forward and back ward direction. Read about the basics of DC motor drive and their speed control to get a better understanding of this concept.
              The VT (valid transmit) pin is used to indicate if there is a valid transmission between the encoder and decoder. This pin can be left open or like in the circuit below, an LED with series resistance can be used to give a visual indication.

              Power Solar


              For Circuit power supply You will use a Panel PV 12V, a Regulator and a battery 12V
              Photovoltaic panel (PV) is used to directly transform sunlight into electricity since they are made of semiconductor materials based on silicon. store directly on 12v battery by using a solar charger

              The solar charger controller has two functions:
              *Protection against reflux.
              *Limitation of the load voltage.
              It is easy to spot reflux protection in the circuit. If the voltage at the terminals of the accumulator exceeds that of the panel, the Schottky diode D3 prevents the current from circulating from the positive pole of the accumulator to that of the solar panel independently of the state of the rest of the circuit. The load current passes freely in the opposite direction. The voltage loss at the terminals of the power diode is approximately. The solar current can also pass through D4 and T2 when the transistor conducts. The transistor is controlled by the operational amplifier which acts as a comparator. T1 and P1 make it possible to provide an equalized reference voltage equal to approximately half of the final load voltage. The operational amplifier compares the reference voltage with the voltage of the accumulator halved by R1 and R2 and by D2. the output of the AOP remains low as long as the battery voltage is less than the final charging voltage, so that the channel through T2 is inhibited. LED D1 is off. However, if the voltage at the terminals of the battery exceeds the voltage at the end of charging, the output of the comparator jumps to the high level (D1 lights up), switching T2 and short-circuiting the solar panel.With the aid of solar charge regulator, the charge of the battery is ensured which allows us to supply the control receiver circuit

              Cameras

              For remote monitoring. You have to install droid-cam One on two mobile androids and the other on your computer
              for computer droidcam Open up a V4L2 compatible program (VLC player, Skype, Cheese, etc) and you should see DroidCam listed as a video device.
              Install:-->For mobile: All you have to do is download application DroidCam from playstore
                      -->For computer ubuntu/lunix: Download DroidCam Linux client from the official links below:
              Extract and open the result folder in terminal by selecting “Open in Terminal” from its context menu.

              When the terminal opens, run the install script to make and install the client in your system:
              Type in your password when it asks (no visual feedback) and hit Enter.

              Once installed, you should be able to launch the client by running droidcam command in terminal.
              To create a launcher shortcut, run command to create an empty configuration file:
              gedit ~/.local/share/applications/droidcam.desktop
              And paste below lines when the files opens and save it.
              [Desktop Entry]
              Version=1.0
              Type=Application
              Terminal=false
              Name=DroidCam
              Exec=droidcam
              Comment=Use your Android phone as a wireless webcam or an IP Cam!
              Icon=droidcam
              Categories=GNOME;GTK;Video;
              Name[it]=droidcam
              for windows: Download and install directly from this links below:

              Now you have to use droidcam
              -->Launch DroidCam app in your Android device:
              -->Launch DroidCam client in Ubuntu machine. Select connection mode, type in ip (if need), and click Connect.
              -->Once connected, open a webcam specific app, like Cheese, in Ubuntu and select “DroidCam (v4l2loopback)” as its webcam device.
              Finally you’ll see what your Android camera sees in the Cheese window. That’s it.

              PCB Art work

              Highly optimized PCB design using Eagle Cad is provided below. Both the PCB design for remote control, as well as solar charger is designed as small as possible. Just print these three PCBs and solder it with the electronic components required. After soldering test all the components with a multimeter.


              Video :





              2 commentaires: