Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Mushroom Chen
Created July 28, 2024

Neural network integrated Hydrogel-based exoskeleton

Meet the Hydrogel Exoskeleton: flexible, lightweight, and adaptive. Empowering those with low leg strength to walk independently and confide

25

Things used in this project

Hardware components

nRF52840 Development Kit
Nordic Semiconductor nRF52840 Development Kit
×1
Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1
Blues Notecard (Cellular)
Blues Notecard (Cellular)
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Cable Cutter, 143mm
Cable Cutter, 143mm
10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long

Story

Read more

Schematics

Setup

Code

Code for location and force detection

Python
import time
import board
import busio
import adafruit_mpu6050
import numpy as np

# Initialize I2C communication
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_mpu6050.MPU6050(i2c)

# Placeholder function for neural network prediction
def neural_network_predict(data):
    # Simulate complex data processing with a neural network
    # Generate mock predictions for demonstration purposes
    location = np.random.uniform(0, 1)  # Mock location between 0 and 1
    swelling_degree = np.random.uniform(0, 1)  # Mock swelling degree between 0 and 1
    force = np.random.uniform(0, 10)  # Mock force between 0 and 10 Newtons
    return location, swelling_degree, force

# Placeholder function to control the exoskeleton based on neural network predictions
def control_exoskeleton(location, swelling_degree, force):
    # Implement the control logic for the exoskeleton here
    # Adjust the support provided by the hydrogel based on the predictions
    print(f"Adjusting exoskeleton: Location={location}, Swelling Degree={swelling_degree}, Force={force}")
    # Example control logic (to be replaced with actual implementation):
    # If swelling_degree is high, reduce water absorption rate
    # If force is low, increase support in the corresponding location
    pass

# Main loop to continuously read sensor data and adjust the exoskeleton
while True:
    # Read motion sensor data
    acceleration = sensor.acceleration
    gyro = sensor.gyro
    
    # Preprocess sensor data for neural network input
    data = np.array([
        acceleration[0], acceleration[1], acceleration[2],
        gyro[0], gyro[1], gyro[2]
    ])
    
    # Normalize data (example normalization, adjust as needed)
    data = data / np.linalg.norm(data)
    
    # Predict swelling location, degree, and generated force
    location, swelling_degree, force = neural_network_predict(data)
    
    # Output the results
    print(f"Swelling Location: {location:.2f}")
    print(f"Swelling Degree: {swelling_degree:.2f}")
    print(f"Generated Force: {force:.2f} N")
    
    # Control exoskeleton based on the neural network output
    control_exoskeleton(location, swelling_degree, force)
    
    # Wait before next reading
    time.sleep(0.1)

Credits

Mushroom Chen

Mushroom Chen

1 project • 1 follower

Comments