Skip to navigation Skip to content
  • 1800 266 6123
  • Customer Support
  • My Orders
  • Track your order
  • My Account
    • My Account
    • My Cart
    • Checkout
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
0 ₹ 0.00
All Categories
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
  • Home
  • Shop
    • Shop
    • Featured Brands
    • Track your order
    • Payment Options
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
    • Blogs
    • Tutorials
    • Videos
  • BOM Tool
  • Careers
  • Sell on Robu
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Search
  • 0
  • Home
  • Shop
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
  • BOM Tool
  • Careers
  • Sell on Robu
HomeBlogsRaspberry Pi Zero 2W : How to log data to an external data service easily like MongoDB

Raspberry Pi Zero 2W : How to log data to an external data service easily like MongoDB

Blogs, IOT and Wireless, Microcontroller, Programming/Software, Raspberry Pi  0  comments  385 Views  Monday, June 17, 2024











In this example we’ll learn how to set things up so that we can send data to external service and save it there reliably for long tern storage solution, rather

Raspberry Pi Zero 2W

In this example we'll learn how to set things up so that we can send data to external service and save it there reliably for long tern storage solution, rather than storing data locally with space and size constraints.

So, lets get started without wasting any time.

  • What is Raspberry Pi ?
  • Pi Zero 2W
    • Features
  • External Data Logging
  • What is MongoDB ?
  • MongoDB Atlas
  • Hardware Requirements of this Project
  • Software Requirements of this Project
  • Prerequisites
  • Code
  • Conclusion

What is Raspberry Pi ?

It's a small, affordable, single-board computer developed by the Raspberry Pi Foundation. Designed initially for educational purposes, it provides a platform for learning programming, computer science, and even in few industries. Over time, it has gained popularity among hobbyists and professionals for its versatility in various projects, such as home automation, media centers, robotics, and more.

The Raspberry Pi runs a variety of operating systems, most notably Raspberry Pi OS (formerly Raspbian), which is based on Debian Linux. It supports programming languages like Python, C, C++, Java, and others, making it an ideal tool for both beginners and advanced users.

The device features USB ports, HDMI output, GPIO pins for hardware projects, and network connectivity, making it a powerful and flexible tool for numerous applications.

Pi Zero 2W

The Raspberry Pi Zero 2W is a compact and cost-effective variant of the Raspberry Pi series, designed to offer significant performance improvements over its predecessor, the Raspberry Pi Zero W.

Released by the Raspberry Pi Foundation, the Pi Zero 2W retains the small form factor of the original Pi Zero models but its new features and enhanced specifications, making it more capable for various projects.

Features

  • A quad-core 64-bit ARM Cortex-A53 CPU, which provides a significant performance boost compared to the single-core CPU of the original Pi Zero.
  • 512MB of LPDDR2 SDRAM, sufficient for lightweight computing tasks and various IoT applications.
  • Integrated 2.4GHz IEEE 802.11b/g/n wireless LAN and Bluetooth 4.2, offering robust wireless communication capabilities.
  • CSI-2 camera connector, allowing the attachment of Raspberry Pi camera modules.
  • Mini HDMI port for video output.

The Raspberry Pi Zero 2W is designed to be a low-cost, low-power solution suitable for projects that require a small form factor and modest computing power. Its improved performance and connectivity make it ideal for embedded applications, DIY electronics, portable projects, and educational purposes.

External Data Logging

For the purpose of logging data, we'll  be using Mongo DB for easy and reliable storage of data. Why? Because there are many good libraries to help us with the process and not to mention the community support. 

What is MongoDB ?

MongoDB is a popular NoSQL database that uses a document-oriented data model. Unlike traditional relational databases that use tables and rows, MongoDB stores data in flexible, JSON-like documents.

Here are some key features and concepts associated with MongoDB:

  • Document-Oriented: Data is stored in documents (similar to JSON objects), which allows for flexible and dynamic schemas. This means each document can have different fields and structures, making it easier to store complex hierarchical data.
  • Collections: Documents are grouped into collections, which are analogous to tables in relational databases. However, unlike tables, collections do not enforce a fixed schema.
  • Schema Flexibility: MongoDB's schema-less design allows for rapid iteration and changes to the data model without requiring extensive database migrations.
  • Scalability: MongoDB is designed to scale horizontally by distributing data across multiple servers (sharding). This makes it suitable for handling large volumes of data and high-throughput operations.
  • Indexing: MongoDB supports various types of indexes to optimize query performance, including single-field, compound, and geospatial indexes.
  • Aggregation Framework: MongoDB provides a powerful aggregation framework for performing data analysis and transformations. It allows for operations like filtering, grouping, sorting, and reshaping data.
  • Replication: MongoDB offers replica sets, which are groups of MongoDB instances that maintain the same data set, providing high availability and data redundancy.
  • ACID Transactions: Starting from version 4.0, MongoDB supports multi-document ACID (Atomicity, Consistency, Isolation, Durability) transactions, making it possible to perform complex operations across multiple documents with consistency guarantees.
  • High Performance: MongoDB is optimized for fast read and write operations, making it suitable for applications that require low-latency access to data.
  • Wide Adoption: MongoDB is widely used in various industries, including finance, gaming, IoT, e-commerce, and more, due to its versatility and ease of use.

In short, MongoDB is a highly flexible and scalable database that is well-suited for modern applications requiring dynamic data models, high performance, and ease of scalability.

MongoDB Atlas

MongoDB Atlas is a fully managed cloud database service provided by MongoDB. It simplifies the deployment, management, and scaling of MongoDB databases in the cloud.

Here are some of its key features and benefits:

  • Fully Managed Service: MongoDB Atlas takes care of database administration tasks such as provisioning, patching, scaling, and backups, allowing developers to focus on building applications rather than managing infrastructure.
  • Multi-Cloud Support: Atlas runs on multiple cloud platforms, including Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure. This allows users to choose the cloud provider that best fits their needs and take advantage of multi-cloud strategies.
  • Scalability: Atlas supports horizontal scaling through sharding, allowing databases to handle large datasets and high-traffic workloads. It also offers vertical scaling by upgrading instance sizes as needed.
  • Performance Optimization: Atlas provides automated performance optimization tools, such as index recommendations and query performance insights, to help maintain efficient database operations.
  • Monitoring and Alerts: Atlas provides comprehensive monitoring and alerting capabilities, allowing users to track database metrics and receive notifications for potential issues.
  • Serverless and Dedicated Options: Atlas offers flexible deployment options, including serverless instances for applications with unpredictable workloads and dedicated clusters for more consistent performance and resource control.
  • Backup and Restore: Atlas offers automated backup services with point-in-time recovery options, ensuring that data can be restored to any specific moment within the backup retention period.

Hardware Requirements of this Project

  • Raspberry Pi Zero 2W
  • Pi Zero/ Zero 2W Case
  • 32GB Micro SD Card
  • Heat Sinks
  • Cables

Software Requirements of this Project

  • Python Packages and few other dependencies

Prerequisites

Before we begin, we gonna need a fully ready Pi Zero 2W. If you don't have one yet, please visit this guide here. And follow the steps to get the Pi Zero 2W ready in no time.
In there you'll also find a guide on how to SSH into your Pi so that you don't need extra display and inputs. 

Now we need to install few libraries before we can run code on it.
1. dotenv for accessing sensitive information securely like password stored on the system.
2. motor for accessing MongoDB, as motor provides asynchronous functionalities.
3. asyncio to make our code asynchronous, mitigating any deadlocks or slowdowns.

Install the above libraires by the command-
sudo apt install python3-dotenv
sudo apt install python3-motor
sudo apt install python3-asyncio

After installing the above libraires, next we move onto making a folder where we'll save the files required for this project.
Make a folder by the command - mkdir database_examples
Now we move into that folder by cd database_examples/

Now first we head into the MongoDB's website and make a new project there and get a cluster allocated. For this well be needing the free tier which is shared option. However the method will be the same for any of the tiers.

After getting a cluster, head into its database access. Make a new user, and set its permissions. And generate the password. Copy that password, we gonna need it later. Now save and exit that page.
Create a database, give its name for eg: Test and deploy it. It might take some time.

Coming back to the console, now we create a file in that folder named token.env by -
sudo nano token.env,  and in here we'll be storing all of our passwords and and other sensitive information's.  
username = <the name of the user>
password = <the password you copied before hand>
and save and exit the editor.

Next we make out main file by the command sudo nano test.py for example. And copy the code from the coding section and past it there. I have included all the basic functions in one file, and you can study the code and modify it to suit your need.

Code

Copy the following code, and save it. And after exiting the editor, run it by command python <file_name>.py

from dotenv import dotenv_values
from time import sleep
import asyncio
import motor.motor_asyncio

cluster = motor.motor_asyncio.AsyncIOMotorClient("mongodb+srv://"+dotenv_values('token.env')['username']+":"+dotenv_values('token.env')['password']+"@test.7sf9cvi.mongodb.net/?retryWrites=true&w=majority&appN>db = cluster["Shop"]
collection = db["Shelfs"]

async def find_one():
        reply = await collection.find_one({"_id": 1})
        if reply:
                print("Find Success")
                print(reply)
        else:
                print("Find Failiure")

async def insert_one():
        reply = await collection.insert_one({"_id": 1, "Name": "Hello"})
        if reply:
                print("Insert Success")
                print(reply)
        else:
                print("Insert Failiure")

async def update_one():
        update = await collection.update_one({"_id": 1},{"$set": {"Name": "Hello World"}})
        if update:
                print("Update Success")
                print(update)
        else:
                pritn("Update Failiure")

async def delete_one():
        reply = await collection.delete_one({"_id": 1})
        if reply:
                print("Delete Success")
                print(reply)
        else:
                print("Delete Failure")

if __name__ == "__main__":
        loop = asyncio.get_event_loop()

        loop.run_until_complete(insert_one())
        loop.run_until_complete(find_one())
        loop.run_until_complete(update_one())
        loop.run_until_complete(delete_one())

Conclusion

After this, you'll be able to manipulate data from an external data service instead of relying on locally data management. Also with this knowledge, you would be able to log data from various sensors and offload it from the Raspberry Pi Zero 2W to MongoDB.


Tags : MongoDB , Raspberry pi , Raspberry Pi Article

Share This Article


About Robu

Robu Single Logo

India's biggest robotics E-commerce company. Robu deals with Arduino, Raspberry Pi, Sensors, Drone parts, 3D printer parts, E-bike accessories and Electronics components etc. Click here to explore range of Robotics products available at Robu. Also, do not forget to follow us on Facebook, Instagram and YouTube because we are constantly contributing to the community by creating content around Arduino, Raspberry Pi, Drones, Sensors etc.


Related Posts

card image
What is Jetson Nano?

 Monday October 11, 2021      2863 Views

This blog will see the basics of the Jetson Nano, its onboard specification, advantages, disadvantages, and application. Then, we will cover the different areas of application where this board can be ... Read More

card image
Orange Raspberry Pi Advanced Kit

 Monday January 31, 2022      1143 Views

Hello there, and welcome back. In this blog, we will discuss the Orange Raspberry Pi Advanced Kit. This kit is only available on Robu.in.... Read More

card image
Selecting Quadcopter Motor: A Detailed Guide 2021

 Wednesday December 16, 2020      7239 Views

This guide will give you a better understanding of how to select the quadcopter motor and the parameters on which they're selected.... Read More

card image
Short Intro Of IoT ? And some basic Knowledge You need To know....

 Tuesday October 30, 2018      2256 Views

The article covers what is IoT? Its history and the future of IoT.... Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

Search Post


Related Posts

A Beginner Guide to NodeMCU
What is a Development Board?
Boost Your DIY Project: Built a Stunning Digital Clock with Seeed Studio XIAO ESP32S3, OLED Display, and NTP Accuracy
3D Printer Types Explained In Details - SLA, DMLS, FDM, SLS


Subscribe to our Newsletter
to get promotional offers & discounts
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Services

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • Investor Relations
  • MACFOS CSR
  • Privacy policy
  • Terms of Service
  • Shipping & Refund
  • E-Waste Collection

Download Our App

google-play-badge
iOS App Link
© Robu.in is registered trademark of MACFOS LIMITED - All Rights Reserved

Subscribe to our Newsletter

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Why Choose us

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • ABOUT US
  • Shipping & Refund Policy
  • Terms of Service
  • Privacy policy
  • Shipping Time / Delivery Time
  • Guarantee/Warranty
  • Changing or Canceling An Order
  • Payment Options
  • MACFOS LIMITED CSR
  • Investor Relations

Download Our App

google-play-badge
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Plese Fill this details